backend.ai-plugin 25.6.10__py3-none-any.whl → 25.17.0rc1__py3-none-any.whl

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 backend.ai-plugin might be problematic. Click here for more details.

ai/backend/plugin/VERSION CHANGED
@@ -1 +1 @@
1
- 25.6.10
1
+ 25.17.0rc1
ai/backend/plugin/cli.py CHANGED
@@ -5,7 +5,7 @@ import itertools
5
5
  import json
6
6
  import logging
7
7
  from collections import defaultdict
8
- from typing import Any, Self
8
+ from typing import Self
9
9
 
10
10
  import click
11
11
  import colorama
@@ -36,14 +36,7 @@ class CLIContext:
36
36
  self.log_level = log_level
37
37
 
38
38
  def __enter__(self) -> Self:
39
- log_config: dict[str, Any] = {}
40
- if self.log_level != LogLevel.NOTSET:
41
- log_config["level"] = self.log_level
42
- log_config["pkg-ns"] = {
43
- "": LogLevel.WARNING,
44
- "ai.backend": self.log_level,
45
- }
46
- self._logger = LocalLogger(log_config)
39
+ self._logger = LocalLogger(log_level=self.log_level)
47
40
  self._logger.__enter__()
48
41
  return self
49
42
 
@@ -78,27 +78,81 @@ _default_glob_excluded_patterns = [
78
78
  "ai/backend/runner",
79
79
  "ai/backend/kernel",
80
80
  "wheelhouse",
81
+ "tools",
81
82
  ]
82
83
 
84
+ _optimized_glob_search_patterns = {
85
+ # These patterns only apply to scanning BUILD files in dev setups and pex distributions.
86
+ # They do not affect standard package entrypoint searches.
87
+ # NOTE: most entrypoint declaration in BUILD files are in the package's top-level only!
88
+ "backendai_cli_v10": ["ai/backend/*", "ai/backend/appproxy/*"],
89
+ "backendai_network_manager_v1": ["ai/backend/*"],
90
+ "backendai_event_dispatcher_v20": ["ai/backend/*", "ai/backend/appproxy/*"],
91
+ "backendai_stats_monitor_v20": ["ai/backend/*", "ai/backend/appproxy/*"],
92
+ "backendai_error_monitor_v20": ["ai/backend/*", "ai/backend/appproxy/*"],
93
+ "backendai_hook_v20": ["ai/backend/*"],
94
+ "backendai_webapp_v20": ["ai/backend/*"],
95
+ "backendai_scheduler_v10": ["ai/backend/manager"],
96
+ "backendai_agentselector_v10": ["ai/backend/manager"],
97
+ }
83
98
 
84
- def _glob(base_path: Path, filename: str, excluded_patterns: Iterable[str]) -> Iterator[Path]:
85
- q: collections.deque[Path] = collections.deque()
86
- q.append(base_path)
99
+
100
+ def _glob(
101
+ base_path: Path,
102
+ filename: str,
103
+ excluded_patterns: Iterable[str],
104
+ match_patterns: Iterable[str] | None = None,
105
+ ) -> Iterator[Path]:
106
+ q: collections.deque[tuple[Path, bool]] = collections.deque()
107
+ assert base_path.is_dir()
108
+ q.append((base_path, False))
87
109
  while q:
88
- search_path = q.pop()
89
- assert search_path.is_dir()
110
+ search_path, suffix_match = q.pop()
111
+
112
+ # Check if current directory matches any pattern and we should yield files from it
113
+ current_matches = False
114
+ if match_patterns is not None:
115
+ current_matches = any(search_path.match(pattern) for pattern in match_patterns)
116
+
90
117
  for item in search_path.iterdir():
91
118
  if item.is_dir():
92
- if search_path.name == "__pycache__":
119
+ if item.name == "__pycache__":
93
120
  continue
94
- if search_path.name.startswith("."):
121
+ if item.name.startswith("."):
95
122
  continue
96
- if any(search_path.match(pattern) for pattern in excluded_patterns):
123
+ if any(item.match(pattern) for pattern in excluded_patterns):
97
124
  continue
