Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Add support for python 3.11 and 3.12; switch default to 3.9#1126

Merged
augray merged 3 commits intomainfrom
augray/support-3-11-3-12
Aug 26, 2024
Merged

Add support for python 3.11 and 3.12; switch default to 3.9#1126
augray merged 3 commits intomainfrom
augray/support-3-11-3-12

Conversation

@augray
Copy link
Member

@augray augray commented Aug 21, 2024

Python 3.8 reaches EOL in October. Meanwhile, python 3.11 and 3.12 have been released since we last updated our supported python versions. This PR adds support for 3.11 and 3.12, and changes the default bazel targets to use 3.9 instead of 3.8. Some things of note:

  • The bazel dependency for torchvision in python3.10 is no longer resolving (and doesn't resolve for 3.11 or 3.12 either). For now, this PR handles that by making all bazel targets depending on torch vision only get built/tested for 3.8 and 3.9 . Note that this does NOT mean the examples using torch vision will not be runnable in higher python versions outside the context of bazel.

  • recent rules_python introduce a complex bazel workspace dependency issue so we can only have bazel targets for building and testing with interpreters up to python3.11. Note again that this is a limitation of what we can do in bazel and not a limitation of what interpreters the resulting wheel can be run with.

Note that this does not change what version of python the server or default worker images run with (python3.9 for both). So this is essentially an sdk and local-server only change.

Testing

  • Ran all bazel tests
  • Used bazel CLI to start local server and run the MNIST example against it
  • built a wheel and ran the following tests on fresh virtual envs with python 3.9/3.10/3.11/3.12: (a) install from wheel (b) stop and start local server (c) run mnist example (d) view it in browser

@augray augray requested a review from neutralino1 August 21, 2024 21:56
@augray augray mentioned this pull request Aug 22, 2024
Copy link
Member

@neutralino1 neutralino1 left a comment

Choose a reason for hiding this comment

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

Amazing work, thank you!

@augray augray added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit 3d18ed2 Aug 26, 2024
@augray augray deleted the augray/support-3-11-3-12 branch August 26, 2024 18:13
github-merge-queue bot pushed a commit that referenced this pull request Aug 26, 2024
SQLAlchemy 2.0 came out in January of 2023 (>1.5 years ago). It
introduced a variety of breaking changes. Sematic uses SQLAlchemy
heavily, and in complex ways (ORM type introspection for dynamic
serialization/deserialization, ORM type mixins, complex and dynamic
query builds). This meant we had to wait to upgrade until sufficient
time could be dedicated to migrating and testing it. We don't want to
wait too much longer, it's only a matter of time before 1.x releases
stop getting published and SQLAlchemy's development has largely shifted
to >=2.0. So this PR bites the bullet and does the upgrade.

This PR also upgrades the server image python version to 3.12. While not
technically related to the SQLAlchemy changes, it follows closely on the
heels of #1126 , and since that did not change anything running on the
server (but this does) it seemed like an OK place to add so the 3.12
server and SQLAlchemy 2.0 changes could be tested together.

Finally, there was actually a bug for custom metrics usage that was not
caught in unit tests. This PR fixes that bug, confirmed in remote
testing.

Testing
--------

In addition to all unit tests passing, I also tested running a local
server with bazel and running the MNIST example in it. I confirmed
built-in metrics worked and the pipeline passed with the expected
resulting UI.

I then built a wheel with these changes and published a release
candidate Docker image for the standard and EE images.

In a remote environment, I:

- Confirmed the built-in system pipeline metrics (ex: success rate and
timings) worked
- ran a pipeline end-to-end
- ran a pipeline that used a Ray cluster
- ran a pipeline that used custom metrics and confirmed the UI works
- cofirmed that the cleaner is working
- tested run search extensively

---------

Co-authored-by: Josh Bauer <josh@sematic.dev>
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