Skip to content
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

[Python Client] Use openapi generator instead of swagger #3872

Merged
merged 12 commits into from
Jun 3, 2020

Conversation

Bobgy
Copy link
Contributor

@Bobgy Bobgy commented May 29, 2020

Fixes #3871

Changes

  • Updated backend/api/build_kfp_server_api_python_package.sh
    • to use kfp_api_single_file.swagger.json instead of generating a temporary one each time (original logic for generating them were duplicated between this script and generate_api.sh, while they were almost the same.)
    • generate python client in backend/api/python_http_client folder and checked into github repo
  • Added more metadata info like author, email and license in generate_api.sh.

Why this PR?

Diff for both clients can be viewed at 0105cbb

The major diff why we wanted to do this is https://github.com/kubeflow/pipelines/pull/3872/files/823fdf569f48f39e3698c74ffc1b191e251a553c..9f57b9313afff9a78ed951c275c158d9338cef91#diff-ba5c487d723b38c9c8d3d9b5f74cb1ec

openapi-generator adds author, license info from the swagger file into setup.py, so these information will be available on pypi.

Verification

I tried the new client via pip install . and used a few of my client usage examples.
So far the client worked great the same way as before.

I verified

import kfp_server_api
kfp_server_api.__version__

is the new version, so I'm testing the right library.

I tried the following apis:

  • list experiments
  • list pipelines
  • create run
  • create recurring run

All is good. We'd still need more testing, but my early verification makes me feel the new client is very promising.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubeflow-bot
Copy link

This change is Reviewable

@Bobgy Bobgy force-pushed the use-openapi-generator branch from 0105cbb to 92dc587 Compare May 29, 2020 04:00
@Bobgy Bobgy force-pushed the use-openapi-generator branch from 9f57b93 to 478e5b8 Compare May 29, 2020 04:42
@Bobgy Bobgy marked this pull request as ready for review May 29, 2020 06:13
@Bobgy Bobgy self-assigned this May 29, 2020
@Bobgy
Copy link
Contributor Author

Bobgy commented May 29, 2020

/assign @Ark-kun
/cc @jingzhang36 @rmgogogo

@Ark-kun
Copy link
Contributor

Ark-kun commented May 29, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 29, 2020
@Bobgy
Copy link
Contributor Author

Bobgy commented May 29, 2020

/assign @IronPan

@Bobgy
Copy link
Contributor Author

Bobgy commented May 29, 2020

/retest

@Ark-kun
Copy link
Contributor

Ark-kun commented May 29, 2020

/lgtm

@Bobgy
Copy link
Contributor Author

Bobgy commented May 29, 2020

Strange, tests fail without any log
/test all

@Bobgy
Copy link
Contributor Author

Bobgy commented May 29, 2020

/retest

@Ark-kun
Copy link
Contributor

Ark-kun commented May 30, 2020

Travis is stuck. Maybe make a force-push.

@Bobgy Bobgy force-pushed the use-openapi-generator branch from e666fd3 to 4ca8d28 Compare June 1, 2020 04:15
@k8s-ci-robot k8s-ci-robot removed the lgtm label Jun 1, 2020
@jingzhang36
Copy link
Contributor

/lgtm

@Bobgy Bobgy force-pushed the use-openapi-generator branch from 52a0fc7 to b0cc8e4 Compare June 3, 2020 03:02
@k8s-ci-robot k8s-ci-robot removed the lgtm label Jun 3, 2020
@jingzhang36
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jingzhang36

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 36eba13 into kubeflow:master Jun 3, 2020
@Bobgy Bobgy deleted the use-openapi-generator branch June 3, 2020 04:50
RedbackThomson pushed a commit to RedbackThomson/pipelines that referenced this pull request Jun 17, 2020
* Generate python client package into repo using kfp_api_single_file.swagger.json

* Commit python client generated by swagger

* Use openapi-generator instead

* Regenerate using openapi-generator

* Add extra info into swagger single file

* Update more info

* update

* Move python http client to upper folder

* Clean up build script

* Update kfp_server_api from new swagger.json
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this pull request Dec 9, 2020
* Generate python client package into repo using kfp_api_single_file.swagger.json

* Commit python client generated by swagger

* Use openapi-generator instead

* Regenerate using openapi-generator

* Add extra info into swagger single file

* Update more info

* update

* Move python http client to upper folder

* Clean up build script

* Update kfp_server_api from new swagger.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Client] Use openapi-generator instead of swagger
6 participants