-
Notifications
You must be signed in to change notification settings - Fork 83
Added support for execution queue attribute #66
Added support for execution queue attribute #66
Conversation
34f46fe
to
0f2030b
Compare
|
||
// UnDecorate to uncover ExecutionQueueAttributes. | ||
func (a *AttrFileConfig) UnDecorate(matchingAttribute *admin.MatchingAttributes) { | ||
if matchingAttribute == nil { |
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.
when does this happen?
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 will happen in case where admin doesn't return an error of empty matching attribute and we try to unwrap the response to get the executionQueueAttribute which wont exist.
This is check is safeguard against it.
This is what is passed to undecorate
workflowAttr.GetAttributes().GetMatchingAttributes()
Where workflowAttr is response from the admin
Ideally it would be preferable to do null checks for both workflowAttr.GetAttributes() and then workflowAttr.GetAttributes().GetMatchingAttributes()
Since the idl can return nil for both
func (m *WorkflowAttributesGetResponse) GetAttributes() *WorkflowAttributes {
if m != nil {
return m.Attributes
}
return nil
}
...
func (m *WorkflowAttributes) GetMatchingAttributes() *MatchingAttributes {
if m != nil {
return m.MatchingAttributes
}
return nil
}```
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.
oh interesting, so there are cases where we don't return not found but just an empty response? that seems wrong
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.
We might be avoiding this in code path, but the idl supports returning nil hence added a guard .
I haven't seen it during my testing since if there are no attributes its always an error response and if thats the case then we don't call Undecorate.
If the resource is not found we do return an from the ORM layer
https://github.com/flyteorg/flyteadmin/blob/db32bb3810e7490e04ff693eadd26414aa294482/pkg/repositories/gormimpl/resource_repo.go#L114
And which is propogated back to client
https://github.com/flyteorg/flyteadmin/blob/db32bb3810e7490e04ff693eadd26414aa294482/pkg/manager/impl/resources/resource_manager.go#L220
Hence i don't see how we can end up in this state of no error and empty response.
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.
great, just wanted to confirm you hadn't actually seen this behavior! protecting against it since it's technically allowed by the response structure sounds fine
flytectl delete execution-queue-attribute -p flytectldemo -d development | ||
|
||
|
||
Deleting execution queue attribute using config file which was used for creating it. |
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.
Deleting execution queue attribute using config file which was used for creating it. | |
Deletes execution queue attribute using config file which was used for creating it. |
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.
Thanks done
|
||
|
||
Deleting execution queue attribute using config file which was used for creating it. | ||
Here the command deletes execution queue attributes from the config file cra.yaml |
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: why is this called cra? (copy paste from cluster resources attributes?)
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.
yup . thanks for pointing it out. Fixed it.
Would need a code generator for comments for such cases.
- lightyear | ||
|
||
Deleting execution queue attribute for a workflow | ||
Here the command execution queue attributes for a 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.
this looks like it's missing a second half?
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.
|
||
flytectl get execution-queue-attribute -p flytectldemo -d development | ||
|
||
eg : O/P |
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.
what is O/P?
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.
Its the output
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.
Reworded it
eg : output from the command
Here the command get execution queue attributes for project flytectldemo and development domain. | ||
:: | ||
|
||
flytectl get execution-queue-attribute -p flytectldemo -d development |
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.
can you add an example with a workflow name too?
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 for this and other attributes aswell.
|
||
|
||
Deleting execution queue attribute using config file which was used for creating it. | ||
Here the command deletes execution queue attributes from the config file cra.yaml |
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.
Here the command deletes execution queue attributes from the config file cra.yaml | |
Here the command deletes execution queue attributes from the config file era.yaml |
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. Thanks
|
||
Deleting execution queue attribute using config file which was used for creating it. | ||
Here the command deletes execution queue attributes from the config file cra.yaml | ||
eg: content of cra.yaml which will use the project domain and workflow name for deleting the resource |
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.
Can we note that the tags are optional in the file (since they're unread)?
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.
Tags are optional in the file as they are unread during the delete command but can be kept as the same file can be used for get, update or delete
Added to other commands aswell
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
0f2030b
to
175ed83
Compare
Codecov Report
@@ Coverage Diff @@
## master #66 +/- ##
==========================================
+ Coverage 57.94% 58.31% +0.37%
==========================================
Files 68 75 +7
Lines 1548 1653 +105
==========================================
+ Hits 897 964 +67
- Misses 596 633 +37
- Partials 55 56 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar [email protected]
TL;DR
This PR specifically addresses supporting execution queue attributes through flytectl.
Retrieves execution queue attributes for given project,domain combination or additionally with workflow name.
Here the command get execution queue attributes for project flytectldemo and development domain.
flytectl get execution-queue-attribute -p flytectldemo -d development
eg : O/P
Writing the execution queue attribute to a file. If there are no execution queue attributes , command would return an error
Here the command gets exectuin queue attributes and writes the config file to era.yaml
eg: content of tra.yaml
flytectl get execution-queue-attribute --attrFile era.yaml
Updates execution queue attributes for given project and domain combination or additionally with workflow name.
Updating the execution queue attribute is only available from config file
Here the command updates takes the input for execution queue attributes from the config file era.yaml
eg: content of era.yaml
flytectl update execution-queue-attribute -attrFile era.yaml
Deletes execution queue attributes for given project and domain combination or additionally with workflow name.
Deletes execution queue attribute for project and domain
Here the command delete execution queue attributes for project flytectldemo and development domain.
flytectl delete execution-queue-attribute -p flytectldemo -d development
Deleting execution queue attribute using config file
Here the command deletes execution queue attributes from the config file era.yaml
eg: content of era.yaml which will use the project domain and workflow name for deleting the resource
flytectl delete execution-queue-attribute --attrFile era.yaml
Deleting execution queue attribute for a workflow
Here the command deletes execution queue attributes for a workflow
flytectl delete execution-attribute -p flytectldemo -d development core.control_flow.run_merge_sort.merge_sort
Type
Are all requirements met?
Complete description
Tracking Issue
flyteorg/flyte#992
Follow-up issue
NA