-
Notifications
You must be signed in to change notification settings - Fork 3
Blob storage: Blob state machine with a pluggable gRPC data plane
#109
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
Open
rjhuijsman
wants to merge
20
commits into
main
Choose a base branch
from
rjh.blob-storage-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0ea1898
reboot: support the `PUT` method for custom HTTP routes
rjhuijsman 82c3e35
reboot: run library `pre_run` hooks in the test harness
rjhuijsman 22b37df
`reboot/std`: add a `Blob` state machine
rjhuijsman 862581c
rbt: run the filesystem blob data plane under `dev`/`serve run`
rjhuijsman d760224
reboot/std/react: add browser helpers for blob upload and download
rjhuijsman a9e9966
reboot/examples/chat-room: support message attachments
rjhuijsman 169da9f
`reboot`: let a library contribute plain gRPC servicers
rjhuijsman 43624f0
`reboot`: remove an untrusted caller ID on every route, not one
rjhuijsman 3bf4f37
`reboot/std`: give the filesystem store's metadata a type
rjhuijsman fdb86a4
`reboot/std`: stop writing part uploads from the event loop
rjhuijsman 8b72152
`reboot/std`: make the filesystem blob data plane part of the applica…
rjhuijsman 91c22ef
`reboot/std`: say absent rather than empty in the `Blob` API
rjhuijsman cd6f821
`tests`: wait on blob state reactively rather than by polling
rjhuijsman caa3204
`documentation`: address review comments
rjhuijsman e8b9282
`documentation`: close the `from_react` snippet's `if`
rjhuijsman 23f8e48
Address review comments
rjhuijsman a51d06e
Address review comments
rjhuijsman 0edeb5b
`reboot/examples/chat-room`: say how `Send` holds its lock
rjhuijsman 0eb85a4
`reboot/std`: move the filesystem data plane's bookkeeping into its s…
rjhuijsman 1d14968
`reboot/std`: serve `BlobDataPlane` with one servicer for every store
rjhuijsman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| paths: | ||
| - "**/*.py" | ||
| --- | ||
|
|
||
| # Annotate every function's return type | ||
|
|
||
| Every Python function and method you write or touch gets a return | ||
| type annotation, `-> None` included, wherever one can be written. The | ||
| same goes for parameters: annotate them unless the type genuinely | ||
| cannot be named. Generated gRPC servicer methods are no exception — | ||
| annotate `request` with its message type and the method with its | ||
| response type. | ||
|
|
||
| **Why:** A missing return annotation makes `mypy` treat the function | ||
| as returning `Any`, which silently switches off type checking for | ||
| everything the result flows into. It also leaves the reader to | ||
| reconstruct from the body what a method hands back — a method named | ||
| `_caller` that returned an `ExternalContext` went unnoticed in review | ||
| until someone asked. | ||
|
|
||
| **How to apply:** Before committing, scan the diff for `def` lines | ||
| without `->`. When a function returns nothing, write `-> None`. When | ||
| the natural return type needs an import (a `_pb2` message, an | ||
| `Optional[...]`), add the import rather than leaving the annotation | ||
| off. The only acceptable omission is a signature whose type cannot be | ||
| expressed without a `# type: ignore`, and that deserves a comment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
reboot-dev-bot marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| load( | ||
| "@com_github_reboot_dev_reboot//reboot:rules.bzl", | ||
| "js_proto_library", | ||
| "js_reboot_library", | ||
| "js_reboot_react_library", | ||
| "js_reboot_web_library", | ||
| "py_reboot_library", | ||
| ) | ||
| load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") | ||
|
|
||
| proto_library( | ||
| name = "blob_proto", | ||
| srcs = [ | ||
| ":blob.proto", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "@com_github_reboot_dev_reboot//rbt/v1alpha1:options_proto", | ||
| "@com_google_protobuf//:descriptor_proto", | ||
| ], | ||
| ) | ||
|
|
||
| # The blob data-plane interface: a plain gRPC service (no Reboot state | ||
| # options). Built with `py_reboot_library` so that, besides the plain | ||
| # `_pb2`/`_pb2_grpc` modules, it emits the `_rbt` module that lets a | ||
| # Reboot application host an implementation via | ||
| # `legacy_grpc_servicers`. Python-only: the JS SDK talks to the `Blob` | ||
| # control plane, never the data plane directly. | ||
| proto_library( | ||
| name = "data_plane_proto", | ||
| srcs = [ | ||
| ":data_plane.proto", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| py_reboot_library( | ||
| name = "data_plane_py_reboot", | ||
| proto = "data_plane.proto", | ||
| proto_library = ":data_plane_proto", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| # The filesystem data plane's own metadata state. Python-only: it is | ||
| # an implementation detail of one data plane, not part of any client's | ||
| # API. | ||
| proto_library( | ||
| name = "filesystem_proto", | ||
| srcs = [ | ||
| ":filesystem.proto", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "@com_github_reboot_dev_reboot//rbt/v1alpha1:options_proto", | ||
| "@com_google_protobuf//:descriptor_proto", | ||
| ], | ||
| ) | ||
|
|
||
| py_reboot_library( | ||
| name = "filesystem_py_reboot", | ||
| proto = "filesystem.proto", | ||
| proto_library = ":filesystem_proto", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| py_reboot_library( | ||
| name = "blob_py_reboot", | ||
| proto = "blob.proto", | ||
| proto_library = ":blob_proto", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| js_proto_library( | ||
| name = "blob_js_proto", | ||
| package_json = ":package.json", | ||
| proto = "blob.proto", | ||
| proto_deps = [ | ||
| ":blob_proto", | ||
| # ISSUE(https://github.com/reboot-dev/mono/issues/3218): Until we can | ||
| # use `create_protoc_plugin_rule` we need to repeat the dependencies of | ||
| # the `proto_libraries` here. | ||
| "@com_github_reboot_dev_reboot//rbt/v1alpha1:options_proto", | ||
| "@com_google_protobuf//:descriptor_proto", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| js_reboot_library( | ||
| name = "blob_js_reboot", | ||
| srcs = [ | ||
| ":blob_proto", | ||
| ], | ||
| proto = "blob.proto", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| ":blob_js_proto", | ||
| ], | ||
| ) | ||
|
|
||
| # The browser client: the same API as the React client, but callable | ||
| # from anywhere rather than only from inside a component. | ||
| js_reboot_web_library( | ||
| name = "blob_js_reboot_web", | ||
| proto = "blob.proto", | ||
| proto_deps = [ | ||
| ":blob_proto", | ||
| # ISSUE(https://github.com/reboot-dev/mono/issues/3218): Until we can | ||
| # use `create_protoc_plugin_rule` we need to repeat the dependencies of | ||
| # the `proto_libraries` here. | ||
| "@com_github_reboot_dev_reboot//rbt/v1alpha1:options_proto", | ||
| "@com_google_protobuf//:descriptor_proto", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| ":blob_js_proto", | ||
| ], | ||
| ) | ||
|
|
||
| js_reboot_react_library( | ||
| name = "blob_js_reboot_react", | ||
| srcs = [ | ||
| ":blob_js_proto", | ||
| ], | ||
| proto = "blob.proto", | ||
| proto_deps = [ | ||
| ":blob_proto", | ||
| # ISSUE(https://github.com/reboot-dev/mono/issues/3218): Until we can | ||
| # use `create_protoc_plugin_rule` we need to repeat the dependencies of | ||
| # the `proto_libraries` here. | ||
| "@com_github_reboot_dev_reboot//rbt/v1alpha1:options_proto", | ||
| "@com_google_protobuf//:descriptor_proto", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.