-
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
[Doc] Documentation about kfp generated api python sdk #3216
Comments
Joe, is https://kubeflow-pipelines.readthedocs.io/en/latest/index.html owned by us? |
@rmgogogo I think it is generated from here https://github.com/kubeflow/pipelines/tree/master/docs. @Ark-kun should know more about it. |
@neuromage @Ark-kun I feel like this is a must have for KFP 1.0, also it would be the best if we can automate api spec doc generation and release regularly (in addition to some manually maintained examples). What do you think? Can we add this into sdk/dsl group planning for Q2? |
@Bobgy Yes, this makes sense for Q2. Would you mind creating an issue and adding it to the KFP 1.0 planning Kanban? I'll sync up with @jessiezcc on resourcing this. |
Thanks @neuromage! I created #3354 to track this. |
Sorry. I own that. Without tweaks, sphinx does not know about the generated members of Client, because they do not exist on the Client class - only on objects. I can try to refactor the generation, so that it adds members to the class, not just the object. But that has some cons, since the generation will run during the import. Maybe there is another way... |
I'm trying to understand, why is generation happening during import a con? When does it currently happen? at object init phase? |
Currently the generation happens during kfp.Client() init. |
I'm digging into sphinx. Maybe |
Thanks! makes sense to me. Would be great if doc can be supported with current approach. |
I tried hacking on this a few different ways today. Indeed, there would be draw-backs to call anything like the current implementation of I looked around the features, events, extensions, autodoc directives of sphinx. I even attempted subclassing a I think one approach worth considering would involve instantiating a I have a solution which works, and generates an expanded version of the docs. Only snag, is I'm guessing my approach, isn't compatible with readthedocs.io. I'd send a PR tomorrow, or next weekend, if people are okay with instantiating a Client during the doc build. The doc builder would have to pass a host, I guess. (Or, there would need to be some refactoring of the constructor). Since the kubeflow parent project has a registered domain and host, I'm guessing stuffing some extra static html somewhere, couldn't be too hard. |
@jnmclarty Super thanks! This is a big step forward! After reviewing the generated doc, there are still some usage frictions:
|
I've been searching if any solutions exist generating doc for swagger clients. I tried swagger-api/swagger-codegen#1387 (comment). Demo: https://bobgy.github.io/pipelines-api-doc/ for job api. It's a lot easier to read, but we'd need to figure out how to patch/document using our sdk with it. |
This looks great! Thanks for helping. |
@Ark-kun Thanks! I can see new methods in the website now: https://kubeflow-pipelines.readthedocs.io/en/latest/source/kfp.client.html#kfp-client-experiments /reopen Questions:
|
@Bobgy: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
That's how the API client in the generated
The documentation reflects the generated P.S. The docs will look nicer once the swagger-codegen bug fix is merge swagger-api/swagger-codegen#10259 |
/reopen e.g.
With current documentation, users can sort of find the body param should be of type ApiJob, but the documentation page doesn't have a reference to ApiJob.
|
@Bobgy: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I thought the main issue we were solving was discovery of the auto-generated API of the kfp-server-API package. I agree that we need better docs, but the documentation pages you're seeing just reflect the docstrings of the generated package. You can check that by using
There would be a link if the parameter had a type annotation, but without the annotation it's not possible.
Yes, it's possible. Thank you for reminding. I forgot to include the models in the final version. I should probably add a separate page so that the kfp.Client page is not too long. In the future we can try upgrading from swagger-codegen to https://github.com/OpenAPITools/openapi-generator which may generate nicer docstrings. |
Thanks!
No problem if we don't have the link now, just want to first make Also +1 in trying openapi-generator, I think swagger has moved on to v3, v2 probably won't get enough attention. |
Hi @Ark-kun, would you mind cherry picking your PR in OpenAPITools/openapi-generator#6391 to our template folder here: https://github.com/kubeflow/pipelines/tree/master/backend/api/python_http_client_template We can get the fix right away. |
/reopen |
@Bobgy: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There has been quite some pain for @jingzhang36 and me to figure out how to use generated sdk client. Also, many users clearly don't know how to use it either.
Related context
I wonder how we can improve it. Can we do the following?
The text was updated successfully, but these errors were encountered: