Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Add workflowId and workflowExecutionId information #133

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions go/tasks/plugins/hive/client/qubole_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ type QuboleCommandDetails struct {
}

type CommandMetadata struct {
TaskName string
Domain string
Project string
Labels map[string]string
AttemptNumber uint32
MaxAttempts uint32
TaskName string
Domain string
Project string
Labels map[string]string
AttemptNumber uint32
MaxAttempts uint32
WorkflowID string
WorkflowExecutionID string
}

// QuboleClient API Request Body, meant to be passed into JSON.marshal
Expand Down
13 changes: 8 additions & 5 deletions go/tasks/plugins/hive/execution_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/lyft/flytestdlib/cache"
"github.com/lyft/flytestdlib/contextutils"

idlCore "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/plugins"
Expand Down Expand Up @@ -344,11 +345,13 @@ func KickOffQuery(ctx context.Context, tCtx core.TaskExecutionContext, currentSt

taskExecutionIdentifier := tCtx.TaskExecutionMetadata().GetTaskExecutionID().GetID()
commandMetadata := client.CommandMetadata{TaskName: taskName,
Domain: taskExecutionIdentifier.GetTaskId().GetDomain(),
Project: taskExecutionIdentifier.GetNodeExecutionId().GetExecutionId().GetProject(),
Labels: tCtx.TaskExecutionMetadata().GetLabels(),
AttemptNumber: taskExecutionIdentifier.GetRetryAttempt(),
MaxAttempts: tCtx.TaskExecutionMetadata().GetMaxAttempts(),
Domain: taskExecutionIdentifier.GetNodeExecutionId().GetExecutionId().GetDomain(),
Project: taskExecutionIdentifier.GetNodeExecutionId().GetExecutionId().GetProject(),
Labels: tCtx.TaskExecutionMetadata().GetLabels(),
AttemptNumber: taskExecutionIdentifier.GetRetryAttempt(),
MaxAttempts: tCtx.TaskExecutionMetadata().GetMaxAttempts(),
WorkflowExecutionID: taskExecutionIdentifier.GetNodeExecutionId().GetExecutionId().GetName(),
WorkflowID: contextutils.Value(ctx, contextutils.WorkflowIDKey),
}

cmdDetails, err := quboleClient.ExecuteHiveCommand(ctx, query, timeoutSec,
Expand Down