-
Notifications
You must be signed in to change notification settings - Fork 671
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
Feat: Declarative management of matcheable resources #5599
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Fabio Grätz <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5599 +/- ##
==========================================
- Coverage 35.90% 32.14% -3.76%
==========================================
Files 1301 1008 -293
Lines 109419 90357 -19062
==========================================
- Hits 39286 29047 -10239
+ Misses 66036 58234 -7802
+ Partials 4097 3076 -1021
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@katrogan my initial plan was to invoke this logic together with the |
Values []WorkflowExecutionConfig `json:"values" pflag:", The list of workflow execution configs to be managed."` | ||
} | ||
|
||
type WorkflowExecutionConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config override is not fully implemented yet because it has a lot of nested sub configs. Might do so in another PR to not overload this one.
"github.com/flyteorg/flyte/flytestdlib/config" | ||
) | ||
|
||
const SectionKey = "matcheableResources" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:
Matcheable resources is "internal naming" according to the docs.
How should we call this? configCustomizations
or configOverrides
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to anything that's not matchable resources :) I like configOverrides although both sound great!
I'm not entirely sure this is the correct approach, how would it work if a user of a flyte platform wants to declare their resources? Or are we just considering this feature to be used by the owners/maintainers of the platform? We're very much pro-self-serve and take those responsibilities out of the platform maintainers, we've ended up building a controller that has it's own Object that creates/updates/deletes flyte projects and some of their resources. Happy to demo it :) |
Yes, exactly.
Would be curious to see it! Do users need I feel that being able to manage these things through the helm values is in line with how everything else can be configured in Flyte today :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is awesome, thank you for putting up this PR!
@katrogan my initial plan was to invoke this logic together with the seed-projects logic in the init container. That won't work though because the init container is not re-executed when the config map changes. Do you have a suggestion where to best move this? Treat it the same way we treat the "cluster resources sync"?
I actually think this is okay, we never re-read config map values in flyteadmin as it is, and depend on the service deployment being rolled for those to take effect
One optimization we could add is a lightweight marker database table that stores a checksum of the last applied configmap so we don't always have to re-run the migration script on every deploy rollout
"github.com/flyteorg/flyte/flytestdlib/config" | ||
) | ||
|
||
const SectionKey = "matcheableResources" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to anything that's not matchable resources :) I like configOverrides although both sound great!
|
||
var model models.Resource | ||
|
||
if workflow != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe use a switch statement here?
} | ||
|
||
func CreateKey(project string, domain string, workflow string, resourceType string) string { | ||
return fmt.Sprintf("%s-%s-%s-%s", project, domain, workflow, resourceType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we version this string perhaps? (if we want to one day modify the format to support task or launch plan level overrides, for example) e.g. v1-%s-%s...
re: flytectl update continues to work of course in case organizations want to allow users to manage this themselves. how does this work in a configmap managed environment? if a user decides to use the cli to update a matchable attribute in the configmap, then the service restart will wipe our their changes, right? should we disable api access in deployments where we use the configmap style approach? |
Tracking issue
RFC #3749
Why are the changes needed?
Currently, config overrides/matchable attributes/matchable resources can only be created imperatively via
flytectl update
.In RFC #3749, which aims to improve the UX around these config overrides, we agreed that there must be a declarative way to managed them using infrastructure as code.
This PR adds such a declarative mechanism.
Details on config overrides:
From the Flyte docs:
What changes were proposed in this pull request?
How was this patch tested?
Added unit tests
Used the following config to ensure that the database entries are the exact same compared to creating the config overrides with
flytectl update
:flyteadmin --config configs/*.yaml migrate seed-resources
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link