interloper-api 0.122.1__tar.gz → 0.123.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.
- {interloper_api-0.122.1 → interloper_api-0.123.0}/PKG-INFO +1 -1
- {interloper_api-0.122.1 → interloper_api-0.123.0}/pyproject.toml +1 -1
- {interloper_api-0.122.1 → interloper_api-0.123.0}/pyproject.toml.orig +1 -1
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/runs.py +40 -7
- {interloper_api-0.122.1 → interloper_api-0.123.0}/README.md +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/__init__.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/app.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/authorization.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/cli.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/dependencies/__init__.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/dependencies/auth.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/dependencies/rbac.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/dependencies/state.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/login.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/__init__.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/base.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/invitations.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/super_admins.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/__init__.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/admin.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/agent.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/apps.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/auth.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/authorization.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/backfills.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/catalog.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/components.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/executions.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/health.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/oauth.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/organisations.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/overview.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/relations.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/tokens.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/websocket.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/server.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/utils/__init__.py +0 -0
- {interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/utils/time.py +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
"""Runs API: queue, inspect, retry and cancel runs, read their executions and events
|
|
1
|
+
"""Runs API: queue, inspect, retry and cancel runs, read their executions and events; serve a run's own process.
|
|
2
2
|
|
|
3
3
|
Two routers: ``org_router`` is mounted under the organisation's path and serves
|
|
4
|
-
its members; ``router`` is mounted at the API root and serves
|
|
5
|
-
authenticates as its run
|
|
6
|
-
names no organisation
|
|
4
|
+
its members; ``router`` is mounted at the API root and serves the process that
|
|
5
|
+
executes a run, which authenticates as its run
|
|
6
|
+
(:func:`~interloper_api.dependencies.require_run`), names no organisation,
|
|
7
|
+
loads what the run executes and reports what happened.
|
|
7
8
|
"""
|
|
8
9
|
|
|
9
10
|
from __future__ import annotations
|
|
@@ -14,9 +15,10 @@ from uuid import UUID
|
|
|
14
15
|
|
|
15
16
|
import interloper as il
|
|
16
17
|
from fastapi import APIRouter, Depends, HTTPException, Query
|
|
17
|
-
from interloper.errors import EventError
|
|
18
|
-
from
|
|
19
|
-
from interloper_db
|
|
18
|
+
from interloper.errors import EventError, PartitionError
|
|
19
|
+
from interloper.runner.spec import RunSpec
|
|
20
|
+
from interloper_db import EventQuery, ExecutionQuery, NotFoundError, Page, PageQuery, RunQuery
|
|
21
|
+
from interloper_db.models import Event, Run, RunStatus
|
|
20
22
|
from pydantic import BaseModel, Field
|
|
21
23
|
|
|
22
24
|
from interloper_api.dependencies import (
|
|
@@ -340,6 +342,37 @@ def list_run_events(
|
|
|
340
342
|
return store.events.list(run.org_id, query, run_id=run_id).map(EventResponse.from_event)
|
|
341
343
|
|
|
342
344
|
|
|
345
|
+
@router.get("/{run_id}/spec")
|
|
346
|
+
def get_spec(run: Annotated[Run, Depends(require_run)], store: StoreDep) -> RunSpec:
|
|
347
|
+
"""What the run executes, built from its row as it stands: the process that executes it loads it once started.
|
|
348
|
+
|
|
349
|
+
Only the run's own token is accepted (`require_run`), and only while the
|
|
350
|
+
run is dispatched or running: a run ended elsewhere is not to be started.
|
|
351
|
+
|
|
352
|
+
Args:
|
|
353
|
+
run: The run its token stands for.
|
|
354
|
+
store: The Store instance.
|
|
355
|
+
|
|
356
|
+
Returns:
|
|
357
|
+
The run's DAG, its connections resolved, the partition it covers and
|
|
358
|
+
its event metadata.
|
|
359
|
+
|
|
360
|
+
Raises:
|
|
361
|
+
HTTPException: 409 when the run is no longer live, or can no longer be
|
|
362
|
+
built (its target deleted, or selecting nothing, or its window
|
|
363
|
+
refused).
|
|
364
|
+
"""
|
|
365
|
+
if run.status not in (RunStatus.DISPATCHED, RunStatus.RUNNING):
|
|
366
|
+
raise HTTPException(status_code=409, detail=f"Run {run.id} is {run.status}, not live")
|
|
367
|
+
try:
|
|
368
|
+
spec = store.runs.spec(run.id)
|
|
369
|
+
except (NotFoundError, TypeError, PartitionError) as error:
|
|
370
|
+
raise HTTPException(status_code=409, detail=str(error)) from error
|
|
371
|
+
if spec is None:
|
|
372
|
+
raise HTTPException(status_code=409, detail=f"Run {run.id} selects no operations")
|
|
373
|
+
return spec
|
|
374
|
+
|
|
375
|
+
|
|
343
376
|
class IngestResponse(BaseModel):
|
|
344
377
|
"""Whether the run was live when the batch arrived."""
|
|
345
378
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/dependencies/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/invitations.py
RENAMED
|
File without changes
|
{interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/notifications/super_admins.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/authorization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{interloper_api-0.122.1 → interloper_api-0.123.0}/src/interloper_api/routes/organisations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|