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

[Release] Synchronize for release #68

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/bank/v1/account.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "bank/v1/errors.proto";
// State machine definition.

message Account {
option (.rbt.v1alpha1.state) = {
option (rbt.v1alpha1.state) = {
};
string customer_name = 1;
uint64 balance = 2;
Expand Down
2 changes: 1 addition & 1 deletion api/bank/v1/bank.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ service BankInterface {
////////////////////////////////////////////////////////////////////////

message Bank {
option (.rbt.v1alpha1.state) = {
option (rbt.v1alpha1.state) = {
};
repeated string account_ids = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion api/hello_constructors/v1/hello.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ service HelloInterface {
}

message Hello {
option (.rbt.v1alpha1.state) = {
option (rbt.v1alpha1.state) = {
};
repeated string messages = 2;
}
Expand Down
2 changes: 1 addition & 1 deletion api/hello_legacy_grpc/v1/greeter.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ service ProxyGreeter {
}

message RebootGreeter {
option (.rbt.v1alpha1.state) = {
option (rbt.v1alpha1.state) = {
};
int32 num_greetings = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion api/hello_tasks/v1/hello.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ message Message {
}

message Hello {
option (.rbt.v1alpha1.state) = {
option (rbt.v1alpha1.state) = {
};
repeated Message messages = 1;
int32 num_erased_messages = 2;
Expand Down
2 changes: 1 addition & 1 deletion bank/.rbtrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ dev run --watch=backend/**/*.py
dev run --python

# Run the application!
dev run backend/src/main.py
dev run --application=backend/src/main.py
2 changes: 1 addition & 1 deletion hello-constructors/.rbtrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ dev run --watch=backend/**/*.py
dev run --python

# Run the application!
dev run backend/src/main.py
dev run --application=backend/src/main.py
2 changes: 1 addition & 1 deletion hello-legacy-grpc/.rbtrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ dev run --watch=backend/**/*.py
dev run --python

# Run the application!
dev run backend/src/main.py
dev run --application=backend/src/main.py
3 changes: 2 additions & 1 deletion hello-legacy-grpc/backend/src/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import reboot.aio.memoize
from deprecated_greeter_servicer import DeprecatedGreeterServicer
from hello_legacy_grpc.v1.greeter_rbt import RebootGreeter
from proxy_greeter_servicer import ProxyGreeterServicer
Expand All @@ -24,7 +25,7 @@ async def initialize(context: ExternalContext):

async def main():
await Application(
servicers=[RebootGreeterServicer],
servicers=[RebootGreeterServicer] + reboot.aio.memoize.servicers(),
legacy_grpc_servicers=[
DeprecatedGreeterServicer, ProxyGreeterServicer
],
Expand Down
32 changes: 16 additions & 16 deletions hello-legacy-grpc/backend/src/reboot_greeter_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
WorkflowContext,
WriterContext,
)
from reboot.aio.memoize import at_most_once

logging.basicConfig(level=logging.INFO)

Expand Down Expand Up @@ -78,22 +79,21 @@ async def Initialize(
context: WorkflowContext,
request: Empty,
):
# Call the ProxyGreeter service for a few greetings.
#
# NOTE: we don't currently have a way to call legacy gRPC
# _idempotently_ (that's one of the reasons for Reboot!), so
# for now we assume/hope that this workflow won't get retried
# due to a failure but it's totally possible and if it happens
# we might perform extra greets!
async with context.legacy_grpc_channel() as channel:
proxy_greeter_stub = greeter_pb2_grpc.ProxyGreeterStub(channel)

for i in range(10):
greet_response = await proxy_greeter_stub.Greet(
greeter_pb2.GreetRequest(name="legacy gRPC")
)
logging.info(
f"Received a greeting: '{greet_response.message}'"
)
async def make_greetings():
"""Calls the ProxyGreeter service for a few greetings."""
async with context.legacy_grpc_channel() as channel:
proxy_greeter_stub = greeter_pb2_grpc.ProxyGreeterStub(channel)

for i in range(10):
greet_response = await proxy_greeter_stub.Greet(
greeter_pb2.GreetRequest(name="legacy gRPC")
)
logging.info(
f"Received a greeting: '{greet_response.message}'"
)

# We only want to make the greetings at-most-once.
await at_most_once("make greetings", context, make_greetings)

return Empty()
2 changes: 1 addition & 1 deletion hello-tasks/.rbtrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ dev run --watch=backend/**/*.py
dev run --python

# Run the application!
dev run backend/src/main.py
dev run --application=backend/src/main.py
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[project]
requires-python = ">= 3.10"
dependencies = [
"reboot==0.15.0",
"reboot==0.16.0",
]

[tool.rye]
dev-dependencies = [
"mypy==1.2.0",
"pytest>=7.4.2",
"types-protobuf>=4.24.0.20240129",
"reboot==0.15.0",
"reboot==0.16.0",
]

# This project only uses `rye` to provide `python` and its dependencies, so
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.2
# via kubernetes-asyncio
# via reboot
reboot==0.15.0
reboot==0.16.0
setuptools==75.1.0
# via grpcio-tools
six==1.16.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.2
# via kubernetes-asyncio
# via reboot
reboot==0.15.0
reboot==0.16.0
setuptools==75.1.0
# via grpcio-tools
six==1.16.0
Expand Down
Loading