This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MapTasks caching and default Log Links (#227)
* Fix input caching for catalog lookup in map tasks Signed-off-by: Haytham Abuelfutuh <[email protected]> * Use static input readers for catalog write Signed-off-by: Haytham Abuelfutuh <[email protected]> * Rename Signed-off-by: Haytham Abuelfutuh <[email protected]> * Filter by cachable subtasks Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * Unit tests and PR Comments Signed-off-by: Haytham Abuelfutuh <[email protected]> * PR comments Signed-off-by: Haytham Abuelfutuh <[email protected]>
- Loading branch information
Showing
13 changed files
with
149 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,48 @@ | ||
package array | ||
|
||
import ( | ||
"context" | ||
|
||
idlCore "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core" | ||
"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core" | ||
"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/io" | ||
"github.com/flyteorg/flytestdlib/storage" | ||
) | ||
|
||
// A proxy inputreader that overrides the inputpath to be the inputpathprefix for array jobs | ||
// arrayJobInputReader is a proxy inputreader that overrides the inputpath to be the inputpathprefix for array jobs | ||
type arrayJobInputReader struct { | ||
io.InputReader | ||
} | ||
|
||
// We override the inputpath to return the prefix path for array jobs | ||
// GetInputPath overrides the inputpath to return the prefix path for array jobs | ||
func (i arrayJobInputReader) GetInputPath() storage.DataReference { | ||
return i.GetInputPrefixPath() | ||
} | ||
|
||
func GetInputReader(tCtx core.TaskExecutionContext, taskTemplate *idlCore.TaskTemplate) io.InputReader { | ||
var inputReader io.InputReader | ||
if taskTemplate.GetTaskTypeVersion() == 0 { | ||
// Prior to task type version == 1, dynamic type tasks (including array tasks) would write input files for each | ||
// individual array task instance. In this case we use a modified input reader to only pass in the parent input | ||
// directory. | ||
inputReader = arrayJobInputReader{tCtx.InputReader()} | ||
} else { | ||
inputReader = tCtx.InputReader() | ||
return arrayJobInputReader{tCtx.InputReader()} | ||
} | ||
return inputReader | ||
|
||
return tCtx.InputReader() | ||
} | ||
|
||
// StaticInputReader complies with the io.InputReader interface but has the input already populated. | ||
type StaticInputReader struct { | ||
io.InputFilePaths | ||
input *idlCore.LiteralMap | ||
} | ||
|
||
func NewStaticInputReader(inputPaths io.InputFilePaths, input *idlCore.LiteralMap) StaticInputReader { | ||
return StaticInputReader{ | ||
InputFilePaths: inputPaths, | ||
input: input, | ||
} | ||
} | ||
|
||
func (i StaticInputReader) Get(_ context.Context) (*idlCore.LiteralMap, error) { | ||
return i.input, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.