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

[Feature] Running end-to-end tests on local machine #589

Merged
merged 7 commits into from
Sep 28, 2022

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Sep 26, 2022

Why are these changes needed?

We need to download (docker pull) all necessary docker images before we load the images into a KinD cluster. Without this, the command kind load docker-image kuberay/apiserver:nightly will report an error message as follows.

ERROR: image: "kuberay/apiserver:nightly" not present locally

In addition, we also use kind load command to preload the rayproject/ray image into KinD cluster. Although the Kubernetes cluster will pull the ray image automatically when we create a custom resource RayCluster, pulling rayproject/ray:1.9.0 (2.44GB) may cause ImagePullBackOff (Link) due to timeout. In addition, the RayCluster startup time will vary based on network speed and make the tests flaky.

Related issue number

Closes #590

Checks

cd /path/to/your/kuberay
python3 tests/compatibility-test.py

截圖 2022-09-26 上午11 10 07

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

@wilsonwang371
Copy link
Collaborator

I just realized we may need to separate these functions into different files. that will be easier for our future updates. I posted another patch #591 and this should make our changes to ci tests more convenient.

@kevin85421
Copy link
Member Author

I just realized we may need to separate these functions into different files. that will be easier for our future updates. I posted another patch #591 and this should make our changes to ci tests more convenient.

Thank you for this patch! Feel free to ping me for review when it passes CI/CD tests.

@kevin85421
Copy link
Member Author

I found an interesting bug when I tried to use argparse to simplify the logic of parse_environments() (See 6751bc9 for more details.). The following simple scripts can reproduce the bugs.

  • test1.py

     import argparse
     import unittest
    
     if __name__ == '__main__':
         parser = argparse.ArgumentParser()
         parser.add_argument('--input', '-i', dest='input',
                             required=False, default='Hello KubeRay')
         args = parser.parse_args()
         print(args.input)
         unittest.main()
  • test2.py

     import argparse
     import unittest
    
     if __name__ == '__main__':
         parser = argparse.ArgumentParser()
         parser.add_argument('--input', '-i', dest='input',
                             required=False, default='Hello KubeRay')
         args = parser.parse_args()
         print(args.input)
  • Experiment1: python3 test1.py --input haha

    $ python3 test.py --input haha
    haha
    usage: test.py [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [-k TESTNAMEPATTERNS]
                  [tests [tests ...]]
    test.py: error: unrecognized arguments: --input
    (base)
  • Experiment2: python3 test2.py --input haha

    $ python3 test.py --input haha
    haha
    (base)

The error message "unrecognized arguments: --input" in Experiment1 is reported by unittest.main(). This is because unittest.main() implicitly read sys.argv (See Link for more details.)

Copy link
Collaborator

@DmitriGekhtman DmitriGekhtman left a comment

Choose a reason for hiding this comment

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

Thanks, this is a great improvement.

@DmitriGekhtman DmitriGekhtman merged commit ea6e8d1 into ray-project:master Sep 28, 2022
lowang-bh pushed a commit to lowang-bh/kuberay that referenced this pull request Sep 24, 2023
We need to download (docker pull) all necessary docker images before we load the images into a KinD cluster. Without this, the command kind load docker-image kuberay/apiserver:nightly will report an error message as follows.

ERROR: image: "kuberay/apiserver:nightly" not present locally
In addition, we also use kind load command to preload the rayproject/ray image into KinD cluster. Although the Kubernetes cluster will pull the ray image automatically when we create a custom resource RayCluster, pulling rayproject/ray:1.9.0 (2.44GB) may cause ImagePullBackOff (Link) due to timeout. In addition, the RayCluster startup time will vary based on network speed and make the tests flaky.
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.

[Feature] Running end-to-end tests on local machine
3 participants