Skip to content

Remove dependency on external URL for fly execute #2069

Closed

Description

@vito

Feature Request

What challenge are you facing?

Currently you must configure an external URL for fly execute to work. The URL has to be actually external, too, because inputs and outputs are actually modeled as gets and puts to URLs created via the ATC pipes API.

This introduces a bit of a hurdle for people getting started with Concourse, as despite its name folks people try setting it to http://127.0.0.1:8080, which won't work since the actual fetching happens in a container on the worker.

It also makes the 'getting started with Docker' flow a bit complicated on platforms like Darwin where Docker is actually run via a Linux VM, in a separate namespace. fly execute can't be made to automatically work; the container IP would probably work for fly execute but isn't really what they should be setting as the external URL (as they can't reach it from their own machine).

There's also the fact that the archive resource really isn't a resource, since it isn't really modeling anything that's versioned, and does not implement /check.

A Modest Proposal

  • Kill the archive resource.
  • Add an two new step types, primarily for internal use: get-pipe and put-pipe. These will be given GUIDs of pipes and authorization headers to use when fetching them (similar to what we do today with the Archive resource get/put).
  • The get-pipe step will simply create a volume, stream the given pipe to it, and register an artifact source under whatever name it's given.
  • The put-pipe step will take the specified artifact source name and stream it to the given pipe.

This way, the worker doesn't talk to the ATC - the ATC just streams content directly to/from volumes.

Activity

  1. vito commented on Mar 6, 2018

    @vito
    ContributorAuthor

    This will also make it so fly execute can run on Darwin/Windows without needing a Linux worker to run the archive resource. Neat!

  2. vito commented on Mar 13, 2018

    @vito
    ContributorAuthor

    It may be wise to take this opportunity to actually kill the pipes API. It's always been a bit out-of-place, and the access control for it is really awkward.

    If instead we had endpoints on a build for uploading to/downloading from a step, this could pave the way for future step types that require arbitrary user input (#783). We would just initially use it for fly execute, where the input is a tarball.

    Downloading is a bit trickier, because once the build completes all its stuff will be GCed. So we'll probably need a synchronous step type that waits for someone to download and then streams an artifact to them. Otherwise this would be a simple API to get something from the artifact repo and stream it to the response.

    Routing for this will be tricky as it would require direct interaction with an in-flight build object, which only exists on one ATC at a time, and is currently not connected in any way to the API. I suspect there'll need to be some proxying via the ATC peer URLs. Maybe there just needs to be something tracking the in-flight exec.RunStates for each build, and the API can communicate entirely through there?

  3. vito commented on Mar 14, 2018

    @vito
    ContributorAuthor

    As part of this it probably makes sense to gzip-compress BaggageClaim's StreamIn/StreamOut APIs. Otherwise these steps have to un-gzip in Go, which is costly on the ATC and seems to choke on tar czfed payloads (due to extra trailing zero padding). (It probably also makes sense to just do in general.)

  4. 4 remaining items

  5. vito commented on Mar 15, 2018

    @vito
    ContributorAuthor

    It works! 🎊 Next up is to just add progress indicators for uploads/downloads in Fly, now that there's no archive resource on the other end.

    Also:

    • Remove the archive resource and mark its repo deprecated.
    • Remove the "pipes" API.
    • Update the docs to reflect the newer simpler setup.
  6. modified the milestone: v3.10.0 on Mar 29, 2018
  7. marco-m commented on Apr 13, 2018

    @marco-m
    Contributor

    @vito What I am missing is this: when is --external-url still needed for concourse web ? (I see the option is still there in 3.10).

  8. vito commented on Apr 13, 2018

    @vito
    ContributorAuthor

    @marco-m It's still a good idea to set it, since it's exposed to things like resources for building URLs for notifications, but it's no longer part of any critical path.

  9. added a commit that references this issue on Sep 26, 2026
    aa833f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions