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

Save execution namespace in system metadata #568

Merged
merged 4 commits into from
May 22, 2023
Merged

Conversation

katrogan
Copy link
Contributor

TL;DR

Save execution namespace in system metadata

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

N/A see summary

Tracking Issue

fixes flyteorg/flyte#3705

Follow-up issue

NA

go.mod Outdated
@@ -13,7 +13,7 @@ require (
github.com/cloudevents/sdk-go/v2 v2.8.0
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/flyteorg/flyteidl v1.5.5
github.com/flyteorg/flyteidl v1.5.7-0.20230522164738-0484cf8e75cc
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will rebase before merging

@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #568 (b8ab716) into master (313ac29) will increase coverage by 1.54%.
The diff coverage is 100.00%.

❗ Current head b8ab716 differs from pull request most recent head 57dd027. Consider uploading reports for the commit 57dd027 to get more accurate results

@@            Coverage Diff             @@
##           master     #568      +/-   ##
==========================================
+ Coverage   58.46%   60.00%   +1.54%     
==========================================
  Files         168      168              
  Lines       16154    13218    -2936     
==========================================
- Hits         9444     7932    -1512     
+ Misses       5871     4447    -1424     
  Partials      839      839              
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/manager/impl/execution_manager.go 72.93% <100.00%> (+2.58%) ⬆️
pkg/repositories/transformers/execution.go 82.75% <100.00%> (+2.82%) ⬆️

... and 153 files with indirect coverage changes

@@ -287,6 +287,7 @@ func TestCreateExecution(t *testing.T) {
assert.Equal(t, rawOutput, spec.RawOutputDataConfig.OutputLocationPrefix)
assert.True(t, proto.Equal(spec.ClusterAssignment, &clusterAssignment))
assert.Equal(t, "launch_plan", input.LaunchEntity)
assert.Equal(t, spec.GetMetadata().GetSystemMetadata().Namespace, "project-domain")
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add one test with namespace mapping which equals just project

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code is already testing that we're exercising namespace mapping config but added another test

@@ -650,6 +650,7 @@ func (m *ExecutionManager) launchSingleTaskExecution(
UserInputsURI: userInputsURI,
SecurityContext: executionConfig.SecurityContext,
LaunchEntity: taskIdentifier.ResourceType,
Namespace: namespace,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also make a backward compat change for older executions which dont have this namespace metadata set that it returns the project-domain which is widely used namespace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should respect the config if we're going to assume values rather than use the default mapping

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that works. wanted to make sure we have some data that we have valid data when we call the GET api even though the model wont have saved this when creating the execution

Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
@katrogan
Copy link
Contributor Author

PTAL @pmahindrakar-oss

Signed-off-by: Katrina Rogan <[email protected]>
@katrogan katrogan requested a review from pmahindrakar-oss May 22, 2023 18:45
@katrogan katrogan merged commit ed4d771 into master May 22, 2023
@katrogan katrogan deleted the execution-namespace branch May 22, 2023 19:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Housekeeping] Store execution namespace in execution closure
2 participants