Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update metadata in ArrayNode TaskExecutionEvents #4355

Merged
merged 4 commits into from
Nov 8, 2023
Merged
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
28 changes: 28 additions & 0 deletions flytepropeller/pkg/controller/nodes/array/event_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,39 @@
OccurredAt: occurredAt,
Metadata: &event.TaskExecutionMetadata{
ExternalResources: e.externalResources,
PluginIdentifier: "container",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq: why is not container_array?

},
TaskType: "k8s-array",
EventVersion: 1,
}

// only attach input values if taskPhase is QUEUED meaning this the first evaluation
if taskPhase == idlcore.TaskExecution_QUEUED {
if eventConfig.RawOutputPolicy == config.RawOutputPolicyInline {
// pass inputs by value
literalMap, err := nCtx.InputReader().Get(ctx)
if err != nil {
return err
}

Check warning on line 136 in flytepropeller/pkg/controller/nodes/array/event_recorder.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/event_recorder.go#L132-L136

Added lines #L132 - L136 were not covered by tests

taskExecutionEvent.InputValue = &event.TaskExecutionEvent_InputData{
InputData: literalMap,
}

Check warning on line 140 in flytepropeller/pkg/controller/nodes/array/event_recorder.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/event_recorder.go#L138-L140

Added lines #L138 - L140 were not covered by tests
} else {
// pass inputs by reference
taskExecutionEvent.InputValue = &event.TaskExecutionEvent_InputUri{
InputUri: nCtx.InputReader().GetInputPath().String(),
}
}
}

// only attach output uri if taskPhase is SUCCEEDED
if taskPhase == idlcore.TaskExecution_SUCCEEDED {
taskExecutionEvent.OutputResult = &event.TaskExecutionEvent_OutputUri{
OutputUri: v1alpha1.GetOutputsFile(nCtx.NodeStatus().GetOutputDir()).String(),
}
}

Check warning on line 154 in flytepropeller/pkg/controller/nodes/array/event_recorder.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/event_recorder.go#L151-L154

Added lines #L151 - L154 were not covered by tests

// record TaskExecutionEvent
return e.EventRecorder.RecordTaskEvent(ctx, taskExecutionEvent, eventConfig)
}
Expand Down
Loading