-
Notifications
You must be signed in to change notification settings - Fork 63
Write workflow and node execution events asynchronously #174
Conversation
Signed-off-by: Katrina Rogan <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #174 +/- ##
==========================================
+ Coverage 63.13% 63.49% +0.36%
==========================================
Files 101 105 +4
Lines 7318 7331 +13
==========================================
+ Hits 4620 4655 +35
+ Misses 2115 2101 -14
+ Partials 583 575 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
func NewNodeExecutionEventWriter(db repositories.RepositoryInterface) interfaces.NodeExecutionEventWriter { | ||
return &nodeExecutionEventWriter{ | ||
db: db, | ||
events: make(chan admin.NodeExecutionEventRequest), |
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.
you should make a buffered channel?
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.
You should and the length of the channel should be pretty large, else you will block sender. Right now this is a sync send
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.
yes good catch, ty! not sure what a good buffer size would be, any suggestions @kumare3 ?
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.
done & added a test for this case
pkg/async/events/implementations/workflow_execution_event_writer.go
Outdated
Show resolved
Hide resolved
I do not think this is achieving the async comm, Also, I think we should add enough documentation to explain the actual semantics of the API |
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
Do we want to run a perf test before we commit this? |
Signed-off-by: Katrina Rogan <[email protected]>
@kumare3 no noticeable change, still coming at 15 mins although this time I see inserts into node execution events taking way less wait time comparatively |
|
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
@@ -56,7 +58,11 @@ func (p *ApplicationConfigurationProvider) GetDbConfig() interfaces.DbConfig { | |||
} | |||
|
|||
func (p *ApplicationConfigurationProvider) GetTopLevelConfig() *interfaces.ApplicationConfig { | |||
return flyteAdminConfig.GetConfig().(*interfaces.ApplicationConfig) | |||
applicationConfig := flyteAdminConfig.GetConfig().(*interfaces.ApplicationConfig) | |||
if applicationConfig.AsyncEventsBufferSize == 0 { |
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.
no need to do this, just set the default in the config like so
https://github.com/flyteorg/flytepropeller/blob/master/pkg/controller/config/config.go#L47
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.
@kumare3 done, ty!
Signed-off-by: Katrina Rogan <[email protected]>
Signed-off-by: Katrina Rogan <[email protected]>
@@ -19,7 +19,12 @@ const domains = "domains" | |||
const externalEvents = "externalEvents" | |||
|
|||
var databaseConfig = config.MustRegisterSection(database, &interfaces.DbConfigSection{}) | |||
var flyteAdminConfig = config.MustRegisterSection(flyteAdmin, &interfaces.ApplicationConfig{}) | |||
|
|||
var defaultFlyteAdminConfig = &interfaces.ApplicationConfig{ |
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 might be a time to create default configs for all the configs? Or if you want do it as a follow up PR?
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.
considering how many configs we have... how about a follow-up pr :)
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.
looks good to me, one comment |
@kumare3 can you approve? |
Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
…D and OAuth2 configs, OAuth2 Metadata over gRPC #minor (#168) * wip: OAuth2 Support Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * tighten security of generated tokens Signed-off-by: Haytham Abuelfutuh <[email protected]> * Support storing form post values in auth code JWT Signed-off-by: Haytham Abuelfutuh <[email protected]> * save secrets to k8s secrets Signed-off-by: Haytham Abuelfutuh <[email protected]> * Expose metadata endpoints over gRPC Signed-off-by: Haytham Abuelfutuh <[email protected]> * trim OpenID Connect config further Signed-off-by: Haytham Abuelfutuh <[email protected]> * Selectively authenticate gRPC endpoints Signed-off-by: Haytham Abuelfutuh <[email protected]> * Support external oauth2 server and Okta Config Signed-off-by: Haytham Abuelfutuh <[email protected]> * update config Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fix nil secrets data map Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fixed the pointer overwrite issue in oauthServer metadata (#183) Signed-off-by: Prafulla Mahindrakar <[email protected]> Co-authored-by: Prafulla Mahindrakar <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Unit tests Signed-off-by: Haytham Abuelfutuh <[email protected]> * Unit tests Signed-off-by: Haytham Abuelfutuh <[email protected]> * Simplify config further and move auth package up Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fix clusterresource Project and domain(#167) * Fix clusterresource Project Signed-off-by: Anand Swaminathan <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Bump flyteidl version to pick up auth role field number fix (#169) Signed-off-by: Katrina Rogan <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add option to use project name as namespace for the task pods (#166) * Add option to use project name as namespace for the task pods Signed-off-by: Jeev B <[email protected]> * rename Signed-off-by: Jeev B <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * GetExecution performance improvements (#171) Signed-off-by: Katrina Rogan <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add exists check for workflow & node executions (#172) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Remove legacy fetch for workflow execution inputs (#173) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Added release workflow (#170) Signed-off-by: yuvraj <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update Flyteidl version (#175) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Added version in flyteadmin (#154) * wip: added version pkg Signed-off-by: yuvraj <[email protected]> * wip: resolve conflict Signed-off-by: yuvraj <[email protected]> * wip: added version in rpc Signed-off-by: yuvraj <[email protected]> * wip: small fixes Signed-off-by: yuvraj <[email protected]> * wip: Added panic cache in get version service Signed-off-by: yuvraj <[email protected]> * Added flytestdlib for version package Signed-off-by: yuvraj <[email protected]> * Added version service test Signed-off-by: yuvraj <[email protected]> * wip: added ldflags in goreleaser Signed-off-by: yuvraj <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Propagate nesting and principal for child executions (#177) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Write workflow and node execution events asynchronously (#174) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add sensible flyteadmin config defaults (#179) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Lint Signed-off-by: Haytham Abuelfutuh <[email protected]> * further cleanup Signed-off-by: Haytham Abuelfutuh <[email protected]> * Only register authserver when auth is enabled Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update to latest flyteidl and separate auth interfaces Signed-off-by: Haytham Abuelfutuh <[email protected]> * dead code Signed-off-by: Haytham Abuelfutuh <[email protected]> * PR Comments Signed-off-by: Haytham Abuelfutuh <[email protected]> * merge master Signed-off-by: Haytham Abuelfutuh <[email protected]> * Move to authorizedUris Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update to released flyteidl Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fix response expiry and add unit tests Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update go mod Signed-off-by: Haytham Abuelfutuh <[email protected]> * fix unit tests that broke because of identity changes Signed-off-by: Haytham Abuelfutuh <[email protected]> Co-authored-by: pmahindrakar-oss <[email protected]> Co-authored-by: Prafulla Mahindrakar <[email protected]> Co-authored-by: Anand Swaminathan <[email protected]> Co-authored-by: Katrina Rogan <[email protected]> Co-authored-by: Jeev B <[email protected]> Co-authored-by: Yuvraj <[email protected]> Co-authored-by: Flyte Bot <[email protected]>
…D and OAuth2 configs, OAuth2 Metadata over gRPC #minor (#168) * wip: OAuth2 Support Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * wip Signed-off-by: Haytham Abuelfutuh <[email protected]> * tighten security of generated tokens Signed-off-by: Haytham Abuelfutuh <[email protected]> * Support storing form post values in auth code JWT Signed-off-by: Haytham Abuelfutuh <[email protected]> * save secrets to k8s secrets Signed-off-by: Haytham Abuelfutuh <[email protected]> * Expose metadata endpoints over gRPC Signed-off-by: Haytham Abuelfutuh <[email protected]> * trim OpenID Connect config further Signed-off-by: Haytham Abuelfutuh <[email protected]> * Selectively authenticate gRPC endpoints Signed-off-by: Haytham Abuelfutuh <[email protected]> * Support external oauth2 server and Okta Config Signed-off-by: Haytham Abuelfutuh <[email protected]> * update config Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fix nil secrets data map Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fixed the pointer overwrite issue in oauthServer metadata (#183) Signed-off-by: Prafulla Mahindrakar <[email protected]> Co-authored-by: Prafulla Mahindrakar <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Unit tests Signed-off-by: Haytham Abuelfutuh <[email protected]> * Unit tests Signed-off-by: Haytham Abuelfutuh <[email protected]> * Simplify config further and move auth package up Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fix clusterresource Project and domain(#167) * Fix clusterresource Project Signed-off-by: Anand Swaminathan <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Bump flyteidl version to pick up auth role field number fix (#169) Signed-off-by: Katrina Rogan <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add option to use project name as namespace for the task pods (#166) * Add option to use project name as namespace for the task pods Signed-off-by: Jeev B <[email protected]> * rename Signed-off-by: Jeev B <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * GetExecution performance improvements (#171) Signed-off-by: Katrina Rogan <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add exists check for workflow & node executions (#172) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Remove legacy fetch for workflow execution inputs (#173) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Added release workflow (#170) Signed-off-by: yuvraj <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update Flyteidl version (#175) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Added version in flyteadmin (#154) * wip: added version pkg Signed-off-by: yuvraj <[email protected]> * wip: resolve conflict Signed-off-by: yuvraj <[email protected]> * wip: added version in rpc Signed-off-by: yuvraj <[email protected]> * wip: small fixes Signed-off-by: yuvraj <[email protected]> * wip: Added panic cache in get version service Signed-off-by: yuvraj <[email protected]> * Added flytestdlib for version package Signed-off-by: yuvraj <[email protected]> * Added version service test Signed-off-by: yuvraj <[email protected]> * wip: added ldflags in goreleaser Signed-off-by: yuvraj <[email protected]> Signed-off-by: Haytham Abuelfutuh <[email protected]> * Propagate nesting and principal for child executions (#177) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Write workflow and node execution events asynchronously (#174) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Add sensible flyteadmin config defaults (#179) Signed-off-by: Haytham Abuelfutuh <[email protected]> * Lint Signed-off-by: Haytham Abuelfutuh <[email protected]> * further cleanup Signed-off-by: Haytham Abuelfutuh <[email protected]> * Only register authserver when auth is enabled Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update to latest flyteidl and separate auth interfaces Signed-off-by: Haytham Abuelfutuh <[email protected]> * dead code Signed-off-by: Haytham Abuelfutuh <[email protected]> * PR Comments Signed-off-by: Haytham Abuelfutuh <[email protected]> * merge master Signed-off-by: Haytham Abuelfutuh <[email protected]> * Move to authorizedUris Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update to released flyteidl Signed-off-by: Haytham Abuelfutuh <[email protected]> * Fix response expiry and add unit tests Signed-off-by: Haytham Abuelfutuh <[email protected]> * Update go mod Signed-off-by: Haytham Abuelfutuh <[email protected]> * fix unit tests that broke because of identity changes Signed-off-by: Haytham Abuelfutuh <[email protected]> Co-authored-by: pmahindrakar-oss <[email protected]> Co-authored-by: Prafulla Mahindrakar <[email protected]> Co-authored-by: Anand Swaminathan <[email protected]> Co-authored-by: Katrina Rogan <[email protected]> Co-authored-by: Jeev B <[email protected]> Co-authored-by: Yuvraj <[email protected]> Co-authored-by: Flyte Bot <[email protected]>
TL;DR
Write workflow and node execution events asynchronously
Type
Are all requirements met?
Complete description
Should hopefully improve Create{Workflow|Node}ExecutionEvent performance
Tracking Issue
flyteorg/flyte#891
Follow-up issue
NA