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

Inject offloading literal env vars #6027

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

eapolinario
Copy link
Contributor

Tracking issue

Related to #5103

Why are the changes needed?

Flytekit uses the environment variables _F_L_MIN_SIZE_MB and _F_L_MAX_SIZE_MB to define the minimum and maximum sizes (in MB) for offloading literals. This PR injects those variables in case offloading is enabled.

What changes were proposed in this pull request?

Inject 2 new variables to task pods in case offloading of literals is enabled.

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: Eduardo Apolinario <[email protected]>
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.06%. Comparing base (25cfe16) to head (9b1f108).
Report is 29 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6027      +/-   ##
==========================================
+ Coverage   33.09%   37.06%   +3.97%     
==========================================
  Files        1013     1316     +303     
  Lines      107489   132115   +24626     
==========================================
+ Hits        35570    48967   +13397     
- Misses      68767    78895   +10128     
- Partials     3152     4253    +1101     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.10% <ø> (?)
unittests-flytecopilot 22.23% <ø> (ø)
unittests-flytectl 62.46% <ø> (+0.02%) ⬆️
unittests-flyteidl 7.25% <ø> (+0.32%) ⬆️
unittests-flyteplugins 53.72% <100.00%> (-0.12%) ⬇️
unittests-flytepropeller 42.63% <ø> (-0.28%) ⬇️
unittests-flytestdlib 57.59% <ø> (+2.27%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

envVars = append(envVars,
v1.EnvVar{
Name: "_F_L_MIN_SIZE_MB",
Value: strconv.FormatInt(propellerConfig.LiteralOffloadingConfig.MinSizeInMBForOffloading, 10),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we could directly use strconv.Itoa() which defaults to base 10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://pkg.go.dev/strconv#FormatInt handles int64 directly (which those two values are, instead of int).

Comment on lines 385 to 391
assert.NoError(t, propellerCfg.SetConfig(&propellerCfg.Config{
LiteralOffloadingConfig: propellerCfg.LiteralOffloadingConfig{
Enabled: tt.offloadingEnabled,
MinSizeInMBForOffloading: 1,
MaxSizeInMBForOffloading: 42,
},
}))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit : I think instead of introducing SetConfig, you could do this

			cfg := propellerCfg.GetConfig()
			cfg.LiteralOffloadingConfig = propellerCfg.LiteralOffloadingConfig{
				Enabled:                  tt.offloadingEnabled,
				MinSizeInMBForOffloading: 1,
				MaxSizeInMBForOffloading: 42,
			}

As GetConfig returns a pointer.

Signed-off-by: Eduardo Apolinario <[email protected]>
@eapolinario eapolinario merged commit 45935e4 into master Nov 19, 2024
52 checks passed
@eapolinario eapolinario deleted the set-offload-literals-env-vars branch November 19, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants