From 6ccf6ba7f56b630726c92c43005c008744f67737 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Sun, 21 Jan 2024 21:24:52 +0300 Subject: [PATCH] feat: add min_concurrency --- projects/fal/src/fal/api.py | 10 ++ projects/fal/src/fal/cli.py | 5 + projects/fal/src/fal/sdk.py | 8 ++ .../src/isolate_proto/controller.proto | 3 + .../src/isolate_proto/controller_pb2.py | 92 +++++++++---------- .../src/isolate_proto/controller_pb2.pyi | 37 ++++++++ 6 files changed, 109 insertions(+), 46 deletions(-) diff --git a/projects/fal/src/fal/api.py b/projects/fal/src/fal/api.py index a6fbb845..80fddb27 100644 --- a/projects/fal/src/fal/api.py +++ b/projects/fal/src/fal/api.py @@ -32,6 +32,7 @@ from fal.sdk import ( FAL_SERVERLESS_DEFAULT_KEEP_ALIVE, FAL_SERVERLESS_DEFAULT_MAX_MULTIPLEXING, + FAL_SERVERLESS_DEFAULT_MIN_CONCURRENCY, Credentials, FalServerlessClient, FalServerlessConnection, @@ -309,6 +310,7 @@ class FalServerlessHost(Host): "machine_type", "keep_alive", "max_concurrency", + "min_concurrency", "max_multiplexing", "setup_function", "metadata", @@ -352,6 +354,7 @@ def register( ) keep_alive = options.host.get("keep_alive", FAL_SERVERLESS_DEFAULT_KEEP_ALIVE) max_concurrency = options.host.get("max_concurrency") + min_concurrency = options.host.get("min_concurrency") max_multiplexing = options.host.get("max_multiplexing") base_image = options.host.get("_base_image", None) scheduler = options.host.get("_scheduler", None) @@ -367,6 +370,7 @@ def register( scheduler_options=scheduler_options, max_multiplexing=max_multiplexing, max_concurrency=max_concurrency, + min_concurrency=min_concurrency, ) partial_func = _prepare_partial_func(func) @@ -416,6 +420,7 @@ def run( ) keep_alive = options.host.get("keep_alive", FAL_SERVERLESS_DEFAULT_KEEP_ALIVE) max_concurrency = options.host.get("max_concurrency") + min_concurrency = options.host.get("min_concurrency") max_multiplexing = options.host.get("max_multiplexing") base_image = options.host.get("_base_image", None) scheduler = options.host.get("_scheduler", None) @@ -432,6 +437,7 @@ def run( scheduler_options=scheduler_options, max_multiplexing=max_multiplexing, max_concurrency=max_concurrency, + min_concurrency=min_concurrency, ) return_value = _UNSET @@ -556,6 +562,7 @@ def function( machine_type: str = FAL_SERVERLESS_DEFAULT_MACHINE_TYPE, keep_alive: int = FAL_SERVERLESS_DEFAULT_KEEP_ALIVE, max_multiplexing: int = FAL_SERVERLESS_DEFAULT_MAX_MULTIPLEXING, + min_concurrency: int = FAL_SERVERLESS_DEFAULT_MIN_CONCURRENCY, setup_function: Callable[..., None] | None = None, _base_image: str | None = None, _scheduler: str | None = None, @@ -581,6 +588,7 @@ def function( machine_type: str = FAL_SERVERLESS_DEFAULT_MACHINE_TYPE, keep_alive: int = FAL_SERVERLESS_DEFAULT_KEEP_ALIVE, max_multiplexing: int = FAL_SERVERLESS_DEFAULT_MAX_MULTIPLEXING, + min_concurrency: int = FAL_SERVERLESS_DEFAULT_MIN_CONCURRENCY, setup_function: Callable[..., None] | None = None, _base_image: str | None = None, _scheduler: str | None = None, @@ -658,6 +666,7 @@ def function( machine_type: str = FAL_SERVERLESS_DEFAULT_MACHINE_TYPE, keep_alive: int = FAL_SERVERLESS_DEFAULT_KEEP_ALIVE, max_multiplexing: int = FAL_SERVERLESS_DEFAULT_MAX_MULTIPLEXING, + min_concurrency: int = FAL_SERVERLESS_DEFAULT_MIN_CONCURRENCY, setup_function: Callable[..., None] | None = None, _base_image: str | None = None, _scheduler: str | None = None, @@ -688,6 +697,7 @@ def function( machine_type: str = FAL_SERVERLESS_DEFAULT_MACHINE_TYPE, keep_alive: int = FAL_SERVERLESS_DEFAULT_KEEP_ALIVE, max_multiplexing: int = FAL_SERVERLESS_DEFAULT_MAX_MULTIPLEXING, + min_concurrency: int = FAL_SERVERLESS_DEFAULT_MIN_CONCURRENCY, setup_function: Callable[..., None] | None = None, _base_image: str | None = None, _scheduler: str | None = None, diff --git a/projects/fal/src/fal/cli.py b/projects/fal/src/fal/cli.py index 612c67c7..f3f59752 100644 --- a/projects/fal/src/fal/cli.py +++ b/projects/fal/src/fal/cli.py @@ -365,6 +365,7 @@ def _alias_table(aliases: list[AliasInfo]): table.add_column("Alias") table.add_column("Revision") table.add_column("Auth") + table.add_column("Min Concurrency") table.add_column("Max Concurrency") table.add_column("Max Multiplexing") table.add_column("Keep Alive") @@ -375,6 +376,7 @@ def _alias_table(aliases: list[AliasInfo]): app_alias.alias, app_alias.revision, app_alias.auth_mode, + str(app_alias.min_concurrency), str(app_alias.max_concurrency), str(app_alias.max_multiplexing), str(app_alias.keep_alive), @@ -429,6 +431,7 @@ def alias_list(client: api.FalServerlessClient): @click.option("--keep-alive", "-k", type=int) @click.option("--max-multiplexing", "-m", type=int) @click.option("--max-concurrency", "-c", type=int) +@click.option("--min-concurrency", type=int) # TODO: add auth_mode # @click.option( # "--auth", @@ -442,6 +445,7 @@ def alias_update( keep_alive: int | None, max_multiplexing: int | None, max_concurrency: int | None, + min_concurrency: int | None, ): with client.connect() as connection: if keep_alive is None and max_multiplexing is None and max_concurrency is None: @@ -453,6 +457,7 @@ def alias_update( keep_alive=keep_alive, max_multiplexing=max_multiplexing, max_concurrency=max_concurrency, + min_concurrency=min_concurrency, ) table = _alias_table([alias_info]) diff --git a/projects/fal/src/fal/sdk.py b/projects/fal/src/fal/sdk.py index fe0bd459..214a2aa7 100644 --- a/projects/fal/src/fal/sdk.py +++ b/projects/fal/src/fal/sdk.py @@ -27,6 +27,7 @@ _DEFAULT_SERIALIZATION_METHOD = "dill" FAL_SERVERLESS_DEFAULT_KEEP_ALIVE = 10 FAL_SERVERLESS_DEFAULT_MAX_MULTIPLEXING = 1 +FAL_SERVERLESS_DEFAULT_MIN_CONCURRENCY = 0 log = get_logger(__name__) @@ -188,6 +189,7 @@ class AliasInfo: max_concurrency: int max_multiplexing: int active_runners: int + min_concurrency: int @dataclass @@ -272,6 +274,7 @@ def _from_grpc_alias_info(message: isolate_proto.AliasInfo) -> AliasInfo: max_concurrency=message.max_concurrency, max_multiplexing=message.max_multiplexing, active_runners=message.active_runners, + min_concurrency=message.min_concurrency, ) @@ -330,6 +333,7 @@ class MachineRequirements: scheduler_options: dict[str, Any] | None = None max_concurrency: int | None = None max_multiplexing: int | None = None + min_concurrency: int | None = None @dataclass @@ -425,6 +429,7 @@ def register( machine_requirements.scheduler_options or {} ), max_concurrency=machine_requirements.max_concurrency, + min_concurrency=machine_requirements.min_concurrency, max_multiplexing=machine_requirements.max_multiplexing, ) else: @@ -462,12 +467,14 @@ def update_application( keep_alive: int | None = None, max_multiplexing: int | None = None, max_concurrency: int | None = None, + min_concurrency: int | None = None, ) -> AliasInfo: request = isolate_proto.UpdateApplicationRequest( application_name=application_name, keep_alive=keep_alive, max_multiplexing=max_multiplexing, max_concurrency=max_concurrency, + min_concurrency=min_concurrency, ) res: isolate_proto.UpdateApplicationResult = self.stub.UpdateApplication( request @@ -496,6 +503,7 @@ def run( ), max_concurrency=machine_requirements.max_concurrency, max_multiplexing=machine_requirements.max_multiplexing, + min_concurrency=machine_requirements.min_concurrency, ) else: wrapped_requirements = None diff --git a/projects/isolate_proto/src/isolate_proto/controller.proto b/projects/isolate_proto/src/isolate_proto/controller.proto index 79513763..70cede43 100644 --- a/projects/isolate_proto/src/isolate_proto/controller.proto +++ b/projects/isolate_proto/src/isolate_proto/controller.proto @@ -148,6 +148,7 @@ message MachineRequirements { optional google.protobuf.Struct scheduler_options = 8; optional int32 max_multiplexing = 6; optional int32 max_concurrency = 9; + optional int32 min_concurrency = 10; } enum ApplicationAuthMode { @@ -189,6 +190,7 @@ message UpdateApplicationRequest { optional int32 keep_alive = 2; optional int32 max_multiplexing = 3; optional int32 max_concurrency = 4; + optional int32 min_concurrency = 5; } message UpdateApplicationResult { @@ -229,6 +231,7 @@ message AliasInfo { int32 max_multiplexing = 5; int32 keep_alive = 6; int32 active_runners = 7; + int32 min_concurrency = 8; } message SetSecretRequest { diff --git a/projects/isolate_proto/src/isolate_proto/controller_pb2.py b/projects/isolate_proto/src/isolate_proto/controller_pb2.py index aaf98c83..3d0e2f4b 100644 --- a/projects/isolate_proto/src/isolate_proto/controller_pb2.py +++ b/projects/isolate_proto/src/isolate_proto/controller_pb2.py @@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x10\x63ontroller.proto\x12\ncontroller\x1a\x0c\x63ommon.proto\x1a\x0cserver.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto"\xde\x01\n\tHostedMap\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12\x42\n\x14machine_requirements\x18\x02 \x01(\x0b\x32\x1f.controller.MachineRequirementsH\x00\x88\x01\x01\x12#\n\x08\x66unction\x18\x03 \x01(\x0b\x32\x11.SerializedObject\x12!\n\x06inputs\x18\x04 \x03(\x0b\x32\x11.SerializedObjectB\x17\n\x15_machine_requirements"\xf6\x01\n\tHostedRun\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12\x42\n\x14machine_requirements\x18\x02 \x01(\x0b\x32\x1f.controller.MachineRequirementsH\x00\x88\x01\x01\x12#\n\x08\x66unction\x18\x03 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x04 \x01(\x0b\x32\x11.SerializedObjectH\x01\x88\x01\x01\x42\x17\n\x15_machine_requirementsB\r\n\x0b_setup_func"\x88\x01\n\x14\x43reateUserKeyRequest\x12\x35\n\x05scope\x18\x01 \x01(\x0e\x32&.controller.CreateUserKeyRequest.Scope\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01"\x1b\n\x05Scope\x12\t\n\x05\x41\x44MIN\x10\x00\x12\x07\n\x03\x41PI\x10\x01\x42\x08\n\x06_alias";\n\x15\x43reateUserKeyResponse\x12\x12\n\nkey_secret\x18\x01 \x01(\t\x12\x0e\n\x06key_id\x18\x02 \x01(\t"\x15\n\x13ListUserKeysRequest"B\n\x14ListUserKeysResponse\x12*\n\tuser_keys\x18\x01 \x03(\x0b\x32\x17.controller.UserKeyInfo"&\n\x14RevokeUserKeyRequest\x12\x0e\n\x06key_id\x18\x01 \x01(\t"\x17\n\x15RevokeUserKeyResponse"\x93\x01\n\x0bUserKeyInfo\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x05scope\x18\x03 \x01(\x0e\x32&.controller.CreateUserKeyRequest.Scope\x12\r\n\x05\x61lias\x18\x04 \x01(\t"\xb1\x01\n\x0fHostedRunResult\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x30\n\x06status\x18\x02 \x01(\x0b\x32\x1b.controller.HostedRunStatusH\x00\x88\x01\x01\x12\x12\n\x04logs\x18\x03 \x03(\x0b\x32\x04.Log\x12,\n\x0creturn_value\x18\x04 \x01(\x0b\x32\x11.SerializedObjectH\x01\x88\x01\x01\x42\t\n\x07_statusB\x0f\n\r_return_value"\x80\x01\n\x0fHostedRunStatus\x12\x30\n\x05state\x18\x01 \x01(\x0e\x32!.controller.HostedRunStatus.State";\n\x05State\x12\x0f\n\x0bIN_PROGRESS\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x14\n\x10INTERNAL_FAILURE\x10\x02"\x82\x03\n\x13MachineRequirements\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12\x17\n\nkeep_alive\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nbase_image\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x65xposed_port\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tscheduler\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x37\n\x11scheduler_options\x18\x08 \x01(\x0b\x32\x17.google.protobuf.StructH\x04\x88\x01\x01\x12\x1d\n\x10max_multiplexing\x18\x06 \x01(\x05H\x05\x88\x01\x01\x12\x1c\n\x0fmax_concurrency\x18\t \x01(\x05H\x06\x88\x01\x01\x42\r\n\x0b_keep_aliveB\r\n\x0b_base_imageB\x0f\n\r_exposed_portB\x0c\n\n_schedulerB\x14\n\x12_scheduler_optionsB\x13\n\x11_max_multiplexingB\x12\n\x10_max_concurrency"\xf5\x03\n\x1aRegisterApplicationRequest\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12\x42\n\x14machine_requirements\x18\x02 \x01(\x0b\x32\x1f.controller.MachineRequirementsH\x00\x88\x01\x01\x12#\n\x08\x66unction\x18\x03 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x04 \x01(\x0b\x32\x11.SerializedObjectH\x01\x88\x01\x01\x12\x1d\n\x10\x61pplication_name\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x37\n\tauth_mode\x18\x06 \x01(\x0e\x32\x1f.controller.ApplicationAuthModeH\x03\x88\x01\x01\x12 \n\x0fmax_concurrency\x18\x07 \x01(\x05\x42\x02\x18\x01H\x04\x88\x01\x01\x12.\n\x08metadata\x18\x08 \x01(\x0b\x32\x17.google.protobuf.StructH\x05\x88\x01\x01\x42\x17\n\x15_machine_requirementsB\r\n\x0b_setup_funcB\x13\n\x11_application_nameB\x0c\n\n_auth_modeB\x12\n\x10_max_concurrencyB\x0b\n\t_metadata"7\n\x1dRegisterApplicationResultType\x12\x16\n\x0e\x61pplication_id\x18\x01 \x01(\t"z\n\x19RegisterApplicationResult\x12\x12\n\x04logs\x18\x01 \x03(\x0b\x32\x04.Log\x12>\n\x06result\x18\x02 \x01(\x0b\x32).controller.RegisterApplicationResultTypeH\x00\x88\x01\x01\x42\t\n\x07_result"\xc2\x01\n\x18UpdateApplicationRequest\x12\x18\n\x10\x61pplication_name\x18\x01 \x01(\t\x12\x17\n\nkeep_alive\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10max_multiplexing\x18\x03 \x01(\x05H\x01\x88\x01\x01\x12\x1c\n\x0fmax_concurrency\x18\x04 \x01(\x05H\x02\x88\x01\x01\x42\r\n\x0b_keep_aliveB\x13\n\x11_max_multiplexingB\x12\n\x10_max_concurrency"D\n\x17UpdateApplicationResult\x12)\n\nalias_info\x18\x01 \x01(\x0b\x32\x15.controller.AliasInfo"f\n\x0fSetAliasRequest\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\t\x12\x32\n\tauth_mode\x18\x03 \x01(\x0e\x32\x1f.controller.ApplicationAuthMode"\x10\n\x0eSetAliasResult"#\n\x12\x44\x65leteAliasRequest\x12\r\n\x05\x61lias\x18\x01 \x01(\t"%\n\x11\x44\x65leteAliasResult\x12\x10\n\x08revision\x18\x01 \x01(\t"\x14\n\x12ListAliasesRequest";\n\x11ListAliasesResult\x12&\n\x07\x61liases\x18\x01 \x03(\x0b\x32\x15.controller.AliasInfo"\xbf\x01\n\tAliasInfo\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\t\x12\x32\n\tauth_mode\x18\x03 \x01(\x0e\x32\x1f.controller.ApplicationAuthMode\x12\x17\n\x0fmax_concurrency\x18\x04 \x01(\x05\x12\x18\n\x10max_multiplexing\x18\x05 \x01(\x05\x12\x12\n\nkeep_alive\x18\x06 \x01(\x05\x12\x16\n\x0e\x61\x63tive_runners\x18\x07 \x01(\x05">\n\x10SetSecretRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value"\x13\n\x11SetSecretResponse"\x14\n\x12ListSecretsRequest"^\n\x06Secret\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\x0c\x63reated_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x42\x0f\n\r_created_time":\n\x13ListSecretsResponse\x12#\n\x07secrets\x18\x01 \x03(\x0b\x32\x12.controller.Secret"(\n\x17ListAliasRunnersRequest\x12\r\n\x05\x61lias\x18\x01 \x01(\t"C\n\x18ListAliasRunnersResponse\x12\'\n\x07runners\x18\x01 \x03(\x0b\x32\x16.controller.RunnerInfo"Y\n\nRunnerInfo\x12\x11\n\trunner_id\x18\x01 \x01(\t\x12\x1a\n\x12in_flight_requests\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xpiration_countdown\x18\x03 \x01(\x05*:\n\x13\x41pplicationAuthMode\x12\x0b\n\x07PRIVATE\x10\x00\x12\n\n\x06PUBLIC\x10\x01\x12\n\n\x06SHARED\x10\x02\x32\xc8\x08\n\x11IsolateController\x12=\n\x03Run\x12\x15.controller.HostedRun\x1a\x1b.controller.HostedRunResult"\x00\x30\x01\x12=\n\x03Map\x12\x15.controller.HostedMap\x1a\x1b.controller.HostedRunResult"\x00\x30\x01\x12V\n\rCreateUserKey\x12 .controller.CreateUserKeyRequest\x1a!.controller.CreateUserKeyResponse"\x00\x12S\n\x0cListUserKeys\x12\x1f.controller.ListUserKeysRequest\x1a .controller.ListUserKeysResponse"\x00\x12V\n\rRevokeUserKey\x12 .controller.RevokeUserKeyRequest\x1a!.controller.RevokeUserKeyResponse"\x00\x12h\n\x13RegisterApplication\x12&.controller.RegisterApplicationRequest\x1a%.controller.RegisterApplicationResult"\x00\x30\x01\x12`\n\x11UpdateApplication\x12$.controller.UpdateApplicationRequest\x1a#.controller.UpdateApplicationResult"\x00\x12\x45\n\x08SetAlias\x12\x1b.controller.SetAliasRequest\x1a\x1a.controller.SetAliasResult"\x00\x12N\n\x0b\x44\x65leteAlias\x12\x1e.controller.DeleteAliasRequest\x1a\x1d.controller.DeleteAliasResult"\x00\x12N\n\x0bListAliases\x12\x1e.controller.ListAliasesRequest\x1a\x1d.controller.ListAliasesResult"\x00\x12J\n\tSetSecret\x12\x1c.controller.SetSecretRequest\x1a\x1d.controller.SetSecretResponse"\x00\x12P\n\x0bListSecrets\x12\x1e.controller.ListSecretsRequest\x1a\x1f.controller.ListSecretsResponse"\x00\x12_\n\x10ListAliasRunners\x12#.controller.ListAliasRunnersRequest\x1a$.controller.ListAliasRunnersResponse"\x00\x62\x06proto3' + b'\n\x10\x63ontroller.proto\x12\ncontroller\x1a\x0c\x63ommon.proto\x1a\x0cserver.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto"\xde\x01\n\tHostedMap\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12\x42\n\x14machine_requirements\x18\x02 \x01(\x0b\x32\x1f.controller.MachineRequirementsH\x00\x88\x01\x01\x12#\n\x08\x66unction\x18\x03 \x01(\x0b\x32\x11.SerializedObject\x12!\n\x06inputs\x18\x04 \x03(\x0b\x32\x11.SerializedObjectB\x17\n\x15_machine_requirements"\xf6\x01\n\tHostedRun\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12\x42\n\x14machine_requirements\x18\x02 \x01(\x0b\x32\x1f.controller.MachineRequirementsH\x00\x88\x01\x01\x12#\n\x08\x66unction\x18\x03 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x04 \x01(\x0b\x32\x11.SerializedObjectH\x01\x88\x01\x01\x42\x17\n\x15_machine_requirementsB\r\n\x0b_setup_func"\x88\x01\n\x14\x43reateUserKeyRequest\x12\x35\n\x05scope\x18\x01 \x01(\x0e\x32&.controller.CreateUserKeyRequest.Scope\x12\x12\n\x05\x61lias\x18\x02 \x01(\tH\x00\x88\x01\x01"\x1b\n\x05Scope\x12\t\n\x05\x41\x44MIN\x10\x00\x12\x07\n\x03\x41PI\x10\x01\x42\x08\n\x06_alias";\n\x15\x43reateUserKeyResponse\x12\x12\n\nkey_secret\x18\x01 \x01(\t\x12\x0e\n\x06key_id\x18\x02 \x01(\t"\x15\n\x13ListUserKeysRequest"B\n\x14ListUserKeysResponse\x12*\n\tuser_keys\x18\x01 \x03(\x0b\x32\x17.controller.UserKeyInfo"&\n\x14RevokeUserKeyRequest\x12\x0e\n\x06key_id\x18\x01 \x01(\t"\x17\n\x15RevokeUserKeyResponse"\x93\x01\n\x0bUserKeyInfo\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x35\n\x05scope\x18\x03 \x01(\x0e\x32&.controller.CreateUserKeyRequest.Scope\x12\r\n\x05\x61lias\x18\x04 \x01(\t"\xb1\x01\n\x0fHostedRunResult\x12\x0e\n\x06run_id\x18\x01 \x01(\t\x12\x30\n\x06status\x18\x02 \x01(\x0b\x32\x1b.controller.HostedRunStatusH\x00\x88\x01\x01\x12\x12\n\x04logs\x18\x03 \x03(\x0b\x32\x04.Log\x12,\n\x0creturn_value\x18\x04 \x01(\x0b\x32\x11.SerializedObjectH\x01\x88\x01\x01\x42\t\n\x07_statusB\x0f\n\r_return_value"\x80\x01\n\x0fHostedRunStatus\x12\x30\n\x05state\x18\x01 \x01(\x0e\x32!.controller.HostedRunStatus.State";\n\x05State\x12\x0f\n\x0bIN_PROGRESS\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\x14\n\x10INTERNAL_FAILURE\x10\x02"\xb4\x03\n\x13MachineRequirements\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12\x17\n\nkeep_alive\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nbase_image\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x65xposed_port\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tscheduler\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x37\n\x11scheduler_options\x18\x08 \x01(\x0b\x32\x17.google.protobuf.StructH\x04\x88\x01\x01\x12\x1d\n\x10max_multiplexing\x18\x06 \x01(\x05H\x05\x88\x01\x01\x12\x1c\n\x0fmax_concurrency\x18\t \x01(\x05H\x06\x88\x01\x01\x12\x1c\n\x0fmin_concurrency\x18\n \x01(\x05H\x07\x88\x01\x01\x42\r\n\x0b_keep_aliveB\r\n\x0b_base_imageB\x0f\n\r_exposed_portB\x0c\n\n_schedulerB\x14\n\x12_scheduler_optionsB\x13\n\x11_max_multiplexingB\x12\n\x10_max_concurrencyB\x12\n\x10_min_concurrency"\xf5\x03\n\x1aRegisterApplicationRequest\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12\x42\n\x14machine_requirements\x18\x02 \x01(\x0b\x32\x1f.controller.MachineRequirementsH\x00\x88\x01\x01\x12#\n\x08\x66unction\x18\x03 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x04 \x01(\x0b\x32\x11.SerializedObjectH\x01\x88\x01\x01\x12\x1d\n\x10\x61pplication_name\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x37\n\tauth_mode\x18\x06 \x01(\x0e\x32\x1f.controller.ApplicationAuthModeH\x03\x88\x01\x01\x12 \n\x0fmax_concurrency\x18\x07 \x01(\x05\x42\x02\x18\x01H\x04\x88\x01\x01\x12.\n\x08metadata\x18\x08 \x01(\x0b\x32\x17.google.protobuf.StructH\x05\x88\x01\x01\x42\x17\n\x15_machine_requirementsB\r\n\x0b_setup_funcB\x13\n\x11_application_nameB\x0c\n\n_auth_modeB\x12\n\x10_max_concurrencyB\x0b\n\t_metadata"7\n\x1dRegisterApplicationResultType\x12\x16\n\x0e\x61pplication_id\x18\x01 \x01(\t"z\n\x19RegisterApplicationResult\x12\x12\n\x04logs\x18\x01 \x03(\x0b\x32\x04.Log\x12>\n\x06result\x18\x02 \x01(\x0b\x32).controller.RegisterApplicationResultTypeH\x00\x88\x01\x01\x42\t\n\x07_result"\xf4\x01\n\x18UpdateApplicationRequest\x12\x18\n\x10\x61pplication_name\x18\x01 \x01(\t\x12\x17\n\nkeep_alive\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x1d\n\x10max_multiplexing\x18\x03 \x01(\x05H\x01\x88\x01\x01\x12\x1c\n\x0fmax_concurrency\x18\x04 \x01(\x05H\x02\x88\x01\x01\x12\x1c\n\x0fmin_concurrency\x18\x05 \x01(\x05H\x03\x88\x01\x01\x42\r\n\x0b_keep_aliveB\x13\n\x11_max_multiplexingB\x12\n\x10_max_concurrencyB\x12\n\x10_min_concurrency"D\n\x17UpdateApplicationResult\x12)\n\nalias_info\x18\x01 \x01(\x0b\x32\x15.controller.AliasInfo"f\n\x0fSetAliasRequest\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\t\x12\x32\n\tauth_mode\x18\x03 \x01(\x0e\x32\x1f.controller.ApplicationAuthMode"\x10\n\x0eSetAliasResult"#\n\x12\x44\x65leteAliasRequest\x12\r\n\x05\x61lias\x18\x01 \x01(\t"%\n\x11\x44\x65leteAliasResult\x12\x10\n\x08revision\x18\x01 \x01(\t"\x14\n\x12ListAliasesRequest";\n\x11ListAliasesResult\x12&\n\x07\x61liases\x18\x01 \x03(\x0b\x32\x15.controller.AliasInfo"\xd8\x01\n\tAliasInfo\x12\r\n\x05\x61lias\x18\x01 \x01(\t\x12\x10\n\x08revision\x18\x02 \x01(\t\x12\x32\n\tauth_mode\x18\x03 \x01(\x0e\x32\x1f.controller.ApplicationAuthMode\x12\x17\n\x0fmax_concurrency\x18\x04 \x01(\x05\x12\x18\n\x10max_multiplexing\x18\x05 \x01(\x05\x12\x12\n\nkeep_alive\x18\x06 \x01(\x05\x12\x16\n\x0e\x61\x63tive_runners\x18\x07 \x01(\x05\x12\x17\n\x0fmin_concurrency\x18\x08 \x01(\x05">\n\x10SetSecretRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_value"\x13\n\x11SetSecretResponse"\x14\n\x12ListSecretsRequest"^\n\x06Secret\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\x0c\x63reated_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x42\x0f\n\r_created_time":\n\x13ListSecretsResponse\x12#\n\x07secrets\x18\x01 \x03(\x0b\x32\x12.controller.Secret"(\n\x17ListAliasRunnersRequest\x12\r\n\x05\x61lias\x18\x01 \x01(\t"C\n\x18ListAliasRunnersResponse\x12\'\n\x07runners\x18\x01 \x03(\x0b\x32\x16.controller.RunnerInfo"Y\n\nRunnerInfo\x12\x11\n\trunner_id\x18\x01 \x01(\t\x12\x1a\n\x12in_flight_requests\x18\x02 \x01(\x05\x12\x1c\n\x14\x65xpiration_countdown\x18\x03 \x01(\x05*:\n\x13\x41pplicationAuthMode\x12\x0b\n\x07PRIVATE\x10\x00\x12\n\n\x06PUBLIC\x10\x01\x12\n\n\x06SHARED\x10\x02\x32\xc8\x08\n\x11IsolateController\x12=\n\x03Run\x12\x15.controller.HostedRun\x1a\x1b.controller.HostedRunResult"\x00\x30\x01\x12=\n\x03Map\x12\x15.controller.HostedMap\x1a\x1b.controller.HostedRunResult"\x00\x30\x01\x12V\n\rCreateUserKey\x12 .controller.CreateUserKeyRequest\x1a!.controller.CreateUserKeyResponse"\x00\x12S\n\x0cListUserKeys\x12\x1f.controller.ListUserKeysRequest\x1a .controller.ListUserKeysResponse"\x00\x12V\n\rRevokeUserKey\x12 .controller.RevokeUserKeyRequest\x1a!.controller.RevokeUserKeyResponse"\x00\x12h\n\x13RegisterApplication\x12&.controller.RegisterApplicationRequest\x1a%.controller.RegisterApplicationResult"\x00\x30\x01\x12`\n\x11UpdateApplication\x12$.controller.UpdateApplicationRequest\x1a#.controller.UpdateApplicationResult"\x00\x12\x45\n\x08SetAlias\x12\x1b.controller.SetAliasRequest\x1a\x1a.controller.SetAliasResult"\x00\x12N\n\x0b\x44\x65leteAlias\x12\x1e.controller.DeleteAliasRequest\x1a\x1d.controller.DeleteAliasResult"\x00\x12N\n\x0bListAliases\x12\x1e.controller.ListAliasesRequest\x1a\x1d.controller.ListAliasesResult"\x00\x12J\n\tSetSecret\x12\x1c.controller.SetSecretRequest\x1a\x1d.controller.SetSecretResponse"\x00\x12P\n\x0bListSecrets\x12\x1e.controller.ListSecretsRequest\x1a\x1f.controller.ListSecretsResponse"\x00\x12_\n\x10ListAliasRunners\x12#.controller.ListAliasRunnersRequest\x1a$.controller.ListAliasRunnersResponse"\x00\x62\x06proto3' ) _globals = globals() @@ -33,8 +33,8 @@ _REGISTERAPPLICATIONREQUEST.fields_by_name[ "max_concurrency" ]._serialized_options = b"\030\001" - _globals["_APPLICATIONAUTHMODE"]._serialized_start = 3727 - _globals["_APPLICATIONAUTHMODE"]._serialized_end = 3785 + _globals["_APPLICATIONAUTHMODE"]._serialized_start = 3852 + _globals["_APPLICATIONAUTHMODE"]._serialized_end = 3910 _globals["_HOSTEDMAP"]._serialized_start = 156 _globals["_HOSTEDMAP"]._serialized_end = 378 _globals["_HOSTEDRUN"]._serialized_start = 381 @@ -62,47 +62,47 @@ _globals["_HOSTEDRUNSTATUS_STATE"]._serialized_start = 1385 _globals["_HOSTEDRUNSTATUS_STATE"]._serialized_end = 1444 _globals["_MACHINEREQUIREMENTS"]._serialized_start = 1447 - _globals["_MACHINEREQUIREMENTS"]._serialized_end = 1833 - _globals["_REGISTERAPPLICATIONREQUEST"]._serialized_start = 1836 - _globals["_REGISTERAPPLICATIONREQUEST"]._serialized_end = 2337 - _globals["_REGISTERAPPLICATIONRESULTTYPE"]._serialized_start = 2339 - _globals["_REGISTERAPPLICATIONRESULTTYPE"]._serialized_end = 2394 - _globals["_REGISTERAPPLICATIONRESULT"]._serialized_start = 2396 - _globals["_REGISTERAPPLICATIONRESULT"]._serialized_end = 2518 - _globals["_UPDATEAPPLICATIONREQUEST"]._serialized_start = 2521 - _globals["_UPDATEAPPLICATIONREQUEST"]._serialized_end = 2715 - _globals["_UPDATEAPPLICATIONRESULT"]._serialized_start = 2717 - _globals["_UPDATEAPPLICATIONRESULT"]._serialized_end = 2785 - _globals["_SETALIASREQUEST"]._serialized_start = 2787 - _globals["_SETALIASREQUEST"]._serialized_end = 2889 - _globals["_SETALIASRESULT"]._serialized_start = 2891 - _globals["_SETALIASRESULT"]._serialized_end = 2907 - _globals["_DELETEALIASREQUEST"]._serialized_start = 2909 - _globals["_DELETEALIASREQUEST"]._serialized_end = 2944 - _globals["_DELETEALIASRESULT"]._serialized_start = 2946 - _globals["_DELETEALIASRESULT"]._serialized_end = 2983 - _globals["_LISTALIASESREQUEST"]._serialized_start = 2985 - _globals["_LISTALIASESREQUEST"]._serialized_end = 3005 - _globals["_LISTALIASESRESULT"]._serialized_start = 3007 - _globals["_LISTALIASESRESULT"]._serialized_end = 3066 - _globals["_ALIASINFO"]._serialized_start = 3069 - _globals["_ALIASINFO"]._serialized_end = 3260 - _globals["_SETSECRETREQUEST"]._serialized_start = 3262 - _globals["_SETSECRETREQUEST"]._serialized_end = 3324 - _globals["_SETSECRETRESPONSE"]._serialized_start = 3326 - _globals["_SETSECRETRESPONSE"]._serialized_end = 3345 - _globals["_LISTSECRETSREQUEST"]._serialized_start = 3347 - _globals["_LISTSECRETSREQUEST"]._serialized_end = 3367 - _globals["_SECRET"]._serialized_start = 3369 - _globals["_SECRET"]._serialized_end = 3463 - _globals["_LISTSECRETSRESPONSE"]._serialized_start = 3465 - _globals["_LISTSECRETSRESPONSE"]._serialized_end = 3523 - _globals["_LISTALIASRUNNERSREQUEST"]._serialized_start = 3525 - _globals["_LISTALIASRUNNERSREQUEST"]._serialized_end = 3565 - _globals["_LISTALIASRUNNERSRESPONSE"]._serialized_start = 3567 - _globals["_LISTALIASRUNNERSRESPONSE"]._serialized_end = 3634 - _globals["_RUNNERINFO"]._serialized_start = 3636 - _globals["_RUNNERINFO"]._serialized_end = 3725 - _globals["_ISOLATECONTROLLER"]._serialized_start = 3788 - _globals["_ISOLATECONTROLLER"]._serialized_end = 4884 + _globals["_MACHINEREQUIREMENTS"]._serialized_end = 1883 + _globals["_REGISTERAPPLICATIONREQUEST"]._serialized_start = 1886 + _globals["_REGISTERAPPLICATIONREQUEST"]._serialized_end = 2387 + _globals["_REGISTERAPPLICATIONRESULTTYPE"]._serialized_start = 2389 + _globals["_REGISTERAPPLICATIONRESULTTYPE"]._serialized_end = 2444 + _globals["_REGISTERAPPLICATIONRESULT"]._serialized_start = 2446 + _globals["_REGISTERAPPLICATIONRESULT"]._serialized_end = 2568 + _globals["_UPDATEAPPLICATIONREQUEST"]._serialized_start = 2571 + _globals["_UPDATEAPPLICATIONREQUEST"]._serialized_end = 2815 + _globals["_UPDATEAPPLICATIONRESULT"]._serialized_start = 2817 + _globals["_UPDATEAPPLICATIONRESULT"]._serialized_end = 2885 + _globals["_SETALIASREQUEST"]._serialized_start = 2887 + _globals["_SETALIASREQUEST"]._serialized_end = 2989 + _globals["_SETALIASRESULT"]._serialized_start = 2991 + _globals["_SETALIASRESULT"]._serialized_end = 3007 + _globals["_DELETEALIASREQUEST"]._serialized_start = 3009 + _globals["_DELETEALIASREQUEST"]._serialized_end = 3044 + _globals["_DELETEALIASRESULT"]._serialized_start = 3046 + _globals["_DELETEALIASRESULT"]._serialized_end = 3083 + _globals["_LISTALIASESREQUEST"]._serialized_start = 3085 + _globals["_LISTALIASESREQUEST"]._serialized_end = 3105 + _globals["_LISTALIASESRESULT"]._serialized_start = 3107 + _globals["_LISTALIASESRESULT"]._serialized_end = 3166 + _globals["_ALIASINFO"]._serialized_start = 3169 + _globals["_ALIASINFO"]._serialized_end = 3385 + _globals["_SETSECRETREQUEST"]._serialized_start = 3387 + _globals["_SETSECRETREQUEST"]._serialized_end = 3449 + _globals["_SETSECRETRESPONSE"]._serialized_start = 3451 + _globals["_SETSECRETRESPONSE"]._serialized_end = 3470 + _globals["_LISTSECRETSREQUEST"]._serialized_start = 3472 + _globals["_LISTSECRETSREQUEST"]._serialized_end = 3492 + _globals["_SECRET"]._serialized_start = 3494 + _globals["_SECRET"]._serialized_end = 3588 + _globals["_LISTSECRETSRESPONSE"]._serialized_start = 3590 + _globals["_LISTSECRETSRESPONSE"]._serialized_end = 3648 + _globals["_LISTALIASRUNNERSREQUEST"]._serialized_start = 3650 + _globals["_LISTALIASRUNNERSREQUEST"]._serialized_end = 3690 + _globals["_LISTALIASRUNNERSRESPONSE"]._serialized_start = 3692 + _globals["_LISTALIASRUNNERSRESPONSE"]._serialized_end = 3759 + _globals["_RUNNERINFO"]._serialized_start = 3761 + _globals["_RUNNERINFO"]._serialized_end = 3850 + _globals["_ISOLATECONTROLLER"]._serialized_start = 3913 + _globals["_ISOLATECONTROLLER"]._serialized_end = 5009 # @@protoc_insertion_point(module_scope) diff --git a/projects/isolate_proto/src/isolate_proto/controller_pb2.pyi b/projects/isolate_proto/src/isolate_proto/controller_pb2.pyi index f17211c3..320d63d2 100644 --- a/projects/isolate_proto/src/isolate_proto/controller_pb2.pyi +++ b/projects/isolate_proto/src/isolate_proto/controller_pb2.pyi @@ -509,6 +509,7 @@ class MachineRequirements(google.protobuf.message.Message): SCHEDULER_OPTIONS_FIELD_NUMBER: builtins.int MAX_MULTIPLEXING_FIELD_NUMBER: builtins.int MAX_CONCURRENCY_FIELD_NUMBER: builtins.int + MIN_CONCURRENCY_FIELD_NUMBER: builtins.int machine_type: builtins.str """Machine type. It is not an enum because we want to be able to dynamically add new machine types without regenerating @@ -523,6 +524,7 @@ class MachineRequirements(google.protobuf.message.Message): def scheduler_options(self) -> google.protobuf.struct_pb2.Struct: ... max_multiplexing: builtins.int max_concurrency: builtins.int + min_concurrency: builtins.int def __init__( self, *, @@ -534,6 +536,7 @@ class MachineRequirements(google.protobuf.message.Message): scheduler_options: google.protobuf.struct_pb2.Struct | None = ..., max_multiplexing: builtins.int | None = ..., max_concurrency: builtins.int | None = ..., + min_concurrency: builtins.int | None = ..., ) -> None: ... def HasField( self, @@ -548,6 +551,8 @@ class MachineRequirements(google.protobuf.message.Message): b"_max_concurrency", "_max_multiplexing", b"_max_multiplexing", + "_min_concurrency", + b"_min_concurrency", "_scheduler", b"_scheduler", "_scheduler_options", @@ -562,6 +567,8 @@ class MachineRequirements(google.protobuf.message.Message): b"max_concurrency", "max_multiplexing", b"max_multiplexing", + "min_concurrency", + b"min_concurrency", "scheduler", b"scheduler", "scheduler_options", @@ -581,6 +588,8 @@ class MachineRequirements(google.protobuf.message.Message): b"_max_concurrency", "_max_multiplexing", b"_max_multiplexing", + "_min_concurrency", + b"_min_concurrency", "_scheduler", b"_scheduler", "_scheduler_options", @@ -597,6 +606,8 @@ class MachineRequirements(google.protobuf.message.Message): b"max_concurrency", "max_multiplexing", b"max_multiplexing", + "min_concurrency", + b"min_concurrency", "scheduler", b"scheduler", "scheduler_options", @@ -628,6 +639,11 @@ class MachineRequirements(google.protobuf.message.Message): ], ) -> typing_extensions.Literal["max_multiplexing"] | None: ... @typing.overload + def WhichOneof( + self, + oneof_group: typing_extensions.Literal["_min_concurrency", b"_min_concurrency"], + ) -> typing_extensions.Literal["min_concurrency"] | None: ... + @typing.overload def WhichOneof( self, oneof_group: typing_extensions.Literal["_scheduler", b"_scheduler"] ) -> typing_extensions.Literal["scheduler"] | None: ... @@ -852,10 +868,12 @@ class UpdateApplicationRequest(google.protobuf.message.Message): KEEP_ALIVE_FIELD_NUMBER: builtins.int MAX_MULTIPLEXING_FIELD_NUMBER: builtins.int MAX_CONCURRENCY_FIELD_NUMBER: builtins.int + MIN_CONCURRENCY_FIELD_NUMBER: builtins.int application_name: builtins.str keep_alive: builtins.int max_multiplexing: builtins.int max_concurrency: builtins.int + min_concurrency: builtins.int def __init__( self, *, @@ -863,6 +881,7 @@ class UpdateApplicationRequest(google.protobuf.message.Message): keep_alive: builtins.int | None = ..., max_multiplexing: builtins.int | None = ..., max_concurrency: builtins.int | None = ..., + min_concurrency: builtins.int | None = ..., ) -> None: ... def HasField( self, @@ -873,12 +892,16 @@ class UpdateApplicationRequest(google.protobuf.message.Message): b"_max_concurrency", "_max_multiplexing", b"_max_multiplexing", + "_min_concurrency", + b"_min_concurrency", "keep_alive", b"keep_alive", "max_concurrency", b"max_concurrency", "max_multiplexing", b"max_multiplexing", + "min_concurrency", + b"min_concurrency", ], ) -> builtins.bool: ... def ClearField( @@ -890,6 +913,8 @@ class UpdateApplicationRequest(google.protobuf.message.Message): b"_max_concurrency", "_max_multiplexing", b"_max_multiplexing", + "_min_concurrency", + b"_min_concurrency", "application_name", b"application_name", "keep_alive", @@ -898,6 +923,8 @@ class UpdateApplicationRequest(google.protobuf.message.Message): b"max_concurrency", "max_multiplexing", b"max_multiplexing", + "min_concurrency", + b"min_concurrency", ], ) -> None: ... @typing.overload @@ -916,6 +943,11 @@ class UpdateApplicationRequest(google.protobuf.message.Message): "_max_multiplexing", b"_max_multiplexing" ], ) -> typing_extensions.Literal["max_multiplexing"] | None: ... + @typing.overload + def WhichOneof( + self, + oneof_group: typing_extensions.Literal["_min_concurrency", b"_min_concurrency"], + ) -> typing_extensions.Literal["min_concurrency"] | None: ... global___UpdateApplicationRequest = UpdateApplicationRequest @@ -1057,6 +1089,7 @@ class AliasInfo(google.protobuf.message.Message): MAX_MULTIPLEXING_FIELD_NUMBER: builtins.int KEEP_ALIVE_FIELD_NUMBER: builtins.int ACTIVE_RUNNERS_FIELD_NUMBER: builtins.int + MIN_CONCURRENCY_FIELD_NUMBER: builtins.int alias: builtins.str revision: builtins.str auth_mode: global___ApplicationAuthMode.ValueType @@ -1064,6 +1097,7 @@ class AliasInfo(google.protobuf.message.Message): max_multiplexing: builtins.int keep_alive: builtins.int active_runners: builtins.int + min_concurrency: builtins.int def __init__( self, *, @@ -1074,6 +1108,7 @@ class AliasInfo(google.protobuf.message.Message): max_multiplexing: builtins.int = ..., keep_alive: builtins.int = ..., active_runners: builtins.int = ..., + min_concurrency: builtins.int = ..., ) -> None: ... def ClearField( self, @@ -1090,6 +1125,8 @@ class AliasInfo(google.protobuf.message.Message): b"max_concurrency", "max_multiplexing", b"max_multiplexing", + "min_concurrency", + b"min_concurrency", "revision", b"revision", ],