-
Notifications
You must be signed in to change notification settings - Fork 300
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
Create default launch plan when executing WorkflowBase #707
Conversation
flytekit/remote/remote.py
Outdated
task_identifiers_dict["name"] = node.flyte_entity.name | ||
self.fetch_task(**task_identifiers_dict) | ||
except FlyteEntityNotExistException: | ||
self.register(node.flyte_entity, **task_identifiers_dict) |
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.
add some logging in here to say that we're trying to register because it wasn't found?
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.
also doesn't register currently just raise NotImplementedError
flytekit/remote/remote.py
Outdated
try: | ||
task_identifiers_dict = deepcopy(resolved_identifiers_dict) | ||
task_identifiers_dict["name"] = node.flyte_entity.name | ||
self.fetch_task(**task_identifiers_dict) |
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.
how do we know it's always a task? might it be a subworkflow? or a launch plan node?
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.
And if it's a subworkflow, or a launch plan, then those underlying entities will also need to be registered. take a look at the translator.py
file if you can. that file has logic that will recursively aggregate up everything. you're basically running a compilation step here.
dc4b63e
to
e4a125d
Compare
9c6e26b
to
83d8fe9
Compare
Codecov Report
@@ Coverage Diff @@
## master #707 +/- ##
==========================================
- Coverage 85.76% 85.76% -0.01%
==========================================
Files 358 359 +1
Lines 29778 29853 +75
Branches 2428 2434 +6
==========================================
+ Hits 25538 25602 +64
- Misses 3601 3611 +10
- Partials 639 640 +1
Continue to review full report at Codecov.
|
flytekit/remote/remote.py
Outdated
except FlyteEntityAlreadyExistsException: | ||
logging.info(f"{entity.name} already exists") | ||
except Exception as e: | ||
logging.info(f"Failed to register Flyte entity {entity.name} with error v{e}") |
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.
I got the below error in the integration test when I register the same version of the task twice.
The integration will run make register
first to register all the workflow and task in mock_flyte_repo
, and then remote.execute(my_wf)
will register the task again in the test_execute_python_workflow_list_of_floats
I found out that the error only happened when we register the task by the remote client after make register
.
- (task register) flytectl register -> remote.register ->
StatusCode.INVALID_ARGUMENT
- (task register) remote.register -> remote.register -> FlyteEntityAlreadyExistsException
- (workflow register) flytectl register -> remote.register -> FlyteEntityAlreadyExistsException
- (workflow register) remote.register -> remote.register -> FlyteEntityAlreadyExistsException
File "/Users/kevin/git/flytekit/flytekit/clients/raw.py", line 173, in handler
raise _user_exceptions.FlyteEntityAlreadyExistsException(e)
flytekit.common.exceptions.user.FlyteEntityAlreadyExistsException: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "task with different structure already exists with id resource_type:TASK project:"flyteexamples" domain:"development" name:"dataclass.workflows.example.creat_file" version:"v11" "
debug_error_string = "{"created":"@1634913163.363030000","description":"Error received from peer ipv6:[::1]:30081","file":"src/core/lib/surface/call.cc","file_line":1070,"grpc_message":"task with different structure already exists with id resource_type:TASK project:"flyteexamples" domain:"development" name:"dataclass.workflows.example.creat_file" version:"v11" ","grpc_status":3}"
To workaround to issue, catch an exception here.
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.
To quickly reproduce this issue.
- use
flytectl
to register a workflow - and use FlyteRemote to register the task again.
from flytekit.remote import FlyteRemote
from dataclass.workflows.example import create_file
remote = FlyteRemote.from_config("flyteexamples", "development")
remote.register(create_file, version=VERSION)
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@@ -520,6 +523,7 @@ def _serialize( | |||
domain or self.default_domain, | |||
version or self.version, | |||
self.image_config, | |||
env={internal.IMAGE.env_var: self.image_config.default_image.full}, |
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 a link to flyteorg/flyte#1359 as a comment here?
try: | ||
flyte_workflow: FlyteWorkflow = self.fetch_workflow(**resolved_identifiers_dict) | ||
except Exception: | ||
except FlyteEntityNotExistException: | ||
logging.info("Try to register FlyteWorkflow because it wasn't found in Flyte Admin!") | ||
flyte_workflow: FlyteWorkflow = self.register(entity, **resolved_identifiers_dict) |
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.
@wild-endeavor we will register parent workflow here
Signed-off-by: Kevin Su <[email protected]>
* Create default lauchplan Signed-off-by: Kevin Su <[email protected]> * Update comment Signed-off-by: Kevin Su <[email protected]> * Added test Signed-off-by: Kevin Su <[email protected]> * Fixed lint Signed-off-by: Kevin Su <[email protected]> * Fixed lint Signed-off-by: Kevin Su <[email protected]> * Fixed test Signed-off-by: Kevin Su <[email protected]> * Register subworkflow, launchplan node Signed-off-by: Kevin Su <[email protected]> * Fixed lint Signed-off-by: Kevin Su <[email protected]> * Fixed test Signed-off-by: Kevin Su <[email protected]> * Fixed tests Signed-off-by: Kevin Su <[email protected]> * Fixed tests Signed-off-by: Kevin Su <[email protected]> * Fixed tests Signed-off-by: Kevin Su <[email protected]> * Fixed tests Signed-off-by: Kevin Su <[email protected]> * Fixed tests Signed-off-by: Kevin Su <[email protected]> * Fix tests Signed-off-by: Kevin Su <[email protected]> * Fix tests Signed-off-by: Kevin Su <[email protected]> * Fix tests Signed-off-by: Kevin Su <[email protected]> * Fix tests Signed-off-by: Kevin Su <[email protected]> * Fix tests Signed-off-by: Kevin Su <[email protected]> * Fix tests Signed-off-by: Kevin Su <[email protected]> * Fixed test Signed-off-by: Kevin Su <[email protected]> * Fixed test Signed-off-by: Kevin Su <[email protected]> * Add link Signed-off-by: Kevin Su <[email protected]> Signed-off-by: Robert Everson <[email protected]>
Signed-off-by: Kevin Su [email protected]
TL;DR
Running a workflow
Before:
After:
Type
Are all requirements met?
Complete description
How did you fix the bug, make the feature etc. Link to any design docs etc
Tracking Issue
https://github.com/lyft/flyte/issues/
Follow-up issue
NA