beamlit 0.0.30rc33__py3-none-any.whl → 0.0.30rc34__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.
- beamlit/common/settings.py +1 -1
- beamlit/deploy/deploy.py +16 -16
- beamlit/deploy/parser.py +2 -1
- {beamlit-0.0.30rc33.dist-info → beamlit-0.0.30rc34.dist-info}/METADATA +1 -1
- {beamlit-0.0.30rc33.dist-info → beamlit-0.0.30rc34.dist-info}/RECORD +6 -6
- {beamlit-0.0.30rc33.dist-info → beamlit-0.0.30rc34.dist-info}/WHEEL +0 -0
beamlit/common/settings.py
CHANGED
@@ -42,7 +42,7 @@ class SettingsServer(BaseSettings):
|
|
42
42
|
module: str = Field(default="main.main")
|
43
43
|
port: int = Field(default=80)
|
44
44
|
host: str = Field(default="0.0.0.0")
|
45
|
-
|
45
|
+
directory: str = Field(default="src")
|
46
46
|
|
47
47
|
class Settings(BaseSettings):
|
48
48
|
model_config = SettingsConfigDict(
|
beamlit/deploy/deploy.py
CHANGED
@@ -174,15 +174,15 @@ def dockerfile(
|
|
174
174
|
Returns:
|
175
175
|
str: Dockerfile content
|
176
176
|
"""
|
177
|
+
settings = get_settings()
|
177
178
|
if type == "agent":
|
178
179
|
module = f"{resource.module.__file__.split('/')[-1].replace('.py', '')}.{resource.module.__name__}"
|
179
180
|
else:
|
180
|
-
module = f"functions.{resource.module.
|
181
|
+
module = f"functions.{resource.module.__file__.split('/')[-1].replace('.py', '')}.{resource.module.__name__}"
|
181
182
|
cmd = ["bl", "serve", "--port", "80", "--module", module]
|
182
183
|
if type == "agent":
|
183
184
|
cmd.append("--remote")
|
184
185
|
cmd_str = ",".join([f'"{c}"' for c in cmd])
|
185
|
-
|
186
186
|
return f"""
|
187
187
|
FROM python:3.12-slim
|
188
188
|
|
@@ -201,7 +201,7 @@ RUN uv sync --no-cache
|
|
201
201
|
|
202
202
|
COPY README.m[d] /beamlit/README.md
|
203
203
|
COPY LICENS[E] /beamlit/LICENSE
|
204
|
-
COPY
|
204
|
+
COPY {settings.server.directory} /beamlit/src
|
205
205
|
|
206
206
|
ENV PATH="/beamlit/.venv/bin:$PATH"
|
207
207
|
|
@@ -226,11 +226,11 @@ def generate_beamlit_deployment(directory: str):
|
|
226
226
|
logger.info(f"Importing server module: {settings.server.module}")
|
227
227
|
functions: list[tuple[Resource, Function]] = []
|
228
228
|
agents: list[tuple[Resource, Agent]] = []
|
229
|
-
for resource in get_resources("agent"):
|
229
|
+
for resource in get_resources("agent", settings.server.directory):
|
230
230
|
agent = get_beamlit_deployment_from_resource(resource)
|
231
231
|
if agent:
|
232
232
|
agents.append((resource, agent))
|
233
|
-
for resource in get_resources("function"):
|
233
|
+
for resource in get_resources("function", settings.server.directory):
|
234
234
|
function = get_beamlit_deployment_from_resource(resource)
|
235
235
|
if function:
|
236
236
|
functions.append((resource, function))
|
@@ -240,17 +240,17 @@ def generate_beamlit_deployment(directory: str):
|
|
240
240
|
# Create directory if it doesn't exist
|
241
241
|
os.makedirs(agents_dir, exist_ok=True)
|
242
242
|
os.makedirs(functions_dir, exist_ok=True)
|
243
|
-
for resource, agent in agents:
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
243
|
+
# for resource, agent in agents:
|
244
|
+
# # write deployment file
|
245
|
+
# agent_dir = os.path.join(agents_dir, agent.metadata.name)
|
246
|
+
# os.makedirs(agent_dir, exist_ok=True)
|
247
|
+
# with open(os.path.join(agent_dir, f"agent.yaml"), "w") as f:
|
248
|
+
# content = get_agent_yaml(agent, functions, settings)
|
249
|
+
# f.write(content)
|
250
|
+
# # write dockerfile for build
|
251
|
+
# with open(os.path.join(agent_dir, f"Dockerfile"), "w") as f:
|
252
|
+
# content = dockerfile("agent", resource, agent)
|
253
|
+
# f.write(content)
|
254
254
|
for resource, function in functions:
|
255
255
|
# write deployment file
|
256
256
|
function_dir = os.path.join(functions_dir, function.metadata.name)
|
beamlit/deploy/parser.py
CHANGED
@@ -7,6 +7,7 @@ from typing import Callable, Literal
|
|
7
7
|
|
8
8
|
from beamlit.models import StoreFunctionParameter
|
9
9
|
|
10
|
+
|
10
11
|
@dataclass
|
11
12
|
class Resource:
|
12
13
|
type: Literal["agent", "function"]
|
@@ -16,7 +17,7 @@ class Resource:
|
|
16
17
|
func: Callable
|
17
18
|
|
18
19
|
|
19
|
-
def get_resources(from_decorator, dir
|
20
|
+
def get_resources(from_decorator, dir) -> list[Resource]:
|
20
21
|
"""
|
21
22
|
Scans through Python files in a directory to find functions decorated with a specific decorator.
|
22
23
|
|
@@ -134,12 +134,12 @@ beamlit/common/generate.py,sha256=LtdCju_QayRS4lZrrb_0VHqWWvTcv4Mbf-iV1TB_Qko,75
|
|
134
134
|
beamlit/common/instrumentation.py,sha256=MsBDfFcMYqGDiHHj4j5hLHE4EWxZExkhmCeFS3SKzJY,3181
|
135
135
|
beamlit/common/logger.py,sha256=VFRbaZh93n8ZGugeeYKe88IP2nI3g2JNa7XN4j8wVJE,1116
|
136
136
|
beamlit/common/secrets.py,sha256=sid81bOe3LflkMKDHwBsBs9nIju8bp5-v9qU9gkyNMc,212
|
137
|
-
beamlit/common/settings.py,sha256=
|
137
|
+
beamlit/common/settings.py,sha256=2V06qodZHwPBqRDdpPyZhdCO7HeMjWr2rkEePOgmHqE,5936
|
138
138
|
beamlit/common/utils.py,sha256=jouz5igBvT37Xn_e94-foCHyQczVim-UzVcoIF6RWJ4,657
|
139
139
|
beamlit/deploy/__init__.py,sha256=GS7l7Jtm2yKs7iNLKcfjYO-rAhUzggQ3xiYSf3oxLBY,91
|
140
|
-
beamlit/deploy/deploy.py,sha256=
|
140
|
+
beamlit/deploy/deploy.py,sha256=cLQ9K6EG5Rnvv_FpfBpMdgHVS6pOgjm5pEUFMZbZb6A,9353
|
141
141
|
beamlit/deploy/format.py,sha256=78tOoeNPJ8969AhQTeFlIwZgQ3un8gmTSMmrYbRQSds,1818
|
142
|
-
beamlit/deploy/parser.py,sha256=
|
142
|
+
beamlit/deploy/parser.py,sha256=Ga0poCZkoRnuTw082QnTcNGCBJncoRAnVsn8-1FsaJE,6907
|
143
143
|
beamlit/functions/__init__.py,sha256=_RPG1Bfg54JGdIPnViAU6n9zD7E1cDNsdXi8oYGskzE,138
|
144
144
|
beamlit/functions/decorator.py,sha256=NsdIWs55Yhn-TUO855DIE2AarV-euXtl7Qt5c2W3AUo,3239
|
145
145
|
beamlit/functions/github/__init__.py,sha256=gYnUkeegukOfbymdabuuJkScvH-_ZJygX05BoqkPn0o,49
|
@@ -256,6 +256,6 @@ beamlit/serve/app.py,sha256=k9THiOqcPs4lcQQhZaucLcboXCR_5AKP9AFCMNRbdPI,3559
|
|
256
256
|
beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
|
257
257
|
beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
|
258
258
|
beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
|
259
|
-
beamlit-0.0.
|
260
|
-
beamlit-0.0.
|
261
|
-
beamlit-0.0.
|
259
|
+
beamlit-0.0.30rc34.dist-info/METADATA,sha256=ueLL99sarr_KpTO6FvRg2mKPhjHyQC56FdUXOJJG0Wk,2405
|
260
|
+
beamlit-0.0.30rc34.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
261
|
+
beamlit-0.0.30rc34.dist-info/RECORD,,
|
File without changes
|