The guide shows how to generate the openapi model and swagger.json file from KServe types using openapi-gen
and generate Python SDK Client for the Python object models using openapi-codegen
. Also show how to upload the Python SDK to Pypi.
From root folder, you can make generate
or execute the below script directly to generate openapi spec and swagger file.
./hack/update-openapigen.sh
After executing, the openapi_generated.go
and swagger.json
are generated and stored under pkg/apis/serving/v1beta1/
.
From root folder, execute the script /hack/python-sdk/client-gen.sh
to install openapi-codegen and generate Python SDK.
./hack/python-sdk/client-gen.sh
After the script execution, the Python SDK is generated in the python/kserve
directory. Some files such as README and documents need to be merged manually after the script execution.
Navigate to python/kserve
directory from the root folder.
-
Install
poetry
:pip install poetry
-
Update the Python SDK version in the pyproject.toml.
-
Create some distributions in the normal way:
poetry build
-
Configure Test PyPI Credentials in Poetry:
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config http-basic.test-pypi <username> <password>
-
Upload with poetry to Test PyPI and verify things look right:
poetry publish -r test-pypi
-
Configure PyPI Credentials in Poetry:
poetry config http-basic.pypi <username> <password>
-
Upload to PyPI:
poetry publish