-
Notifications
You must be signed in to change notification settings - Fork 276
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
Annotations separate out serializing #326
Conversation
flytekit/common/translator.py
Outdated
|
||
|
||
def get_serializable( | ||
settings: RegistrationSettings, entity: FlyteLocalEntity, fast: Optional[bool] = False |
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 are your thoughts on renaming RegistrationSettings to SerializationSettings since that's now the primary use-case?
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
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.
as a separate PR is ok
flytekit/common/translator.py
Outdated
if fast: | ||
# Containerless tasks are always fast registerable without modification so only operate on tasks that | ||
# have a container. Also, raw ContainerTask's should never be touched. | ||
if cp_entity.container is not None and not isinstance(entity, ContainerTask): |
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.
hm it makes me sad we lose the inheritence bit. i wonder if it's worth refactoring get_container
to accept a bool for whether the context should be regular or fast
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.
interesting, also, maybe we should do this for any entity that is instance of PythonAutoContainerTask and not ContainerTask. We should assume all container tasks are independent of code?
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 do this in a later PR? As indicated by Miguel's recent question, I want to see if there are additional use cases for changing/overriding the command of a container. Even if not, I'd rather clean up in a separate PR since it's not user facing.
|
||
|
||
# TODO we should accept TaskMetadata here and then extract whatever fields we want into NodeMetadata | ||
def create_and_link_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.
maybe the name of this function needs to be renamed to reflect that we are Substituting outputs with promises
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.
suggestions?
cp_entity.assign_name(entity.reference.id.name) | ||
|
||
elif isinstance(entity, ReferenceWorkflow): | ||
workflow_metadata = WorkflowMetadata(on_failure=WorkflowFailurePolicy.FAIL_IMMEDIATELY) |
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.
Why?
Why does a reference workflow not look similar, maybe i am missing something
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 do you mean? similar to what?
This looks aaamazing! awesome work |
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 for refactoring get_serializable to call smaller methods!
flytekit/common/translator.py
Outdated
) | ||
|
||
elif isinstance(entity, ReferenceLaunchPlan): | ||
wf_id = _identifier_model.Identifier(_identifier_model.ResourceType.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.
not related to this PR but why do you use an empty identiifer rather than filling out the fields?
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 intelligent reason
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 all get deleted i hope
NodeOutput
class in thepromise
file not dependent on the old one. I left an unusedsdk_type
in there for now cuz that's always None but I'll change it.create_and_link_node
to thepromise
file.get_registerable_entity
logic from everything and put all the logic in one file.RegistrationSettings
object inside a context object because the new function just expects it explicitly. However I didn't see an easy way to remove it from theFlyteContext
entirely because of dynamic tasks, which run a compilation step inside of execution and registration settings are not usually passed through during execution.