Skip to content

Proposal: ability for a job to process all versions of a resource #358

Closed

Description

@vito
# a plan that will run against every version of `my-repo`, in order:
plan:
- get: my-repo
  version: every

# a plan that will run against the latest version of `my-repo` (today's behavior):
plan:
- get: my-repo
  version: latest

This would lead into the later feature allowing version: {"some": "exact-version"} (#256).

Semantically the only thing that would change is that, whenever we're determining the next candidate inputs for a job, rather than starting at the latest version and moving back, we start at the version after the most recently used version and move forward.

Note: if a job has never used any versions of a resource before, we should use the latest. Otherwise a newly added job would have to walk through all versions, which could take absolutely forever.

Activity

  1. jtarchie commented on Apr 7, 2016

    @jtarchie
    Contributor

    How does a resource get a specified version if the check hasn't returned the full set of versions?

    For example, when the check initially for the git resource, it only return the most recent SHA. If someone specified version: {"some": "HEAD^^"} it wouldn't exist in the list of versions. Right?

  2. concourse-bot commented on Apr 7, 2016

    @concourse-bot

    Hi there!

    We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

    The current status is as follows:

    • #117192473 Proposal: ability for a job to process all versions of a resource

    This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

  3. zachgersh commented on Apr 7, 2016

    @zachgersh
    Contributor

    so what starts to happen if I have a plan that looks like this:

    plan:
    - get: this-repo
      version: every
    - get: that-repo
      version: every
    - get: one-more-repo
      version: every

    Do we run the commit versions off of these in batches?

  4. robdimsdale commented on Apr 8, 2016

    @robdimsdale
    Contributor

    @zachgersh raises an interesting question. My original assumption was that it would run through all permutations, but on reflection that seems like a terrible idea - far too costly and probably not useful.

    So, batching is an interesting idea but seems quite complicated. Perhaps it's easier to disallow version: every on more than one resource feeding in?

  5. vito commented on Apr 8, 2016

    @vito
    ContributorAuthor

    @jtarchie not sure yet, see #256 (which I should have referenced so discussion is centralized there). I'd rather not pass it along verbatim - it would be nice to have the resource able to say "every version to /in came from /check". But that's hard given that check returns an array not including the given version, so we can't really tell if it's valid or if there's nothing there.

  6. torarnv commented on Apr 8, 2016

    @torarnv
    Contributor

    @jtarchie

    How does a resource get a specified version if the check hasn't returned the full set of versions?

    As far as I understand it, check is supposed to return the full set of versions between the version passed to stdin and the latest version (except when called the first time, and it should only return the latest). A resource that doesn't respect this contract wouldn't be able to take advantage of version: every.

    For example, when the check initially for the git resource, it only return the most recent SHA. If someone specified version: {"some": "HEAD^^"} it wouldn't exist in the list of versions. Right?

    For the initial check you'd only want to build the latest version, similar to what @vito described for when a job runs the first time with a resource:

    Note: if a job has never used any versions of a resource before, we should use the latest. Otherwise a newly added job would have to walk through all versions, which could take absolutely forever.

    Perhaps optional input to check would signify that the initial check should indeed list all versions?

  7. torarnv commented on Apr 8, 2016

    @torarnv
    Contributor

    @zachgersh can you explain how the batching would look in your example above? Not sure I understand how that would be different from permutations (which probably is not a good approach). I'm leaning towards allowing only a single version: every.

  8. zachgersh commented on Apr 8, 2016

    @zachgersh
    Contributor

    @torarnv / @robdimsdale - so, the thing we have to figure out is If I specify three resources as every, is that an error?

    For batching, I imagine grabbing the 1st commit of each resource and running that through. Once that run passes, you can then trigger on the second commit in each resource. This doesn't seem like it would be too crazy?

  9. torarnv commented on Apr 8, 2016

    @torarnv
    Contributor

    Ah, I understand the batching approach now, thanks @zachgersh 😄

    I think having multiple version: every for a plan should probably be an error, at least for an initial stab at supporting this use-case. Permutating all the versions would be the "correct"/exhaustive way to deal with it, but as you say it's expensive resource-wise.

    Batching seems like a compromise between the two, but it's really an arbitrary way to choose which versions should be tested/built together. What's to say building version 5 of A with 5 of B and 5 of C makes more sense than 5+6+9? Same for 6+6+6 vs 6+5+7, etc. So if we're gonna limit which versions we combine, let's perhaps limit them by saying you can't do that, instead of trying to be smart about it?

  10. vito commented on Apr 8, 2016

    @vito
    ContributorAuthor

    Having multiple trigger: everys should be fine. It doesn't mean "run every permutation", it just means "make sure this job runs with every version of this resource". So if you have:

    plan:
    - get: a
      version: every
    - get: b
      version: every
    - get: c
      version: every

    ...it may run with:

    {a1, b1, c1}
    {a2, b2, c2}
    {a3, b3, c3}
    ...
    

    ...but it may equally likely run with:

    {a1, b1, c1}
    {a2, b1, c2}
    {a2, b2, c3}
    

    ...depending on the timing of when the resources are updated.

    It does NOT mean:

    {a1, b1, c1}
    {a1, b1, c2}
    {a1, b1, c3}
    {a1, b2, c1}
    {a1, b2, c2}
    ...
    {a3, b3, c3}
    

    ...for a few reasons: 1. there's nothing in version: every that indicates that it relates to other gets, and 2. it can't be done without rolling back versions (as it did when going from {a1, b1, c3} to {a1, b2, c1}, which would be very unintuitive (imagine stemcells upgrading and downgrading all the time).

    So, version: every just means that we'll never skip from x1 to x3.

  11. zachgersh commented on Apr 8, 2016

    @zachgersh
    Contributor

    @vito that's good enough for me.

  12. torarnv commented on Apr 8, 2016

    @torarnv
    Contributor

    @vito Makes sense

  13. thewoolleyman commented on Apr 8, 2016

    @thewoolleyman

    Pointed here from this question on Slack: "is there any way to ask the input git resource for the all the "skipped" commits since the last one which was built by a given job? E.g. to provide that list info to a task which publishes all of the commits which could have caused a build to fail?" -

    For jobs that are expensive (e.g. long builds) I would like a way to still use "latest" (i.e., running for every version especially across feature branches could exhaust CI resources), but allow the job to have access to every version since the last build for that job (so you know the subset of builds which might have caused the failure, and could bisect those locally).

    Could this feature support that, or is it a different request?

  14. vito commented on Apr 9, 2016

    @vito
    ContributorAuthor

    @thewoolleyman Sounds like a different request.

  15. vito commented on Apr 9, 2016

    @vito
    ContributorAuthor

    Another thing to clarify: using both passed and version: every would have to mean "process every version that satisfies the passed constraints". Otherwise you could get in a deadlock; if one of the upstream jobs doesn't have a green build for every version, a downstream job with version: every would get stuck on the next version that doesn't fit.

    So, the following get:

    get: my-repo
    passed: [upstream-job]
    version: every
    trigger: true

    ...would mean "filter versions down to those passed upstream-job, then trigger a build for each version as they become available." The trigger bit isn't that interesting; without it you would just manually trigger it and it would walk through each version. It's just there to paint a fuller picture of how things interact. This would be a thing to update in Mechanics of a Pipeline.

  16. concourse-bot commented on Apr 23, 2016

    @concourse-bot

    Hello again!

    All stories related to this issue have been accepted, so I'm going to automatically close this issue.

    At the time of writing, the following stories have been accepted:

    • #117192473 Proposal: ability for a job to process all versions of a resource

    If you feel there is still more to be done, or if you have any questions, leave a comment and we'll reopen if necessary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions