isolate 0.14.3__tar.gz → 0.16.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of isolate might be problematic. Click here for more details.

Files changed (88) hide show
  1. {isolate-0.14.3 → isolate-0.16.0}/.github/workflows/test.yml +1 -1
  2. {isolate-0.14.3 → isolate-0.16.0}/.pre-commit-config.yaml +4 -1
  3. {isolate-0.14.3 → isolate-0.16.0}/PKG-INFO +2 -3
  4. {isolate-0.14.3 → isolate-0.16.0}/pyproject.toml +4 -1
  5. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/_isolate_version.py +2 -2
  6. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/remote.py +1 -0
  7. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/settings.py +32 -2
  8. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/_local/_base.py +3 -1
  9. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/_base.py +3 -1
  10. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/agent_pb2.py +3 -3
  11. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/agent_pb2_grpc.py +4 -40
  12. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/common_pb2.py +3 -3
  13. isolate-0.16.0/src/isolate/connections/grpc/definitions/common_pb2_grpc.py +4 -0
  14. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/ipc/_base.py +3 -1
  15. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/logger.py +0 -3
  16. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/definitions/server.proto +1 -0
  17. isolate-0.16.0/src/isolate/server/definitions/server_pb2.py +56 -0
  18. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/definitions/server_pb2.pyi +4 -1
  19. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/definitions/server_pb2_grpc.py +20 -96
  20. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/health/health_pb2.py +3 -3
  21. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/health/health_pb2_grpc.py +8 -54
  22. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/server.py +22 -17
  23. {isolate-0.14.3 → isolate-0.16.0}/src/isolate.egg-info/PKG-INFO +2 -3
  24. {isolate-0.14.3 → isolate-0.16.0}/src/isolate.egg-info/requires.txt +0 -1
  25. {isolate-0.14.3 → isolate-0.16.0}/tests/test_backends.py +41 -0
  26. {isolate-0.14.3 → isolate-0.16.0}/tests/test_server.py +48 -5
  27. isolate-0.14.3/src/isolate/connections/grpc/definitions/common_pb2_grpc.py +0 -29
  28. isolate-0.14.3/src/isolate/server/definitions/server_pb2.py +0 -56
  29. {isolate-0.14.3 → isolate-0.16.0}/.github/workflows/release.yml +0 -0
  30. {isolate-0.14.3 → isolate-0.16.0}/.gitignore +0 -0
  31. {isolate-0.14.3 → isolate-0.16.0}/LICENSE +0 -0
  32. {isolate-0.14.3 → isolate-0.16.0}/README.md +0 -0
  33. {isolate-0.14.3 → isolate-0.16.0}/setup.cfg +0 -0
  34. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/__init__.py +0 -0
  35. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/_version.py +0 -0
  36. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/__init__.py +0 -0
  37. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/_base.py +0 -0
  38. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/common.py +0 -0
  39. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/conda.py +0 -0
  40. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/container.py +0 -0
  41. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/local.py +0 -0
  42. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/pyenv.py +0 -0
  43. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/backends/virtualenv.py +0 -0
  44. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/common/__init__.py +0 -0
  45. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/common/timestamp.py +0 -0
  46. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/__init__.py +0 -0
  47. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/_local/__init__.py +0 -0
  48. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/_local/agent_startup.py +0 -0
  49. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/common.py +0 -0
  50. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/__init__.py +0 -0
  51. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/agent.py +0 -0
  52. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/configuration.py +0 -0
  53. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/__init__.py +0 -0
  54. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/agent.proto +0 -0
  55. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/agent_pb2.pyi +0 -0
  56. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/common.proto +0 -0
  57. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/definitions/common_pb2.pyi +0 -0
  58. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/grpc/interface.py +0 -0
  59. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/ipc/__init__.py +0 -0
  60. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/connections/ipc/agent.py +0 -0
  61. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/logs.py +0 -0
  62. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/py.typed +0 -0
  63. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/registry.py +0 -0
  64. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/__init__.py +0 -0
  65. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/definitions/__init__.py +0 -0
  66. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/health/__init__.py +0 -0
  67. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/health/health.proto +0 -0
  68. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/health/health_pb2.pyi +0 -0
  69. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/health_server.py +0 -0
  70. {isolate-0.14.3 → isolate-0.16.0}/src/isolate/server/interface.py +0 -0
  71. {isolate-0.14.3 → isolate-0.16.0}/src/isolate.egg-info/SOURCES.txt +0 -0
  72. {isolate-0.14.3 → isolate-0.16.0}/src/isolate.egg-info/dependency_links.txt +0 -0
  73. {isolate-0.14.3 → isolate-0.16.0}/src/isolate.egg-info/entry_points.txt +0 -0
  74. {isolate-0.14.3 → isolate-0.16.0}/src/isolate.egg-info/top_level.txt +0 -0
  75. {isolate-0.14.3 → isolate-0.16.0}/tests/__init__.py +0 -0
  76. {isolate-0.14.3 → isolate-0.16.0}/tests/conftest.py +0 -0
  77. {isolate-0.14.3 → isolate-0.16.0}/tests/test_concurrency.py +0 -0
  78. {isolate-0.14.3 → isolate-0.16.0}/tests/test_connections.py +0 -0
  79. {isolate-0.14.3 → isolate-0.16.0}/tests/test_isolate.py +0 -0
  80. {isolate-0.14.3 → isolate-0.16.0}/tests/test_log.py +0 -0
  81. {isolate-0.14.3 → isolate-0.16.0}/tests/test_logger.py +0 -0
  82. {isolate-0.14.3 → isolate-0.16.0}/tests/test_serialization.py +0 -0
  83. {isolate-0.14.3 → isolate-0.16.0}/tools/Dockerfile +0 -0
  84. {isolate-0.14.3 → isolate-0.16.0}/tools/agent_requirements.txt +0 -0
  85. {isolate-0.14.3 → isolate-0.16.0}/tools/protobuf-requirements.txt +0 -0
  86. {isolate-0.14.3 → isolate-0.16.0}/tools/regen_grpc.py +0 -0
  87. {isolate-0.14.3 → isolate-0.16.0}/tools/requirements.txt +0 -0
  88. {isolate-0.14.3 → isolate-0.16.0}/tools/test_agent_requirements.txt +0 -0
@@ -17,7 +17,7 @@ jobs:
17
17
  test:
18
18
  runs-on: ${{ matrix.os }}
19
19
  strategy:
20
- fail-fast: true
20
+ fail-fast: false
21
21
 
22
22
  matrix:
23
23
  os: [ubuntu-latest]
@@ -3,7 +3,10 @@ repos:
3
3
  rev: 'v0.3.4'
4
4
  hooks:
5
5
  - id: ruff
6
- args: [--fix, --exit-non-zero-on-fix]
6
+ args:
7
+ - --fix
8
+ - --exit-non-zero-on-fix
9
+ - --exclude=UP007
7
10
  exclude: ".*(_pb2.py|_pb2.pyi|_pb2_grpc.py)$"
8
11
  - id: ruff-format
9
12
  exclude: ".*(_pb2.py|_pb2.pyi|_pb2_grpc.py)$"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: isolate
3
- Version: 0.14.3
3
+ Version: 0.16.0
4
4
  Summary: Managed isolated environments for Python
5
5
  Author-email: Features & Labels <hello@fal.ai>
6
6
  Project-URL: Issues, https://github.com/fal-ai/isolate/issues
@@ -21,7 +21,6 @@ Requires-Dist: isolate[build]; extra == "test"
21
21
  Requires-Dist: pytest; extra == "test"
22
22
  Requires-Dist: cloudpickle>=2.2.0; extra == "test"
23
23
  Requires-Dist: dill>=0.3.5.1; extra == "test"
24
- Requires-Dist: pytest-rerunfailures; extra == "test"
25
24
  Provides-Extra: dev
26
25
  Requires-Dist: isolate[test]; extra == "dev"
27
26
  Requires-Dist: grpcio-tools==1.64.0; extra == "dev"
@@ -47,7 +47,6 @@ test = [
47
47
  "pytest",
48
48
  "cloudpickle>=2.2.0",
49
49
  "dill>=0.3.5.1",
50
- "pytest-rerunfailures",
51
50
  ]
52
51
  dev = [
53
52
  "isolate[test]",
@@ -67,5 +66,9 @@ dev = [
67
66
  target-version = "py38"
68
67
  exclude = ["*_pb2.py", "*_pb2.pyi", "*_pb2_grpc.py"]
69
68
 
69
+ [tool.ruff.lint.pyupgrade]
70
+ # Preserve types, even if a file imports `from __future__ import annotations`.
71
+ keep-runtime-typing = true
72
+
70
73
  [tool.ruff.lint]
71
74
  select = ["E", "F", "W", "PLC", "PLE", "PLW", "I", "UP"]
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.14.3'
16
- __version_tuple__ = version_tuple = (0, 14, 3)
15
+ __version__ = version = '0.16.0'
16
+ __version_tuple__ = version_tuple = (0, 16, 0)
@@ -115,6 +115,7 @@ class IsolateServerConnection(EnvironmentConnection):
115
115
  was_it_raised=False,
116
116
  ),
117
117
  environments=self.definitions,
118
+ stream_logs=True, # Default to streaming logs
118
119
  )
119
120
 
120
121
  return_value = []
@@ -11,7 +11,7 @@ from typing import TYPE_CHECKING, Callable, Iterator
11
11
  from platformdirs import user_cache_dir
12
12
 
13
13
  from isolate.backends.common import lock_build_path
14
- from isolate.logs import Log
14
+ from isolate.logs import Log, LogLevel, LogSource
15
15
 
16
16
  if TYPE_CHECKING:
17
17
  from isolate.backends import BaseEnvironment
@@ -28,7 +28,37 @@ class IsolateSettings:
28
28
  strict_cache: bool = _STRICT_CACHE
29
29
 
30
30
  def log(self, log: Log) -> None:
31
- self.log_hook(log)
31
+ self.log_hook(self._infer_log_level(log))
32
+
33
+ def _infer_log_level(self, log: Log) -> Log:
34
+ """Infer the log level if it's correctly set."""
35
+ if log.level not in (LogLevel.STDOUT, LogLevel.STDERR):
36
+ # We should only infer the log level for stdout/stderr logs.
37
+ return log
38
+
39
+ if log.source in (LogSource.BUILDER, LogSource.BRIDGE):
40
+ return replace(log, level=LogLevel.TRACE)
41
+
42
+ line = log.message.lower()
43
+
44
+ if "[error]" in line:
45
+ return replace(log, level=LogLevel.ERROR)
46
+ if "[warning]" in line:
47
+ return replace(log, level=LogLevel.WARNING)
48
+ if "[warn]" in line:
49
+ return replace(log, level=LogLevel.WARNING)
50
+ if "[info]" in line:
51
+ return replace(log, level=LogLevel.INFO)
52
+ if "[debug]" in line:
53
+ return replace(log, level=LogLevel.DEBUG)
54
+ if "[trace]" in line:
55
+ return replace(log, level=LogLevel.TRACE)
56
+
57
+ if log.level == LogLevel.STDERR:
58
+ return replace(log, level=LogLevel.ERROR)
59
+
60
+ # Default to INFO level
61
+ return replace(log, level=LogLevel.INFO)
32
62
 
33
63
  def _get_temp_base(self) -> Path:
34
64
  """Return the base path for creating temporary files/directories.
@@ -173,7 +173,9 @@ class PythonExecutionBase(Generic[ConnectionType]):
173
173
  """Return the command to run the agent process with."""
174
174
  raise NotImplementedError
175
175
 
176
- def handle_agent_log(self, line: str, level: LogLevel, source: LogSource) -> None:
176
+ def handle_agent_log(
177
+ self, line: str, *, level: LogLevel, source: LogSource
178
+ ) -> None:
177
179
  """Handle a log line emitted by the agent process. The level will be either
