Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit overlapping inputs, outputs, and task caches #1799

Closed
vito opened this issue Nov 8, 2017 · 5 comments
Closed

Permit overlapping inputs, outputs, and task caches #1799

vito opened this issue Nov 8, 2017 · 5 comments
Labels
accepted enhancement good first issue release/documented Documentation and release notes have been updated.
Milestone

Comments

@vito
Copy link
Member

vito commented Nov 8, 2017

Feature Request

What challenge are you facing?

It's pretty convenient in some cases to be able to have an output directory reside underneath an input, or be the same as an input, e.g. when making a commit to a repo.

This was a limitation from Garden-Linux that probably doesn't apply anymore with Garden-runC. As long as the mounts are given in the right order.

A Modest Proposal

Let's uh...allow it? Just remove the validation and see that it works.

One gotcha: if an input is the exact same path as an output, we shouldn't mount over it. We can probably just use the input COW volume as both the input and the output and not make a volume just for the output.

@codesuki
Copy link

My use case would be the following.
I have several build steps that all build different docker images, later I want to all upload them somewhere from one task. Now I need to collect them from different output folders. Would be nice if the output paths would be shared and you could add things to it.

@vito vito removed the enhancement label Nov 28, 2017
vito added a commit that referenced this issue Apr 11, 2018
Submodule src/github.com/aws/aws-sdk-go 637cf7628..57564ea05:
  > Merge pull request #1889 from aws/release
  > Merge pull request #1888 from aws/release
  > Merge pull request #1887 from aws/release
  > adding correct link to v2 (#1886)
  > Merge pull request #1885 from aws/release
  > Merge pull request #1882 from aws/release
  > Merge pull request #1881 from aws/release
  > private/model/api: Fix typo in docs.
  > private/model/api: Add suppression of Eventstream models (#1875)
  > Merge pull request #1876 from aws/release
  > Merge pull request #1873 from aws/release
  > Merge pull request #1872 from aws/release
  > adding sync example (#1871)
  > Merge pull request #1870 from aws/release
  > Merge pull request #1866 from aws/release
  > aws/request: Fix a typo in a comment (#1862)
  > Merge pull request #1864 from aws/release
  > Merge pull request #1860 from aws/release
  > Merge pull request #1858 from aws/release
  > Add #1854 to pending change log
  >  aws/endpoints: Use service metadata for fallback signing name (#1854)
  > Merge pull request #1855 from aws/release
  > service/s3/s3manager: fixing error string and error messages being lost (#1851)
  > Merge pull request #1852 from aws/release
  > Merge pull request #1845 from aws/release
  > aws/endpints: Remove codegen customization for CloudHSMv2 signing name (#1840)
  > service/s3: Disable S3 object ContentMD5 automatic validation (#1843)
  > Merge pull request #1841 from aws/release
  > adding custom signing name for runtime.sagemaker (#1838)
  > Merge pull request #1835 from aws/release
  > Merge pull request #1832 from aws/release
  > Merge pull request #1831 from aws/release
  > service/s3: Add ContentMD5 validation of S3 Objects (#1827)
  > 501, 'NotImplemented', will no longer be retried (#1826)
  > aws/corehandlers: Add support for AWS_EXECUTION_ENV env var (#1820)
  > Merge pull request #1828 from aws/release
  > Merge pull request #1825 from aws/release
  > Merge pull request #1821 from aws/release
  > Create CODE_OF_CONDUCT.md (#1818)
  > service/s3/s3manager: Update GetBucketRegion region hint fallback (#1804)
  > Merge pull request #1817 from aws/release
  > Update travis CI tests to include Go 1.10 (#1805)
  > Update documentation to point at the correct interface (#1813)
  > Merge pull request #1812 from aws/release
  > Merge pull request #1809 from aws/release
  > Merge pull request #1807 from aws/release
  > fixing s_code link (#1806)
  > Merge pull request #1800 from aws/release
  > rework multipart upload so that it reuses the same buffers when uploading. this significantly decreases memory consumption during upload. (#1784)
  > aws/ec2metadata: Add support for AWS_EC2_METADATA_DISABLED env var (#1799)
  > Merge pull request #1798 from aws/release
  > Merge pull request #1796 from aws/release
  > Merge pull request #1795 from aws/release
  > Release v1.13.0 (#1794)
  > fixes 1790 to use context (#1792)
  > private/model/api: bug fix with some examples excluding fields (#1791)
  > Merge pull request #1788 from aws/release
  > Adding custom retryer to AssignPrivateIpAddresses and ModifyNetworkInterfaceAttribute (#1787)
  > Merge pull request #1786 from aws/release
  > Merge pull request #1785 from aws/release
  > aws/request: Fix support for streamed payloads for unsigned body request (#1778)
  > Merge pull request #1783 from aws/release
  > Merge pull request #1782 from aws/release
  > Merge pull request #1781 from aws/release
  > Merge pull request #1780 from aws/release
  > Merge pull request #1779 from aws/release
  > Add pending change log changes. (#1774)
  > private/model/api: removing crosslinks from input/output shapes. (#1765)
  >  aws/session: Fix bug in session.New not supporting AWS_SDK_LOAD_CONFIG (#1770)
  > example/service/ec2/instancesbyRegion: Fix typos in example (#1762)
  > adds validation to ensure there is no duplication of services in models/apis (#1758)
  > Merge pull request #1773 from aws/release
  > Merge pull request #1759 from aws/release
  > aws/request: Fix Pagination handling of empty string NextToken (#1733)
  > aws/endpoints: Workaround CloudHSMv2 signing name not modeled (#1751)
  > v1.12.69 (#1757)
  > models/apis: removing incorrect named folder (#1756)
  > Fix conflict of dirname GuardDuty to guardduty. fix #1753 (#1754)
  > Merge pull request #1752 from aws/release
  > Add #1749 to change log
  > service/s3/s3manager: Fix check for nil OrigErr in Error()(#1749)
  > service/s3: Add Get/Put object presign benchmark tests (#1735)
  > Merge pull request #1747 from aws/release
  > Only set header tag len if set (#1743)
  > Merge pull request #1744 from aws/release
  > Merge pull request #1740 from aws/release
  > Merge pull request #1739 from aws/release
  > Release v1.12.63 (#1738)
  > Merge pull request #1732 from aws/release
  > example: Add Custom Retry strategy example. (#1731)
  > Merge pull request #1730 from aws/release
  > Merge pull request #1728 from aws/release
  > Merge pull request #1725 from aws/release
  > Merge pull request #1724 from aws/release
  > Merge pull request #1723 from aws/release
  > Merge branch 'master' of https://github.com/aws/aws-sdk-go
  > Changed 'on-premise' to 'on-premises'
Submodule src/github.com/concourse/atc 830a18d..ebc24ca:
  > Merge branch 'x6j8x-master'
  > Merge pull request #261 from timrchavez/timrchavez/build_event_times
  > Merge pull request #256 from baptiste-bonnaudet/vault-max-ttl
cirocosta pushed a commit that referenced this issue Oct 10, 2018
#1799

Signed-off-by: Krishna Mannem <kmannem@pivotal.io>
cirocosta pushed a commit that referenced this issue Oct 10, 2018
#1799

Signed-off-by: Krishna Mannem <kmannem@pivotal.io>
@cirocosta
Copy link
Member

Hey,


During the development of this feature, we were unsure about one use case: when two inputs overlap.

For instance, consider the following plan:

- name: input-same-input
plan:
- get: some-resource
- get: other-resource
- task: step1
config:
platform: linux
image_resource:
type: mock
source: {mirror_self: true}
inputs:
- name: some-resource
- name: other-resource
path: some-resource
run:
path: sh
args:
- '-ec'
- |
cat some-resource/other_file

There we have two separate resources pointing to the same path some-resource. Intuitivelly, this would mean that we'd have two volumes pointed to the same place:

VOLUMES         CONTAINER DIR TREE


 vol1 -----.
           |
           +--> /tmp/build/<build-id>/some-resource
           |
           |
 vol2 -----*

Given that we'd not like to stack those mounts, we end up picking one of them (based on alphabetical ordering - not necessarily in the order the inputs provided).


Do you think that's an interesting case to support?

thx!

@vito
Copy link
Member Author

vito commented Oct 10, 2018 via email

@vito vito added this to the v5.0.0 milestone Jan 10, 2019
@vito vito added release/documented Documentation and release notes have been updated. and removed release/documented Documentation and release notes have been updated. labels Jan 21, 2019
RobertLK added a commit to RobertLK/docs that referenced this issue Jan 20, 2020
This advice was out of date and confusing, since Concourse now supports overlapping input and output concourse/concourse#1799 . Update to recommend in-place update of files.
RobertLK added a commit to RobertLK/docs that referenced this issue Jan 20, 2020
This advice was out of date and confusing, since Concourse now supports overlapping input and output concourse/concourse#1799 . Update to recommend in-place update of files.

Signed-off-by: Robert Williams <robert.williams@yoti.com>
@jamie-pate
Copy link

jamie-pate commented Apr 13, 2021

One thing that's unclear from the docs is how this affects input_mapping/output_mapping, whether the input names are the same or just the paths, etc... (there's no examples of this use case that I can find)

This should work as expected right?

- get: git-src # some git resource
  version: every
  trigger: true
- task: prep
  file: git-src/prep_task.yaml
  input_mapping: {src: git-src}
  output_mapping: {src: prepped-src}
- task: test # imagine this uses multiple parallel tests or a separate container or something
  file: prepped-src/test_task.yaml # this fails trying to find the yaml file?
  input_mapping: { src: prepped-src }

prep_task.yaml:

---
# ... configure platform/image_resource etc
inputs: # is it ok to just have the same name or do they need the same path with different names?
- name: src
outputs
- name: src 
run:
  dir: src
  path: prep.sh

@jamie-pate
Copy link

jamie-pate commented Apr 13, 2021

One of my issues seems like it's causde by caches combined with this overlay... (the cached content disappears after the task ends obv)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted enhancement good first issue release/documented Documentation and release notes have been updated.
Projects
None yet
Development

No branches or pull requests

5 participants