concourse: Outputs inside across task not working
Summary
Currently i facing an issue with a task inside an across step, the task creates some files which i want to consume afterwards in another step. But the output specified in the task config is getting ignored if it runs inside an across step.
Steps to reproduce
Set outputs in a task inside of an across:
- across:
- var: name
values:
- file1
- file2
- file3
task: create-file
config:
platform: linux
image_resource:
type: registry-image
source: {repository: busybox}
run:
path: touch
args:
- manifests/((.:name))
outputs:
- name: manifests
- task: list-file
config:
platform: linux
image_resource:
type: registry-image
source: {repository: busybox}
inputs:
- name: manifests
run:
path: ls
args:
- manifests
Expected results
list-file task should have access to the manifests directory as input.
Actual results
concourse error: input not found: manifests
Triaging info
- Concourse version:
- AppVersion: 7.2.0
- ChartVersion: concourse-15.1.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (7 by maintainers)
Adding some context. This is currently working as it was coded to: https://github.com/concourse/concourse/blob/21c25554757f69e26da17301f75e07616d1083bc/atc/exec/across_step.go#L125
Each across var has a local scope, where it inherits all the outputs from previous steps. None of the outputs made within an across step are passed back to the parent scope though. So any steps that run after an
acrossstep will not have any outputs from theacrossstep available to them.This question about outputs was never raised in the RFC: https://github.com/concourse/rfcs/pull/29
I think I’ve seen this same “bug” raised three times or so now. It seems like a thing people really want to do with the across step and it makes sense to me. It would make it more powerful to use if artifacts can be passed out of the across step. It might just be complicated to code up or something 🤷
I am having the same issue.
across’ usefulness is quite limited for tasks (“fan-out”) if we cannot access the outputs afterwards (“fan-in”); at least per my current understanding.I tried
putting the outputs as part of each task, but withgitthis creates a lot of unnecessary churn and withS3this is not practical (you’d have to have a separate resource for each file produced, unless I misunderstand).