You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove dependency on external URL for fly execute #2069
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.
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?
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.)
@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.
Activity
vito commentedon Mar 6, 2018
This will also make it so
fly executecan run on Darwin/Windows without needing a Linux worker to run thearchiveresource. Neat!add plan types for pipe_read, pipe_write
add plan types for pipe_read, pipe_write
vito commentedon Mar 13, 2018
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?add ability to send user input to the build plan
vito commentedon Mar 14, 2018
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.)add ability to send user input to the build plan
add artifact output endpoint
expect gzip from baggageclaim stream apis
fix tricky synchronization for run state i/o
wait for build to be tracked when sending i/o
gzip-compress StreamIn/StreamOut
4 remaining items
vito commentedon Mar 15, 2018
It works! 🎊 Next up is to just add progress indicators for uploads/downloads in Fly, now that there's no
archiveresource on the other end.Also:
archiveresource and mark its repo deprecated.vito commentedon Mar 15, 2018
This has made
bin-docker-testflightway more stable:https://ci.concourse-ci.org/teams/main/pipelines/main/jobs/bin-docker-testflight/builds/745
thru
https://ci.concourse-ci.org/teams/main/pipelines/main/jobs/bin-docker-testflight/builds/710
bump atc go-runewidth pb.v1
remove 'pipes' api and object
allow running testflight against quickstart
trim down install instructions; focus on binary
marco-m commentedon Apr 13, 2018
@vito What I am missing is this: when is
--external-urlstill needed forconcourse web? (I see the option is still there in 3.10).vito commentedon Apr 13, 2018
@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.
Until Concourse 3.10, `external-url` was needed to allow `fly execute`
bump etree tsa handlers mux clockwork goxmldsig genproto grpc
trim down install instructions; focus on binary