Skip to content

Commit

Permalink
Added node execution data to show inputs and outputs (flyteorg#136)
Browse files Browse the repository at this point in the history
* Added node execution data to show inputs and outputs

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added closure class

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Removed the old wrapper classes

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Uncommented the task exec closure

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed unit tests for the closure classes

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* go mod tidy

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Adding .gitattribute file to contain rule for .rst files

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Adding gen path to .gitattr

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added comments to new structs

Signed-off-by: Prafulla Mahindrakar <[email protected]>
  • Loading branch information
pmahindrakar-oss authored and robert-ulbrich-mercedes-benz committed Jul 2, 2024
1 parent 0602fa9 commit 3bb1a33
Show file tree
Hide file tree
Showing 16 changed files with 788 additions and 312 deletions.
1 change: 1 addition & 0 deletions flytectl/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/**/**/*rst linguist-generated=true
2 changes: 1 addition & 1 deletion flytectl/cmd/config/subcommand/execution/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions flytectl/cmd/config/subcommand/execution/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ var (
type Config struct {
Filter filters.Filters `json:"filter" pflag:","`
Details bool `json:"details" pflag:",gets node execution details. Only applicable for single execution name i.e get execution name --details"`
NodeID string `json:"nodeId" pflag:",get task executions for given node name."`
NodeID string `json:"nodeID" pflag:",get task executions for given node name."`
}
24 changes: 18 additions & 6 deletions flytectl/cmd/get/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package get

import (
"context"
"fmt"

"github.com/flyteorg/flytectl/cmd/config"
"github.com/flyteorg/flytectl/cmd/config/subcommand/execution"
Expand Down Expand Up @@ -58,23 +59,23 @@ Get more details for the execution using --details flag which shows node executi
bin/flytectl get execution -p flytesnacks -d development oeh94k9r2r --details
Using yaml view for the details. In this view only node details are available. For task details pass --nodeId flag
Using yaml view for the details. In this view only node details are available. For task details pass --nodeID flag
::
bin/flytectl get execution -p flytesnacks -d development oeh94k9r2r --details -o yaml
Using --nodeId flag to get task executions on a specific node. Use the nodeId attribute from node details view
Using --nodeID flag to get task executions on a specific node. Use the nodeID attribute from node details view
::
bin/flytectl get execution -p flytesnacks -d development oeh94k9r2r --nodId n0
bin/flytectl get execution -p flytesnacks -d development oeh94k9r2r --nodID n0
Task execution view is also available in yaml/json format. Below example shows yaml
Task execution view is also available in yaml/json format. Below example shows yaml. This also contains inputs/outputs data for each node
::
bin/flytectl get execution -p flytesnacks -d development oeh94k9r2r --nodId n0 -o yaml
bin/flytectl get execution -p flytesnacks -d development oeh94k9r2r --nodID n0 -o yaml
Usage
`
Expand Down Expand Up @@ -115,7 +116,18 @@ func getExecutionFunc(ctx context.Context, args []string, cmdCtx cmdCore.Command

if execution.DefaultConfig.Details || len(execution.DefaultConfig.NodeID) > 0 {
// Fetching Node execution details
return getExecutionDetails(ctx, config.GetConfig().Project, config.GetConfig().Domain, name, cmdCtx)
nExecDetailsForView, err := getExecutionDetails(ctx, config.GetConfig().Project, config.GetConfig().Domain, name, execution.DefaultConfig.NodeID, cmdCtx)
if err != nil {
return err
}
// o/p format of table is not supported on the details. TODO: Add tree format in printer
if config.GetConfig().MustOutputFormat() == printer.OutputFormatTABLE {
fmt.Println("TABLE format is not supported on detailed view and defaults to tree view. Choose either json/yaml")
nodeExecTree := createNodeDetailsTreeView(nil, nExecDetailsForView)
fmt.Println(nodeExecTree.Print())
return nil
}
return adminPrinter.PrintInterface(config.GetConfig().MustOutputFormat(), nodeExecutionColumns, nExecDetailsForView)
}
return adminPrinter.Print(config.GetConfig().MustOutputFormat(), executionColumns,
ExecutionToProtoMessages(executions)...)
Expand Down
Loading

0 comments on commit 3bb1a33

Please sign in to comment.