-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #182 +/- ##
==========================================
+ Coverage 60.36% 60.45% +0.08%
==========================================
Files 135 135
Lines 7292 7348 +56
==========================================
+ Hits 4402 4442 +40
- Misses 2447 2457 +10
- Partials 443 449 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
@@ -49,6 +50,48 @@ func GetNamespaceForExecution(tCtx core.TaskExecutionContext, namespaceTemplate | |||
return namespace | |||
} | |||
|
|||
// Initializes a pod from an array job task template with a K8sPod set as the task target. | |||
// TODO: This should be removed (it duplicates the pod plugin logic) once we improve array job handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a date here... let's see when will we actually get to this... any bets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, let me know if you have other suggestions :)
Signed-off-by: Katrina Rogan <[email protected]>
go/tasks/plugins/array/k8s/task.go
Outdated
taskTemplate, err := tCtx.TaskReader().Read(ctx) | ||
if err != nil { | ||
return LaunchError, errors2.Wrapf(ErrGetTaskTypeVersion, err, "Unable to read task template") | ||
} else if taskTemplate == nil { | ||
return LaunchError, errors2.Wrapf(ErrGetTaskTypeVersion, err, "Missing task template") | ||
} | ||
inputReader := array.GetInputReader(tCtx, taskTemplate) | ||
pod.Spec.Containers[0].Args, err = template.Render(ctx, args, | ||
pod.Spec.Containers[containerIndex].Args, err = template.Render(ctx, args, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should apply to cmd as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already combine the command and args: https://github.com/flyteorg/flyteplugins/pull/182/files#diff-01ee392f44bbd91e1e5f4afd999327e02f8f1df54fd5b5b576478e903cbcb3c2R92
(for the record, primary container always has an sdk supplied command + args)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh... is that even right? combing args... that can alter docker run behavior if a custom container is used...
I generally dislike that we have two ways of building the pod that seem to diverge and do things at different places... Any refactoring in mind to make that more readable?
for the primary container, I think flytekit only puts its command into args... and leaves the command empty to run whatever the default entrypoint in the container is... (unless the user explicitly modifies it)
right? CC @wild-endeavor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
do we support custom containers for map tasks? i thought the underlying task had to be a PythonAutoContainer task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think, generally speaking, we should make assumptions based on how we implemented Flytekit... the underlying spec allows cmd & args and I don't think this plugin should change that behavior... What do yo think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I thought we are getting rid of the args/cmd manipulation altogether from this function, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh derp, yes. thanks & done
Signed-off-by: Katrina Rogan <[email protected]>
PTAL @EngHabu |
go/tasks/plugins/array/k8s/task.go
Outdated
taskTemplate, err := tCtx.TaskReader().Read(ctx) | ||
if err != nil { | ||
return LaunchError, errors2.Wrapf(ErrGetTaskTypeVersion, err, "Unable to read task template") | ||
} else if taskTemplate == nil { | ||
return LaunchError, errors2.Wrapf(ErrGetTaskTypeVersion, err, "Missing task template") | ||
} | ||
inputReader := array.GetInputReader(tCtx, taskTemplate) | ||
pod.Spec.Containers[0].Args, err = template.Render(ctx, args, | ||
pod.Spec.Containers[containerIndex].Args, err = template.Render(ctx, args, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think, generally speaking, we should make assumptions based on how we implemented Flytekit... the underlying spec allows cmd & args and I don't think this plugin should change that behavior... What do yo think?
go/tasks/plugins/array/k8s/task.go
Outdated
taskTemplate, err := tCtx.TaskReader().Read(ctx) | ||
if err != nil { | ||
return LaunchError, errors2.Wrapf(ErrGetTaskTypeVersion, err, "Unable to read task template") | ||
} else if taskTemplate == nil { | ||
return LaunchError, errors2.Wrapf(ErrGetTaskTypeVersion, err, "Missing task template") | ||
} | ||
inputReader := array.GetInputReader(tCtx, taskTemplate) | ||
pod.Spec.Containers[0].Args, err = template.Render(ctx, args, | ||
pod.Spec.Containers[containerIndex].Args, err = template.Render(ctx, args, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I thought we are getting rid of the args/cmd manipulation altogether from this function, right?
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
TL;DR
Pod tasks can now be mapped over too. As a long term goal we should introduce Array Nodes as proposed here but this PR is an interim solution given how much refactoring introducing the new node type entails.
Type
Are all requirements met?
Complete description
How did you fix the bug, make the feature etc. Link to any design docs etc
Tracking Issue
flyteorg/flyte#1051
Follow-up issue
NA