98
- q.append(item)
125
+
126
+ # Determine if we should queue this directory
127
+ should_queue = False
128
+ new_suffix_match = False
129
+
130
+ if match_patterns is None:
131
+ # No patterns specified - queue all non-excluded directories
132
+ should_queue = True
133
+ new_suffix_match = False
134
+ elif not suffix_match:
135
+ # Haven't found a matching directory yet - check if this one matches
136
+ if any(item.match(pattern) for pattern in match_patterns):
137
+ should_queue = True
138
+ new_suffix_match = True
139
+ else:
140
+ # Keep searching - queue without suffix match
141
+ should_queue = True
142
+ new_suffix_match = False
143
+ else:
144
+ # Already found a matching directory - only queue if this also matches
145
+ if any(item.match(pattern) for pattern in match_patterns):
146
+ should_queue = True
147
+ new_suffix_match = True
148
+
149
+ if should_queue:
150
+ q.append((item, new_suffix_match))
99
151
  else:
100
152
  if item.name == filename:
101
- yield item
153
+ # Yield file if no patterns or current directory matches
154
+ if match_patterns is None or current_matches:
155
+ yield item
102
156
 
103
157
 
104
158
  def scan_entrypoint_from_buildscript(group_name: str) -> Iterator[EntryPoint]:
@@ -108,11 +162,17 @@ def scan_entrypoint_from_buildscript(group_name: str) -> Iterator[EntryPoint]:
108
162
  log.debug(
109
163
  "scan_entrypoint_from_buildscript(%r): Namespace path: %s", group_name, ai_backend_ns_path
110
164
  )
111
- for buildscript_path in _glob(ai_backend_ns_path, "BUILD", _default_glob_excluded_patterns):
165
+ match_patterns = _optimized_glob_search_patterns.get(group_name, None)
166
+ # First, it is invoked in PEX or temporary test environment generated by Pantsbuild.
167
+ # In the test environment, BUILD files are NOT copied, so the plugin discovery will rely on the
168
+ # followed build-root search below.
169
+ for buildscript_path in _glob(
170
+ ai_backend_ns_path, "BUILD", _default_glob_excluded_patterns, match_patterns
171
+ ):
112
172
  for entrypoint in extract_entrypoints_from_buildscript(group_name, buildscript_path):
113
173
  entrypoints[entrypoint.name] = entrypoint
114
174
  if os.environ.get("SCIE", None) is None:
115
- # Override with the entrypoints found in the current source directories,
175
+ # Override with the entrypoints found in the current build-root directory.
116
176
  try:
117
177
  build_root = find_build_root()
118
178
  except ValueError:
@@ -120,7 +180,9 @@ def scan_entrypoint_from_buildscript(group_name: str) -> Iterator[EntryPoint]:
120
180
  else:
121
181
  src_path = build_root / "src"
122
182
  log.debug("scan_entrypoint_from_buildscript(%r): current src: %s", group_name, src_path)
