Skip to content

spawn pipeline collect reads result_s3_bucket, which nothing writes, and collects only the first 1000 objects #989

Closed

Description

@scttfrdmn

Found while fixing #943/#944 (PRs #972, #980). Found by reading runCollectPipeline in cmd/pipeline.go on branch fix/956; not reproduced against AWS.

1. collect reads result_s3_bucket, which nothing writes. runCollectPipeline uses state.ResultS3Bucket/ResultS3Prefix when they are set, and falls back to the stage outputs (<s3_prefix>/stages, or the run's prefix after #943) only when they are empty. Nothing in the pipeline path writes to the result bucket:

  • grep -rn 'ResultS3' --include='*.go' finds it only in the record, the CLI's read, and two export SPAWN_RESULT_S3_* lines in the stage user data.
  • The stage runner uploads data_output to s3_bucket only.
  • The stage instance profile (pipeline.StageDataPolicy) grants s3_bucket/<s3_prefix>/* only, so a stage command could not write the result bucket even if it tried.

examples/pipelines/ml-training.json, fanout-fanin.json and video-streaming.json all set result_s3_bucket. So spawn pipeline collect <id> on any of them lists an empty location and prints "No results found", although the outputs are in s3_bucket.

2. Only the first 1000 objects are collected. runCollectPipeline makes one ListObjectsV2 call with no pagination. A pipeline with more outputs is truncated silently. The command still prints "✅ Downloaded N files".

Smaller, same function:

  • It downloads the COMPLETE/FAILED markers as if they were results.
  • It builds the local path as <output-dir>/<full S3 key>, without checking that the key stays inside the directory.

Suggested:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions