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

Remove usage of method placeholder functions #2364

Merged
merged 180 commits into from
Nov 27, 2024

Conversation

devennavani
Copy link
Contributor

@devennavani devennavani commented Oct 20, 2024

This PR introduces a new minor client version 0.67.x that does not create method placeholder functions for modal classes.

I've tested all forward lookup scenarios (.lookup() of a 0.67 class from a pre 0.67 client) as well as backwards lookup scenarios (.lookup() of a pre 0.67 class from a 0.67 client) and all work, except for a 0.62 client looking up a 0.67 class, which will be explicitly not supported (this maintains our current restriction of not being able to lookup a 0.63+ class from a 0.62 client).

Changelog

New minor client version 0.67.x comes with an internal data model change for how Modal creates functions for Modal classes. There are no breaking or backwards-incompatible changes with this new minor version. All forward lookup scenarios (.lookup() of a 0.67 class from a pre 0.67 client) as well as backwards lookup scenarios (.lookup() of a pre 0.67 class from a 0.67 client) work, except for a 0.62 client looking up a 0.67 class (this maintains our current restriction of not being able to lookup a 0.63+ class from a 0.62 client).

Base automatically changed from deven/app_cls_cleanup to main October 21, 2024 15:36
@devennavani devennavani changed the base branch from main to deven/show_urls_for_new_style_class_methods November 21, 2024 21:10
Base automatically changed from deven/show_urls_for_new_style_class_methods to main November 21, 2024 23:29
@devennavani devennavani marked this pull request as ready for review November 23, 2024 01:52
Copy link
Contributor

@freider freider left a comment

Choose a reason for hiding this comment

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

lovely! did we decide to not backfill method metadata on existing classes in order to remove existing placeholders? (completely understandable, seems messy).

Another related question:
Will "forward" lookups work after this? I.e. can a 0.63 client .lookup() a 0.67 class? The way I understand the ClassGet backend implementation the answer is yes, since it "mocks out" placeholders with the function id set to the class service function?

@devennavani
Copy link
Contributor Author

lovely! did we decide to not backfill method metadata on existing classes in order to remove existing placeholders? (completely understandable, seems messy).

Another related question: Will "forward" lookups work after this? I.e. can a 0.63 client .lookup() a 0.67 class? The way I understand the ClassGet backend implementation the answer is yes, since it "mocks out" placeholders with the function id set to the class service function?

@freider yes, forward lookups will work, excluding lookups from a 0.62 client, which is currently not supported either.

re: your first question, yea it feels a bit messy. i'm guessing i would have to have the server modify the class service function definitions coming from older clients to include the method definitions mapping and that will likely introduce more confusion

@devennavani
Copy link
Contributor Author

@prbot approve

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

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

Approved 👍. @mwaskom will follow-up review this.

Copy link
Contributor

@mwaskom mwaskom left a comment

Choose a reason for hiding this comment

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

I know this mostly involves internal changes but is there anything we should put in a public changelog here? Users will see the version bump and wonder what's non-compatible.

I left a few other comments but mostly Python trivia that you don't need to address.

This change is touching some very complicated stuff and I didn't fully pore through all the details, as I trust you've exercised it thoroughly in your testing. LMK if you'd feel more comfortable with me doing that before you merge.

modal/cls.py Outdated Show resolved Hide resolved
modal/cli/import_refs.py Outdated Show resolved Hide resolved
modal/_runtime/container_io_manager.py Show resolved Hide resolved
modal/cli/run.py Outdated Show resolved Hide resolved
modal/cls.py Outdated Show resolved Hide resolved
modal/cls.py Outdated Show resolved Hide resolved
modal/cls.py Show resolved Hide resolved
@devennavani devennavani merged commit 5d793ef into main Nov 27, 2024
22 checks passed
@devennavani devennavani deleted the deven/add_method_webhook_configs_to_class_function branch November 27, 2024 21:20
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.

3 participants