123
- for buildscript_path in _glob(src_path, "BUILD", _default_glob_excluded_patterns):
183
+ for buildscript_path in _glob(
184
+ src_path, "BUILD", _default_glob_excluded_patterns, match_patterns
185
+ ):
124
186
  for entrypoint in extract_entrypoints_from_buildscript(
125
187
  group_name, buildscript_path
126
188
  ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: backend.ai-plugin
3
- Version: 25.6.10
3
+ Version: 25.17.0rc1
4
4
  Summary: Backend.AI Plugin Subsystem
5
5
  Home-page: https://github.com/lablup/backend.ai
6
6
  Author: Lablup Inc. and contributors
@@ -15,15 +15,17 @@ Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Environment :: No Input/Output (Daemon)
16
16
  Classifier: Topic :: Scientific/Engineering
17
17
  Classifier: Topic :: Software Development
18
- Classifier: Development Status :: 5 - Production/Stable
18
+ Classifier: Development Status :: 4 - Beta
19
19
  Classifier: Programming Language :: Python :: 3.13
20
20
  Classifier: License :: OSI Approved :: MIT License
21
21
  Requires-Python: >=3.13,<3.14
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: backend.ai-logging==25.6.10
23
+ Requires-Dist: backend.ai-common==25.17.0rc1
24
+ Requires-Dist: backend.ai-logging==25.17.0rc1
24
25
  Requires-Dist: click~=8.1.7
25
26
  Requires-Dist: colorama>=0.4.6
26
27
  Requires-Dist: tabulate~=0.8.9
28
+ Requires-Dist: types-colorama
27
29
  Requires-Dist: types-tabulate
28
30
  Dynamic: author
29
31
  Dynamic: classifier
@@ -0,0 +1,11 @@
1
+ ai/backend/plugin/VERSION,sha256=vhxW9UTYhT2p3VipuobjwM2Le06BsZH08HmwBPKZ0B0,11
2
+ ai/backend/plugin/__init__.py,sha256=HKBIEWtrpEk2KY3fB3Xb72N0xz5zoYUyn2HfZ75bTsc,96
3
+ ai/backend/plugin/cli.py,sha256=7SLUJy-8uPd_tSBOEZPYw1566QwrJJmCngoVyqrPAWE,5182
4
+ ai/backend/plugin/entrypoint.py,sha256=lFqz-QNcWfYBlFoDTGEU5sY0CgYD0NWEHhhtmXs4840,12083
5
+ ai/backend/plugin/py.typed,sha256=L3M0nPxGMCVTGcbI38G0aomWrOnRTY4HVjsWWRWRjsI,12
6
+ backend_ai_plugin-25.17.0rc1.dist-info/METADATA,sha256=19MgsKG27y3JOa59l7viutcez-ZEnbJatdvOXwECP6o,1524
7
+ backend_ai_plugin-25.17.0rc1.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
8
+ backend_ai_plugin-25.17.0rc1.dist-info/entry_points.txt,sha256=XxdR8AJRnWYCT-BgkqvFySRw_WjL0r9M43fRAVszaqY,56
9
+ backend_ai_plugin-25.17.0rc1.dist-info/namespace_packages.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
+ backend_ai_plugin-25.17.0rc1.dist-info/top_level.txt,sha256=TJAp5TUfTUztZSUatbygths7CWRrFfnOMCtZ-DIcw6c,3
11
+ backend_ai_plugin-25.17.0rc1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- ai/backend/plugin/VERSION,sha256=IdjD0AeESmbRCLn3D9uKMHyJbRqIVbzuxR8wQMPd7TQ,7
2
- ai/backend/plugin/__init__.py,sha256=HKBIEWtrpEk2KY3fB3Xb72N0xz5zoYUyn2HfZ75bTsc,96
3
- ai/backend/plugin/cli.py,sha256=oG3KUWot27WlRVwrpG9i2U-OF6XjwuweVdxVmUe4a4c,5443
4
- ai/backend/plugin/entrypoint.py,sha256=iCTPCsWEXEAn411qqgdpPyrO40eUEOuDhi4f9LmFu7I,9181
5
- ai/backend/plugin/py.typed,sha256=L3M0nPxGMCVTGcbI38G0aomWrOnRTY4HVjsWWRWRjsI,12
6
- backend_ai_plugin-25.6.10.dist-info/METADATA,sha256=85OdvRx8zNcZ2Bk-Iq2jXNmaoCgKu58e71grjO3lXrg,1456
7
- backend_ai_plugin-25.6.10.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
8
- backend_ai_plugin-25.6.10.dist-info/entry_points.txt,sha256=XxdR8AJRnWYCT-BgkqvFySRw_WjL0r9M43fRAVszaqY,56
9
- backend_ai_plugin-25.6.10.dist-info/namespace_packages.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
- backend_ai_plugin-25.6.10.dist-info/top_level.txt,sha256=TJAp5TUfTUztZSUatbygths7CWRrFfnOMCtZ-DIcw6c,3
11
- backend_ai_plugin-25.6.10.dist-info/RECORD,,