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

Reorganize python client library #984

Merged
merged 3 commits into from
Mar 25, 2023

Conversation

jasoonn
Copy link
Contributor

@jasoonn jasoonn commented Mar 24, 2023

Why are these changes needed?

Errors occur when I tried to run the example in the Python client library and import functions from the package. It seems to be related to the packing for Python Client Library.

1. Error when running example

cd path/to/kuberay/clients/python-client/python_client
pip install -e .
cd ../examples/
python3 complete-example.py 

image

2. Error when import in python

image

Reorganize the structure for the Python client.

  1. Moved pyproject.toml to its parent folder which enable kuberay_cluster_api.py to be packed into Python client package.
  2. Fixed import path in the python client library.

How to test

  1. Unittest(Need k8s cluster already setup)
cd path/to/kuberay/clients/python-client
pip install -e .
cd python_client_test/
python3 -m unittest

image

  1. Running examples(Need Kuberay operator already installed)
cd path/to/kuberay/clients/python-client
pip install -e .
cd examples/
python3 complete-example.py 
  1. Using python to import the module anywhere

image

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@kevin85421
Copy link
Member

cc @Yicheng-Lu-llll

Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Step 1: Install Python client (path: kuberay/clients/python-client)
pip install -e .

# Step 2: Run tests (path: kuberay/)
# (test_api.py, test_director.py, test_utils.py)
python -m unittest discover clients/python-client/python_client_test/

Screen Shot 2023-03-24 at 4 54 21 PM

# Run examples (path: kuberay/clients/python-client/examples)
# I ran every example under this folder manually.
python3  use-utils.py

@kevin85421 kevin85421 merged commit 082389e into ray-project:master Mar 25, 2023
lowang-bh pushed a commit to lowang-bh/kuberay that referenced this pull request Sep 24, 2023
Reorganize python client library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants