-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
SDK/Components - Reworked the component model structures. #642
SDK/Components - Reworked the component model structures. #642
Conversation
/assign @qimingj @gaoning777 |
478a22c
to
a23ad59
Compare
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.
Sending a few comments now. Will finish reviewing the rest later.
Rewrote parsing, type checking and serialization code. Improved the graph component structures. Added most of the needed k8s structures. Added model validation (input/output existence etc). Added task cycle detection and topological sorting to GraphSpec. All container component tests now work. Added some graph component tests.
d622f60
to
d4c7ccb
Compare
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.
@Ark-kun, I have a few high level questions and need your help to clarify.
Also, the change is fairly big. It includes some separable features such as K8s wrapper, ModelBase class, etc. It would be easier for reviewers if it is separated into multiple changes.
I've refactored/extracted the boilerplate serialization/deserialization code into that base class. All object model structures depend on it, so it must be included.
The k8s structures are used by the Task class. I got lots of comments from our teams about the need for full kubernetes support, so it made sense to add those structures too. I could separate this one, but I did not want the tasks to lack
There are also code changes to use the new structures and unit tests. Without those small code changes in component_builder the code will just be broken. As for the unit tests, I consider them to be a positive addition and they also demonstrate the usage for the classes that were not properly used and tested before. I might have omitted the validation code that fixed the previously skipped component tests though. I'll try making the PRs smaller in future. |
/test kubeflow-pipeline-e2e-test |
A few high level comments:
But it seems you have explored all options and nothing works to your satisfaction (e.g. existing serialization/deserialization doesn't work well with Union types).
|
Good thing I managed to make this big project a reality. Now we can benefit from a good serialization and deserialization library for Python which we control. We do not need to wait years for fixes to the existing libraries and we get all the features that we need. In future we can make this a separate OSS library.
As I showed you offline, removing the few
Same thing. I hope that in future the kubernetes package becomes useful for this kind of job. I'm adding some fixes to the python-swagger code generator so maybe in some months there will be a slightly fixed kubernetes python package. |
Gentle ping. |
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.
/lgtm
|
||
class InputSpec(ModelBase): | ||
'''Describes the component input specification''' | ||
def __init__(self, |
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 TODO for making it a data class in the future.
if output_name not in self._outputs_dict: | ||
raise TypeError('Unconfigurable output entry "{}" references non-existing output.'.format({output_name: path})) | ||
|
||
def verify_arg(arg): |
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: functions inside a function and an if block is harder to read.
obj41 = TestModel1.from_struct(struct41) | ||
self.assertEqual(obj41.prop_4['val 4'], val4) | ||
self.assertDictEqual(obj41.to_struct(), struct41) | ||
|
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: one space
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ark-kun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ark-kun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ces (kubeflow#637)" (kubeflow#642) Partial revert of commit afd9f95. The change in the self-signed logic breaks presubmits with the following error E kubernetes.client.rest.ApiException: (409) E Reason: Conflict E HTTP response headers: HTTPHeaderDict({'Audit-Id': '85305103-054e-4795-a45e-f802de1ae4ea', 'Content-Type': 'application/json', 'Date': 'Wed, 15 Apr 2020 00:31:03 GMT', 'Content-Length': '352'}) E HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Operation cannot be fulfilled on ingresses.extensions \"envoy-ingress\": the object has been modified; please apply your changes to the latest version and try again","reason":"Conflict","details":{"name":"envoy-ingress","group":"extensions","kind":"ingresses"},"code":409} * Only changes to util.py in the original PR are reverted.
This change is