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

Draft/RFC: prep for proto serialization of payloads #2893

Closed
wants to merge 10 commits into from

Conversation

freider
Copy link
Contributor

@freider freider commented Feb 24, 2025

Introduces a new form of payload serialization based on a proto structure (inspired by the Modal hackathon format), which could replace the current pickle((args, kwargs)).

Rough goals of this:

  • Incorporate some of the structural proto changes/extensions needed for "container types" like lists and dicts
  • Allow for optional separation of serialization/deserialization and validation logic, as opposed to the current class parameter serialization which entangles these concepts (class parameters require strict schemas via type annotations at the moment)
  • Refactor code to reuse as much as possible between the "payload" and "parameter" serialization paths. In the future, we could migrate the current class parameter serialization format to this new payload format instead, but such a migration would have some forward/backward compatibility considerations since it would be a change to the serialized bytes etc.

As this PR stands, it shouldn't have any effect on actual live apps, but if we feel this is a good approach a next step would be to add support for decoding of these payload types into the actual client such that any functions deployed with this would be callable using proto payloads.


Check these boxes or delete any item (or this section) if not relevant for this PR.

  • Client+Server: this change is compatible with old servers
  • Client forward compatibility: this change ensures client can accept data intended for later versions of itself

Note on protobuf: protobuf message changes in one place may have impact to
multiple entities (client, server, worker, database). See points above.


Changelog

@freider freider changed the title Draft/RFC: prep payload serialization code Draft/RFC: prep payload prot serialization code Feb 24, 2025
@freider freider changed the title Draft/RFC: prep payload prot serialization code Draft/RFC: prep for proto serialization of payloads Feb 24, 2025
@freider
Copy link
Contributor Author

freider commented Feb 24, 2025

Hold on, bringing in the some more code from the hackathon

@freider freider closed this Feb 24, 2025
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.

1 participant