Break out task step into core and runtime sides#4109
Conversation
|
I like this change |
5a744c2 to
392c00e
Compare
atc/worker/client.go
Outdated
| ImageFetcherSpec, | ||
| TaskProcessSpec, | ||
| chan string, | ||
| ) (int, []VolumeMount, error) |
There was a problem hiding this comment.
Why is Run returning VolumeMount?
There was a problem hiding this comment.
Because we need to registerOutputs in the TaskStep. Decoupling volumes/storage from Running a step is something we would need to look into, but in the absence of a separate Storage implementation, we would have to return volumes this way.
For example, we would likely register "outputs" beforehand with a specific storage implementation, and then de-register them if the task failed. That would allow us to not depend on VolumeMounts in the future.
|
Overall, the One thing to watch out for is how |
546b51f to
7445678
Compare
|
@xtreme-sameer-vohra thanks for reviewing the PR!
@nader-ziada and I were looking at the code, and we realized that the
I agree. Currently |
move worker-specific logic into worker.Client Signed-off-by: Divya Dadlani <[email protected]>
use TaskResult as return value Signed-off-by: Nader Ziada <[email protected]>
Signed-off-by: Divya Dadlani <[email protected]>
7445678 to
472ea7f
Compare
Fix conflicts caused by PR #4118 - addition of `limit-task-step` container placement strategy
#4052 Signed-off-by: Divya Dadlani <[email protected]>
atc/exec/task_step.go
Outdated
| go func(logger lager.Logger, config atc.TaskConfig, events chan runtime.Event, delegate TaskDelegate) { | ||
| for ev := range events { | ||
| switch ev.EventType { | ||
| case runtime.InitializingEvent: |
There was a problem hiding this comment.
Doesn't look like this event is called ?
atc/exec/task_step.go
Outdated
| case runtime.StartingEvent: | ||
| step.delegate.Starting(logger, config) | ||
|
|
||
| case runtime.FinishedEvent: |
There was a problem hiding this comment.
Doesn't look like this event is called ?
There was a problem hiding this comment.
we'll address these changes in a follow up PR because it's been a while since this PR has been open and keeping it up to date with master is problematic.
| } | ||
|
|
||
| step.succeeded = (status == 0) | ||
| close(events) |
There was a problem hiding this comment.
Should it be RunTaskStep's responsibility to close the channel since it is the producer?
- task_step - move event processing block closer to consumer - worker/client.go - avoid hoisting to improve readability
Minor refactor Signed-off-by: Divya Dadlani <[email protected]>
7a9db91 to
bbc3299
Compare
Signed-off-by: Divya Dadlani <[email protected]>
|
Another thing to consider is that for heavy tasks like Strabo, we will be creating a lot more goroutines since a new event goroutine is created for every task container |
|
@concourse/runtime can you folks decide whether this needs a release note? On the surface it's a refactor, but I see allusions to operability effects. If it doesn't need a release note, just add the |
|
@pivotal-jamie-klassen @ddadlani |
|
I agree with @xtreme-sameer-vohra , I don't think this needs to be documented because behavior shouldn't change for our users. I'll add the label now. @xtreme-sameer-vohra not sure what you mean? We did not have goroutines for task events before this change |
This is a draft PR to attempt splitting out the TaskStep into core-specific and runtime-specific concerns.
The idea is to put all runtime-specific concerns for all steps into the
worker.Clientso that we have a single place to optimize container placement and worker selection for stories such as #3695, #2928 and #3301. This PR attempts it only for the task step.The tests do not currently pass, however this is a draft PR so that others can give their feedback on this approach. Fixing the tests is a work in progress.