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

Make Ray compatible with pydantic>=2.5.0 #40451

Merged
merged 50 commits into from
Nov 18, 2023

Conversation

edoakes
Copy link
Contributor

@edoakes edoakes commented Oct 18, 2023

Why are these changes needed?

This change makes Ray compatible with pydantic>=2.5.0. It makes all Ray unit tests use pydantic==2.5.0. It also adds a test suite to check that Ray Serve works with pydantic<2.

Additional Changes:

  • This PR also updates the following packages:
    • mypy: 0.982 -> 1.7.0
    • deepspeed: 0.8.3 -> 0.12.3

Follow-up:

  • We need to make a follow-up PR that makes Ray release tests run with pydantic>=2.5.0.

Related issue number

Addresses:

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
      • This change updates Ray unit tests.

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes requested a review from a team as a code owner October 18, 2023 17:18
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Copy link
Collaborator

@aslonnie aslonnie left a comment

Choose a reason for hiding this comment

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

(seems @can-anyscale is going to review this one)

@edoakes
Copy link
Contributor Author

edoakes commented Oct 19, 2023

FYI to reviewers: this is a WIP, I won't merge it until after the next pydantic release that includes changes to make models cloudpickle-serializable.

@ddelange
Copy link
Contributor

FYI to reviewers: this is a WIP, I won't merge it until after the next pydantic release that includes changes to make models cloudpickle-serializable.

do you have a link for this? will that mean that this PR will have to require pydantic>=2.5?

@edoakes
Copy link
Contributor Author

edoakes commented Oct 23, 2023

@ddelange here's the link to the Pydantic issue: pydantic/pydantic#6763

After that is merged and released, we will require either < 2.0 or >= 2.5 (assuming 2.5 is the the release containing the fixes).

@edoakes edoakes self-assigned this Oct 24, 2023
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@@ -58,6 +58,6 @@ starlette
typer
fsspec
pandas>=1.3
pydantic<2
pydantic!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,<3
Copy link
Contributor

Choose a reason for hiding this comment

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

=2.5.0,<3 doesn't work?

Copy link
Contributor

Choose a reason for hiding this comment

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

That works, but we want to allow users to use pydantic<2 for Serve, so no need to pin it to 2.5.0 explicitly for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment to this effect?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I added one.

Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

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

Stamping for setup.py changes

Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@shrekris-anyscale
Copy link
Contributor

@architkulkarni This change is ready to merge.

@architkulkarni
Copy link
Contributor

@shrekris-anyscale Looks like premerge is still running, please let me know again when it's ready

@shrekris-anyscale
Copy link
Contributor

@architkulkarni Premerge passed. This PR is ready to merge.

@architkulkarni architkulkarni merged commit 31c6631 into ray-project:master Nov 18, 2023
15 of 18 checks passed
liuxsh9 pushed a commit to liuxsh9/ray that referenced this pull request Nov 18, 2023
This change makes Ray compatible with pydantic>=2.5.0. It makes all Ray unit tests use pydantic==2.5.0. It also adds a test suite to check that Ray Serve works with pydantic<2.

Additional Changes:

This PR also updates the following packages:
mypy: 0.982 -> 1.7.0
deepspeed: 0.8.3 -> 0.12.3
Follow-up:

We need to make a follow-up PR that makes Ray release tests run with pydantic>=2.5.0.

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Co-authored-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Xiaoshuang Liu <lxsbit@126.com>
architkulkarni pushed a commit that referenced this pull request Nov 21, 2023
As a follow-up to #40451, this change makes all the Ray release tests use pydantic>=2.5.0.

Additional changes:

The linter now uses mypy==1.7.0.
All Ray release tests, including workspace templates, now use deepspeed>=0.12.3.
This change fix the serve_resnet_benchmark.py release test, which is broken on master.

---------

Signed-off-by: can <can@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Co-authored-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@edoakes
Copy link
Contributor Author

edoakes commented Nov 23, 2023

Happy to see this merged, thanks for pushing it forward @shrekris-anyscale

ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Nov 29, 2023
This change makes Ray compatible with pydantic>=2.5.0. It makes all Ray unit tests use pydantic==2.5.0. It also adds a test suite to check that Ray Serve works with pydantic<2.

Additional Changes:

This PR also updates the following packages:
mypy: 0.982 -> 1.7.0
deepspeed: 0.8.3 -> 0.12.3
Follow-up:

We need to make a follow-up PR that makes Ray release tests run with pydantic>=2.5.0.

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Co-authored-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Nov 29, 2023
As a follow-up to ray-project#40451, this change makes all the Ray release tests use pydantic>=2.5.0.

Additional changes:

The linter now uses mypy==1.7.0.
All Ray release tests, including workspace templates, now use deepspeed>=0.12.3.
This change fix the serve_resnet_benchmark.py release test, which is broken on master.

---------

Signed-off-by: can <can@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Co-authored-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
jesse-c added a commit to SeldonIO/alibi-detect that referenced this pull request Apr 23, 2024
This is a follow-up to where the Pydantic v1 shim was added [1]. It's
inspired by Ray's approach [2].

This locks the version in the CI and I think that's okay since we
don't need to keep on updating them, as they're intended as smoke
tests.

[1] #882 (comment)
[2] ray-project/ray#40451
jesse-c added a commit to SeldonIO/alibi-detect that referenced this pull request Apr 24, 2024
This is a follow-up to where the Pydantic v1 shim was added [1]. It's
inspired by Ray's approach [2].

This locks the version in the CI and I think that's okay since we
don't need to keep on updating them, as they're intended as smoke
tests.

[1] #882 (comment)
[2] ray-project/ray#40451
jesse-c added a commit to SeldonIO/alibi-detect that referenced this pull request Apr 24, 2024
* test: Add Pydantic version to matrix variable

This is a follow-up to where the Pydantic v1 shim was added [1]. It's
inspired by Ray's approach [2].

This locks the version in the CI and I think that's okay since we
don't need to keep on updating them, as they're intended as smoke
tests.

[1] #882 (comment)
[2] ray-project/ray#40451

* build: Formatting
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.

10 participants