178
180
  STDOUT or STDERR."""
179
181
  raise NotImplementedError
@@ -147,5 +147,7 @@ class LocalPythonGRPC(PythonExecutionBase[str], GRPCExecutionBase):
147
147
  str(log_fd),
148
148
  ]
149
149
 
150
- def handle_agent_log(self, line: str, level: LogLevel, source: LogSource) -> None:
150
+ def handle_agent_log(
151
+ self, line: str, *, level: LogLevel, source: LogSource
152
+ ) -> None:
151
153
  self.log(line, level=level, source=source)
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: agent.proto
4
- # Protobuf Python Version: 5.26.1
4
+ # Protobuf Python Version: 4.25.1
5
5
  """Generated protocol buffer code."""
6
6
  from google.protobuf import descriptor as _descriptor
7
7
  from google.protobuf import descriptor_pool as _descriptor_pool
@@ -20,8 +20,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x61gent.proto
20
20
  _globals = globals()
21
21
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
22
22
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'agent_pb2', _globals)
23
- if not _descriptor._USE_C_DESCRIPTORS:
24
- DESCRIPTOR._loaded_options = None
23
+ if _descriptor._USE_C_DESCRIPTORS == False:
24
+ DESCRIPTOR._options = None
25
25
  _globals['_FUNCTIONCALL']._serialized_start=29
26
26
  _globals['_FUNCTIONCALL']._serialized_end=139
27
27
  _globals['_AGENT']._serialized_start=141
@@ -1,35 +1,10 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
2
  """Client and server classes corresponding to protobuf-defined services."""
3
3
  import grpc
4
- import warnings
5
4
 
6
5
  from isolate.connections.grpc.definitions import agent_pb2 as agent__pb2
7
6
  from isolate.connections.grpc.definitions import common_pb2 as common__pb2
8
7
 
9
- GRPC_GENERATED_VERSION = '1.64.0'
10
- GRPC_VERSION = grpc.__version__
11
- EXPECTED_ERROR_RELEASE = '1.65.0'
12
- SCHEDULED_RELEASE_DATE = 'June 25, 2024'
13
- _version_not_supported = False
14
-
15
- try:
16
- from grpc._utilities import first_version_is_lower
17
- _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
18
- except ImportError:
19
- _version_not_supported = True
20
-
21
- if _version_not_supported:
22
- warnings.warn(
23
- f'The grpc package installed is at version {GRPC_VERSION},'
24
- + f' but the generated code in agent_pb2_grpc.py depends on'
25
- + f' grpcio>={GRPC_GENERATED_VERSION}.'
26
- + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
27
- + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
28
- + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
29
- + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
30
- RuntimeWarning
31
- )
32
-
33
8
 
34
9
  class AgentStub(object):
35
10
  """Missing associated documentation comment in .proto file."""
@@ -44,7 +19,7 @@ class AgentStub(object):
44
19
  '/Agent/Run',
45
20
  request_serializer=agent__pb2.FunctionCall.SerializeToString,
46
21
  response_deserializer=common__pb2.PartialRunResult.FromString,
47
- _registered_method=True)
22
+ )
48
23
 
49
24
 
50
25
  class AgentServicer(object):
@@ -69,7 +44,6 @@ def add_AgentServicer_to_server(servicer, server):
69
44
  generic_handler = grpc.method_handlers_generic_handler(
70
45
  'Agent', rpc_method_handlers)
71
46
  server.add_generic_rpc_handlers((generic_handler,))
72
- server.add_registered_method_handlers('Agent', rpc_method_handlers)
73
47
 
74
48
 
75
49
  # This class is part of an EXPERIMENTAL API.
@@ -87,18 +61,8 @@ class Agent(object):
87
61
  wait_for_ready=None,
88
62
  timeout=None,
89
63
  metadata=None):
90
- return grpc.experimental.unary_stream(
91
- request,
92
- target,
93
- '/Agent/Run',
64
+ return grpc.experimental.unary_stream(request, target, '/Agent/Run',
94
65
  agent__pb2.FunctionCall.SerializeToString,
95
66
  common__pb2.PartialRunResult.FromString,
96
- options,
97
- channel_credentials,
98
- insecure,
99
- call_credentials,
100
- compression,
101
- wait_for_ready,
102
- timeout,
103
- metadata,
104
- _registered_method=True)
67
+ options, channel_credentials,
68
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: common.proto
4
- # Protobuf Python Version: 5.26.1
4
+ # Protobuf Python Version: 4.25.1
5
5
  """Generated protocol buffer code."""
6
6
  from google.protobuf import descriptor as _descriptor
7
7
  from google.protobuf import descriptor_pool as _descriptor_pool
@@ -20,8 +20,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63ommon.prot
20
20
  _globals = globals()
21
21
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
22
22
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'common_pb2', _globals)
23
- if not _descriptor._USE_C_DESCRIPTORS:
24
- DESCRIPTOR._loaded_options = None
23
+ if _descriptor._USE_C_DESCRIPTORS == False:
24
+ DESCRIPTOR._options = None
25
25
  _globals['_LOGSOURCE']._serialized_start=426
26
26
  _globals['_LOGSOURCE']._serialized_end=472
27
27
  _globals['_LOGLEVEL']._serialized_start=474
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+
@@ -219,5 +219,7 @@ class PythonIPC(PythonExecutionBase[AgentListener], IsolatedProcessConnection):
219
219
  str(log_fd),
220
220
  ]
221
221
 
222
- def handle_agent_log(self, line: str, level: LogLevel, source: LogSource) -> None:
222
+ def handle_agent_log(
223
+ self, line: str, *, level: LogLevel, source: LogSource
224
+ ) -> None:
223
225
  self.log(line, level=level, source=source)
@@ -51,6 +51,3 @@ class IsolateLogger:
51
51
  print("Failed to parse ISOLATE_LOG_LABELS")
52
52
 
53
53
  return cls.with_env_expanded(labels=_labels)
54
-
55
-
56
- ENV_LOGGER = IsolateLogger.from_env()
@@ -25,6 +25,7 @@ message BoundFunction {
25
25
  repeated EnvironmentDefinition environments = 1;
26
26
  SerializedObject function = 2;
27
27
  optional SerializedObject setup_func = 3;
28
+ bool stream_logs = 4;
28
29
  }
29
30
 
30
31
  message EnvironmentDefinition {
@@ -0,0 +1,56 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: server.proto
4
+ # Protobuf Python Version: 4.25.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+ from isolate.connections.grpc.definitions import common_pb2 as common__pb2
16
+ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
17
+
18
+
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cserver.proto\x1a\x0c\x63ommon.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xb2\x01\n\rBoundFunction\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12#\n\x08\x66unction\x18\x02 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x03 \x01(\x0b\x32\x11.SerializedObjectH\x00\x88\x01\x01\x12\x13\n\x0bstream_logs\x18\x04 \x01(\x08\x42\r\n\x0b_setup_func\"d\n\x15\x45nvironmentDefinition\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12.\n\rconfiguration\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"R\n\rSubmitRequest\x12 \n\x08\x66unction\x18\x01 \x01(\x0b\x32\x0e.BoundFunction\x12\x1f\n\x08metadata\x18\x02 \x01(\x0b\x32\r.TaskMetadata\"{\n\x0cTaskMetadata\x12\x36\n\rlogger_labels\x18\x01 \x03(\x0b\x32\x1f.TaskMetadata.LoggerLabelsEntry\x1a\x33\n\x11LoggerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"!\n\x0eSubmitResponse\x12\x0f\n\x07task_id\x18\x01 \x01(\t\"F\n\x12SetMetadataRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x1f\n\x08metadata\x18\x02 \x01(\x0b\x32\r.TaskMetadata\"\x15\n\x13SetMetadataResponse\"\r\n\x0bListRequest\"\x1b\n\x08TaskInfo\x12\x0f\n\x07task_id\x18\x01 \x01(\t\"(\n\x0cListResponse\x12\x18\n\x05tasks\x18\x01 \x03(\x0b\x32\t.TaskInfo\" \n\rCancelRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\"\x10\n\x0e\x43\x61ncelResponse2\xf4\x01\n\x07Isolate\x12,\n\x03Run\x12\x0e.BoundFunction\x1a\x11.PartialRunResult\"\x00\x30\x01\x12+\n\x06Submit\x12\x0e.SubmitRequest\x1a\x0f.SubmitResponse\"\x00\x12:\n\x0bSetMetadata\x12\x13.SetMetadataRequest\x1a\x14.SetMetadataResponse\"\x00\x12%\n\x04List\x12\x0c.ListRequest\x1a\r.ListResponse\"\x00\x12+\n\x06\x43\x61ncel\x12\x0e.CancelRequest\x1a\x0f.CancelResponse\"\x00\x62\x06proto3')
20
+
21
+ _globals = globals()
22
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
23
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'server_pb2', _globals)
24
+ if _descriptor._USE_C_DESCRIPTORS == False:
25
+ DESCRIPTOR._options = None
26
+ _globals['_TASKMETADATA_LOGGERLABELSENTRY']._options = None
27
+ _globals['_TASKMETADATA_LOGGERLABELSENTRY']._serialized_options = b'8\001'
28
+ _globals['_BOUNDFUNCTION']._serialized_start=61
29
+ _globals['_BOUNDFUNCTION']._serialized_end=239
30
+ _globals['_ENVIRONMENTDEFINITION']._serialized_start=241
31
+ _globals['_ENVIRONMENTDEFINITION']._serialized_end=341
32
+ _globals['_SUBMITREQUEST']._serialized_start=343
33
+ _globals['_SUBMITREQUEST']._serialized_end=425
34
+ _globals['_TASKMETADATA']._serialized_start=427
35
+ _globals['_TASKMETADATA']._serialized_end=550
36
+ _globals['_TASKMETADATA_LOGGERLABELSENTRY']._serialized_start=499
37
+ _globals['_TASKMETADATA_LOGGERLABELSENTRY']._serialized_end=550
38
+ _globals['_SUBMITRESPONSE']._serialized_start=552
39
+ _globals['_SUBMITRESPONSE']._serialized_end=585
40
+ _globals['_SETMETADATAREQUEST']._serialized_start=587
41
+ _globals['_SETMETADATAREQUEST']._serialized_end=657
42
+ _globals['_SETMETADATARESPONSE']._serialized_start=659
43
+ _globals['_SETMETADATARESPONSE']._serialized_end=680
44
+ _globals['_LISTREQUEST']._serialized_start=682
45
+ _globals['_LISTREQUEST']._serialized_end=695
46
+ _globals['_TASKINFO']._serialized_start=697
47
+ _globals['_TASKINFO']._serialized_end=724
48
+ _globals['_LISTRESPONSE']._serialized_start=726
49
+ _globals['_LISTRESPONSE']._serialized_end=766
50
+ _globals['_CANCELREQUEST']._serialized_start=768
51
+ _globals['_CANCELREQUEST']._serialized_end=800
52
+ _globals['_CANCELRESPONSE']._serialized_start=802
53
+ _globals['_CANCELRESPONSE']._serialized_end=818
54
+ _globals['_ISOLATE']._serialized_start=821
55
+ _globals['_ISOLATE']._serialized_end=1065
56
+ # @@protoc_insertion_point(module_scope)
@@ -25,21 +25,24 @@ class BoundFunction(google.protobuf.message.Message):
25
25
  ENVIRONMENTS_FIELD_NUMBER: builtins.int
26
26
  FUNCTION_FIELD_NUMBER: builtins.int
27
27
  SETUP_FUNC_FIELD_NUMBER: builtins.int
28
+ STREAM_LOGS_FIELD_NUMBER: builtins.int
28
29
  @property
29
30
  def environments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnvironmentDefinition]: ...
30
31
  @property
31
32
  def function(self) -> common_pb2.SerializedObject: ...
32
33
  @property
33
34
  def setup_func(self) -> common_pb2.SerializedObject: ...
35
+ stream_logs: builtins.bool
34
36
  def __init__(
35
37
  self,
36
38
  *,
37
39
  environments: collections.abc.Iterable[global___EnvironmentDefinition] | None = ...,
38
40
  function: common_pb2.SerializedObject | None = ...,
39
41
  setup_func: common_pb2.SerializedObject | None = ...,
42
+ stream_logs: builtins.bool = ...,
40
43
  ) -> None: ...
41
44
  def HasField(self, field_name: typing_extensions.Literal["_setup_func", b"_setup_func", "function", b"function", "setup_func", b"setup_func"]) -> builtins.bool: ...
42
- def ClearField(self, field_name: typing_extensions.Literal["_setup_func", b"_setup_func", "environments", b"environments", "function", b"function", "setup_func", b"setup_func"]) -> None: ...
45
+ def ClearField(self, field_name: typing_extensions.Literal["_setup_func", b"_setup_func", "environments", b"environments", "function", b"function", "setup_func", b"setup_func", "stream_logs", b"stream_logs"]) -> None: ...
43
46
  def WhichOneof(self, oneof_group: typing_extensions.Literal["_setup_func", b"_setup_func"]) -> typing_extensions.Literal["setup_func"] | None: ...
44
47
 
45
48
  global___BoundFunction = BoundFunction
@@ -1,35 +1,10 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
2
  """Client and server classes corresponding to protobuf-defined services."""
3
3
  import grpc
4
- import warnings
5
4
 
6
5
  from isolate.connections.grpc.definitions import common_pb2 as common__pb2
7
6
  from isolate.server.definitions import server_pb2 as server__pb2
8
7
 
9
- GRPC_GENERATED_VERSION = '1.64.0'
10
- GRPC_VERSION = grpc.__version__
11
- EXPECTED_ERROR_RELEASE = '1.65.0'
12
- SCHEDULED_RELEASE_DATE = 'June 25, 2024'
13
- _version_not_supported = False
14
-
15
- try:
16
- from grpc._utilities import first_version_is_lower
17
- _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
18
- except ImportError:
19
- _version_not_supported = True
20
-
21
- if _version_not_supported:
22
- warnings.warn(
23
- f'The grpc package installed is at version {GRPC_VERSION},'
24
- + f' but the generated code in server_pb2_grpc.py depends on'
25
- + f' grpcio>={GRPC_GENERATED_VERSION}.'
26
- + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
27
- + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
28
- + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
29
- + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
30
- RuntimeWarning
31
- )
32
-
33
8
 
34
9
  class IsolateStub(object):
35
10
  """Missing associated documentation comment in .proto file."""
@@ -44,27 +19,27 @@ class IsolateStub(object):
44
19
  '/Isolate/Run',
45
20
  request_serializer=server__pb2.BoundFunction.SerializeToString,
46
21
  response_deserializer=common__pb2.PartialRunResult.FromString,
47
- _registered_method=True)
22
+ )
48
23
  self.Submit = channel.unary_unary(
49
24
  '/Isolate/Submit',
50
25
  request_serializer=server__pb2.SubmitRequest.SerializeToString,
51
26
  response_deserializer=server__pb2.SubmitResponse.FromString,
52
- _registered_method=True)
27
+ )
53
28
  self.SetMetadata = channel.unary_unary(
54
29
  '/Isolate/SetMetadata',
55
30
  request_serializer=server__pb2.SetMetadataRequest.SerializeToString,
56
31
  response_deserializer=server__pb2.SetMetadataResponse.FromString,
57
- _registered_method=True)
32
+ )
58
33
  self.List = channel.unary_unary(
59
34
  '/Isolate/List',
60
35
  request_serializer=server__pb2.ListRequest.SerializeToString,
61
36
  response_deserializer=server__pb2.ListResponse.FromString,
62
- _registered_method=True)
37
+ )
63
38
  self.Cancel = channel.unary_unary(
64
39
  '/Isolate/Cancel',
65
40
  request_serializer=server__pb2.CancelRequest.SerializeToString,
66
41
  response_deserializer=server__pb2.CancelResponse.FromString,
67
- _registered_method=True)
42
+ )
68
43
 
69
44
 
70
45
  class IsolateServicer(object):
@@ -138,7 +113,6 @@ def add_IsolateServicer_to_server(servicer, server):
138
113
  generic_handler = grpc.method_handlers_generic_handler(
139
114
  'Isolate', rpc_method_handlers)
140
115
  server.add_generic_rpc_handlers((generic_handler,))
141
- server.add_registered_method_handlers('Isolate', rpc_method_handlers)
142
116
 
143
117
 
144
118
  # This class is part of an EXPERIMENTAL API.
@@ -156,21 +130,11 @@ class Isolate(object):
156
130
  wait_for_ready=None,
157
131
  timeout=None,
158
132
  metadata=None):
159
- return grpc.experimental.unary_stream(
160
- request,
161
- target,
162
- '/Isolate/Run',
133
+ return grpc.experimental.unary_stream(request, target, '/Isolate/Run',
163
134
  server__pb2.BoundFunction.SerializeToString,
164
135
  common__pb2.PartialRunResult.FromString,
165
- options,
166
- channel_credentials,
167
- insecure,
168
- call_credentials,
169
- compression,
170
- wait_for_ready,
171
- timeout,
172
- metadata,
173
- _registered_method=True)
136
+ options, channel_credentials,
137
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
174
138
 
175
139
  @staticmethod
176
140
  def Submit(request,
@@ -183,21 +147,11 @@ class Isolate(object):
183
147
  wait_for_ready=None,
184
148
  timeout=None,
185
149
  metadata=None):
186
- return grpc.experimental.unary_unary(
187
- request,
188
- target,
189
- '/Isolate/Submit',
150
+ return grpc.experimental.unary_unary(request, target, '/Isolate/Submit',
190
151
  server__pb2.SubmitRequest.SerializeToString,
191
152
  server__pb2.SubmitResponse.FromString,
192
- options,
193
- channel_credentials,
194
- insecure,
195
- call_credentials,
196
- compression,
197
- wait_for_ready,
198
- timeout,
199
- metadata,
200
- _registered_method=True)
153
+ options, channel_credentials,
154
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
201
155
 
202
156
  @staticmethod
203
157
  def SetMetadata(request,
@@ -210,21 +164,11 @@ class Isolate(object):
210
164
  wait_for_ready=None,
211
165
  timeout=None,
212
166
  metadata=None):
213
- return grpc.experimental.unary_unary(
214
- request,
215
- target,
216
- '/Isolate/SetMetadata',
167
+ return grpc.experimental.unary_unary(request, target, '/Isolate/SetMetadata',
217
168
  server__pb2.SetMetadataRequest.SerializeToString,
218
169
  server__pb2.SetMetadataResponse.FromString,
219
- options,
220
- channel_credentials,
221
- insecure,
222
- call_credentials,
223
- compression,
224
- wait_for_ready,
225
- timeout,
226
- metadata,
227
- _registered_method=True)
170
+ options, channel_credentials,
171
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
228
172
 
229
173
  @staticmethod
230
174
  def List(request,
@@ -237,21 +181,11 @@ class Isolate(object):
237
181
  wait_for_ready=None,
238
182
  timeout=None,
239
183
  metadata=None):
240
- return grpc.experimental.unary_unary(
241
- request,
242
- target,
243
- '/Isolate/List',
184
+ return grpc.experimental.unary_unary(request, target, '/Isolate/List',
244
185
  server__pb2.ListRequest.SerializeToString,
245
186
  server__pb2.ListResponse.FromString,
246
- options,
247
- channel_credentials,
248
- insecure,
249
- call_credentials,
250
- compression,
251
- wait_for_ready,
252
- timeout,
253
- metadata,
254
- _registered_method=True)
187
+ options, channel_credentials,
188
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
255
189
 
256
190
  @staticmethod
257
191
  def Cancel(request,
@@ -264,18 +198,8 @@ class Isolate(object):
264
198
  wait_for_ready=None,
265
199
  timeout=None,
266
200
  metadata=None):
267
- return grpc.experimental.unary_unary(
268
- request,
269
- target,
270
- '/Isolate/Cancel',
201
+ return grpc.experimental.unary_unary(request, target, '/Isolate/Cancel',
271
202
  server__pb2.CancelRequest.SerializeToString,
272
203
  server__pb2.CancelResponse.FromString,
273
- options,
274
- channel_credentials,
275
- insecure,
276
- call_credentials,
277
- compression,
278
- wait_for_ready,
279
- timeout,
280
- metadata,
281
- _registered_method=True)
204
+ options, channel_credentials,
205
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: health.proto
4
- # Protobuf Python Version: 5.26.1
4
+ # Protobuf Python Version: 4.25.1
5
5
  """Generated protocol buffer code."""
6
6
  from google.protobuf import descriptor as _descriptor
7
7
  from google.protobuf import descriptor_pool as _descriptor_pool
@@ -19,8 +19,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
21
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'health_pb2', _globals)
22
- if not _descriptor._USE_C_DESCRIPTORS:
23
- DESCRIPTOR._loaded_options = None
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+ DESCRIPTOR._options = None
24
24
  _globals['_HEALTHCHECKREQUEST']._serialized_start=32
25
25
  _globals['_HEALTHCHECKREQUEST']._serialized_end=69
26
26
  _globals['_HEALTHCHECKRESPONSE']._serialized_start=72