llama-deploy-core 0.3.13__tar.gz → 0.3.14__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.
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/PKG-INFO +1 -1
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/pyproject.toml +1 -1
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/client/manage_client.py +23 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/git/git_util.py +8 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/__init__.py +4 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/deployments.py +32 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/server/manage_api/_abstract_deployments_service.py +23 -1
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/server/manage_api/_create_deployments_router.py +19 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/README.md +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/__init__.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/client/ssl_util.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/config.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/deployment_config.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/iter_utils.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/path_util.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/py.typed +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/base.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/git_validation.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/projects.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/public.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/server/manage_api/__init__.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/server/manage_api/_exceptions.py +0 -0
- {llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/ui_build.py +0 -0
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/client/manage_client.py
RENAMED
|
@@ -8,9 +8,11 @@ from llama_deploy.core.client.ssl_util import get_httpx_verify_param
|
|
|
8
8
|
from llama_deploy.core.schema import LogEvent
|
|
9
9
|
from llama_deploy.core.schema.deployments import (
|
|
10
10
|
DeploymentCreate,
|
|
11
|
+
DeploymentHistoryResponse,
|
|
11
12
|
DeploymentResponse,
|
|
12
13
|
DeploymentsListResponse,
|
|
13
14
|
DeploymentUpdate,
|
|
15
|
+
RollbackRequest,
|
|
14
16
|
)
|
|
15
17
|
from llama_deploy.core.schema.git_validation import (
|
|
16
18
|
RepositoryValidationRequest,
|
|
@@ -202,6 +204,27 @@ class ProjectClient(BaseClient):
|
|
|
202
204
|
_raise_for_status(response)
|
|
203
205
|
return DeploymentResponse.model_validate(response.json())
|
|
204
206
|
|
|
207
|
+
async def get_deployment_history(
|
|
208
|
+
self, deployment_id: str
|
|
209
|
+
) -> DeploymentHistoryResponse:
|
|
210
|
+
response = await self.client.get(
|
|
211
|
+
f"/api/v1beta1/deployments/{deployment_id}/history",
|
|
212
|
+
params={"project_id": self.project_id},
|
|
213
|
+
)
|
|
214
|
+
_raise_for_status(response)
|
|
215
|
+
return DeploymentHistoryResponse.model_validate(response.json())
|
|
216
|
+
|
|
217
|
+
async def rollback_deployment(
|
|
218
|
+
self, deployment_id: str, git_sha: str
|
|
219
|
+
) -> DeploymentResponse:
|
|
220
|
+
response = await self.client.post(
|
|
221
|
+
f"/api/v1beta1/deployments/{deployment_id}/rollback",
|
|
222
|
+
params={"project_id": self.project_id},
|
|
223
|
+
json=RollbackRequest(git_sha=git_sha).model_dump(),
|
|
224
|
+
)
|
|
225
|
+
_raise_for_status(response)
|
|
226
|
+
return DeploymentResponse.model_validate(response.json())
|
|
227
|
+
|
|
205
228
|
async def validate_repository(
|
|
206
229
|
self,
|
|
207
230
|
repo_url: str,
|
|
@@ -265,6 +265,14 @@ def get_current_branch() -> str | None:
|
|
|
265
265
|
return result.strip() if result.strip() else None
|
|
266
266
|
|
|
267
267
|
|
|
268
|
+
def get_commit_sha_for_ref(ref: str) -> str | None:
|
|
269
|
+
"""
|
|
270
|
+
get the commit SHA for a specified ref (branch, commit, HEAD...)
|
|
271
|
+
"""
|
|
272
|
+
result = _run_process(["git", "rev-parse", ref])
|
|
273
|
+
return result.strip() if result.strip() else None
|
|
274
|
+
|
|
275
|
+
|
|
268
276
|
def get_git_root() -> Path:
|
|
269
277
|
"""
|
|
270
278
|
get the root of the current git repo
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/__init__.py
RENAMED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
from .base import Base
|
|
2
2
|
from .deployments import (
|
|
3
3
|
DeploymentCreate,
|
|
4
|
+
DeploymentHistoryResponse,
|
|
4
5
|
DeploymentResponse,
|
|
5
6
|
DeploymentsListResponse,
|
|
6
7
|
DeploymentUpdate,
|
|
7
8
|
LlamaDeploymentPhase,
|
|
8
9
|
LlamaDeploymentSpec,
|
|
9
10
|
LogEvent,
|
|
11
|
+
RollbackRequest,
|
|
10
12
|
apply_deployment_update,
|
|
11
13
|
)
|
|
12
14
|
from .git_validation import RepositoryValidationRequest, RepositoryValidationResponse
|
|
@@ -20,6 +22,8 @@ __all__ = [
|
|
|
20
22
|
"DeploymentResponse",
|
|
21
23
|
"DeploymentUpdate",
|
|
22
24
|
"DeploymentsListResponse",
|
|
25
|
+
"DeploymentHistoryResponse",
|
|
26
|
+
"RollbackRequest",
|
|
23
27
|
"LlamaDeploymentSpec",
|
|
24
28
|
"apply_deployment_update",
|
|
25
29
|
"LlamaDeploymentPhase",
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/deployments.py
RENAMED
|
@@ -102,6 +102,8 @@ class LlamaDeploymentStatus(Base):
|
|
|
102
102
|
message: str | None = None
|
|
103
103
|
lastUpdated: datetime | None = None
|
|
104
104
|
authToken: str | None = None
|
|
105
|
+
# Historical list of released versions from the CRD (camelCase fields)
|
|
106
|
+
releaseHistory: list["ReleaseHistoryEntry"] | None = None
|
|
105
107
|
|
|
106
108
|
|
|
107
109
|
class LlamaDeploymentCRD(Base):
|
|
@@ -224,3 +226,33 @@ class LogEvent(Base):
|
|
|
224
226
|
container: str
|
|
225
227
|
text: str
|
|
226
228
|
timestamp: datetime
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
# ===== Release history models =====
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class ReleaseHistoryEntry(Base):
|
|
235
|
+
"""
|
|
236
|
+
Mirrors the CRD status.releaseHistory entry with camelCase keys.
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
gitSha: str
|
|
240
|
+
releasedAt: datetime
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class ReleaseHistoryItem(Base):
|
|
244
|
+
"""
|
|
245
|
+
API-exposed release history item with snake_case keys for clients.
|
|
246
|
+
"""
|
|
247
|
+
|
|
248
|
+
git_sha: str
|
|
249
|
+
released_at: datetime
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class DeploymentHistoryResponse(Base):
|
|
253
|
+
deployment_id: str
|
|
254
|
+
history: list[ReleaseHistoryItem]
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
class RollbackRequest(Base):
|
|
258
|
+
git_sha: str
|
|
@@ -3,7 +3,11 @@ from typing import AsyncGenerator, cast
|
|
|
3
3
|
|
|
4
4
|
from llama_deploy.core import schema
|
|
5
5
|
from llama_deploy.core.schema import LogEvent
|
|
6
|
-
from llama_deploy.core.schema.deployments import
|
|
6
|
+
from llama_deploy.core.schema.deployments import (
|
|
7
|
+
DeploymentHistoryResponse,
|
|
8
|
+
DeploymentResponse,
|
|
9
|
+
RollbackRequest,
|
|
10
|
+
)
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
class AbstractPublicDeploymentsService(ABC):
|
|
@@ -134,6 +138,24 @@ class AbstractDeploymentsService(ABC):
|
|
|
134
138
|
"""
|
|
135
139
|
...
|
|
136
140
|
|
|
141
|
+
@abstractmethod
|
|
142
|
+
async def get_deployment_history(
|
|
143
|
+
self, project_id: str, deployment_id: str
|
|
144
|
+
) -> DeploymentHistoryResponse:
|
|
145
|
+
"""
|
|
146
|
+
Get the release history for a deployment.
|
|
147
|
+
"""
|
|
148
|
+
...
|
|
149
|
+
|
|
150
|
+
@abstractmethod
|
|
151
|
+
async def rollback_deployment(
|
|
152
|
+
self, project_id: str, deployment_id: str, request: RollbackRequest
|
|
153
|
+
) -> DeploymentResponse:
|
|
154
|
+
"""
|
|
155
|
+
Roll back a deployment to a previous git sha.
|
|
156
|
+
"""
|
|
157
|
+
...
|
|
158
|
+
|
|
137
159
|
@abstractmethod
|
|
138
160
|
async def stream_deployment_logs(
|
|
139
161
|
self,
|
|
@@ -103,6 +103,25 @@ def create_v1beta1_deployments_router(
|
|
|
103
103
|
|
|
104
104
|
return deployment
|
|
105
105
|
|
|
106
|
+
@router.get("/{deployment_id}/history")
|
|
107
|
+
async def get_deployment_history(
|
|
108
|
+
project_id: Annotated[str, Depends(get_project_id)],
|
|
109
|
+
deployment_id: str,
|
|
110
|
+
) -> schema.DeploymentHistoryResponse:
|
|
111
|
+
return await deployments_service.get_deployment_history(
|
|
112
|
+
project_id=project_id, deployment_id=deployment_id
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
@router.post("/{deployment_id}/rollback")
|
|
116
|
+
async def rollback_deployment(
|
|
117
|
+
project_id: Annotated[str, Depends(get_project_id)],
|
|
118
|
+
deployment_id: str,
|
|
119
|
+
request: schema.RollbackRequest,
|
|
120
|
+
) -> schema.DeploymentResponse:
|
|
121
|
+
return await deployments_service.rollback_deployment(
|
|
122
|
+
project_id=project_id, deployment_id=deployment_id, request=request
|
|
123
|
+
)
|
|
124
|
+
|
|
106
125
|
@router.delete("/{deployment_id}")
|
|
107
126
|
async def delete_deployment(
|
|
108
127
|
project_id: Annotated[str, Depends(get_project_id)],
|
|
File without changes
|
|
File without changes
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/client/ssl_util.py
RENAMED
|
File without changes
|
|
File without changes
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/deployment_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/git_validation.py
RENAMED
|
File without changes
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/projects.py
RENAMED
|
File without changes
|
{llama_deploy_core-0.3.13 → llama_deploy_core-0.3.14}/src/llama_deploy/core/schema/public.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|