elan-agentkit-runtime 0.1.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.
- elan_agentkit_runtime-0.1.0/.gitignore +45 -0
- elan_agentkit_runtime-0.1.0/Dockerfile +74 -0
- elan_agentkit_runtime-0.1.0/Dockerfile.base +149 -0
- elan_agentkit_runtime-0.1.0/Dockerfile.tenant +91 -0
- elan_agentkit_runtime-0.1.0/LICENSE +202 -0
- elan_agentkit_runtime-0.1.0/PKG-INFO +49 -0
- elan_agentkit_runtime-0.1.0/README.md +16 -0
- elan_agentkit_runtime-0.1.0/pyproject.toml +64 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/__init__.py +0 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/builder.py +448 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/concurrency.py +46 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/config.py +188 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/consumer.py +151 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/engine.py +1547 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/fleet.py +168 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/main.py +418 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/manifest_export.py +143 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/plugins.py +373 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/pubsub_push.py +59 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/registry.py +163 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/schema_export.py +129 -0
- elan_agentkit_runtime-0.1.0/src/agentkit_runtime/tenant_plugins.py +200 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
.venv/
|
|
4
|
+
.env
|
|
5
|
+
.env.docker
|
|
6
|
+
.uvcache/
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
node_modules/
|
|
11
|
+
.next/
|
|
12
|
+
# TypeScript incremental build cache: rewritten by every portal build, so
|
|
13
|
+
# tracking it dirties the tree on each one and now on every CI run.
|
|
14
|
+
*.tsbuildinfo
|
|
15
|
+
.terraform/
|
|
16
|
+
.terraform.lock.hcl
|
|
17
|
+
tfplan
|
|
18
|
+
*.tfstate*
|
|
19
|
+
.pytest_cache/
|
|
20
|
+
.ruff_cache/
|
|
21
|
+
catalog.json
|
|
22
|
+
.ref/
|
|
23
|
+
|
|
24
|
+
.local/
|
|
25
|
+
# Per environment (ADR-0179): one shared file meant building for a second
|
|
26
|
+
# environment overwrote the first's recorded digests.
|
|
27
|
+
.platform-digests.*
|
|
28
|
+
|
|
29
|
+
# Terraform plan files. Build artefacts, and a plan can carry values read
|
|
30
|
+
# from state — including ones marked sensitive. `tfplan` alone did not match
|
|
31
|
+
# `np.tfplan`, which is how one came to be committed.
|
|
32
|
+
*.tfplan
|
|
33
|
+
|
|
34
|
+
# Per-developer Claude Code settings. `.claude/settings.json` is the shared,
|
|
35
|
+
# checked-in one; this is the personal override beside it, and it routinely
|
|
36
|
+
# holds machine-specific permission grants — a `kubectl exec` allowance for
|
|
37
|
+
# somebody's own cluster has no business in a repo that is also the starter
|
|
38
|
+
# template for new projects.
|
|
39
|
+
.claude/settings.local.json
|
|
40
|
+
|
|
41
|
+
# GENERATED AT BUILD from the prerendered documentation, by
|
|
42
|
+
# ui/console/scripts/gen-llms.mjs. A build artifact like `.next` and the SDK's
|
|
43
|
+
# `dist`: committing it would mean a second copy of every documentation page
|
|
44
|
+
# in the history, going stale between builds.
|
|
45
|
+
ui/console/public/llms-full.txt
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# ONE image serves every agent and workflow; TARGET_SLUG selects which.
|
|
2
|
+
# Build from the repo root: docker build -f agent-pipeline/runtime/Dockerfile .
|
|
3
|
+
#
|
|
4
|
+
# Layer order matters: because definitions are code, a one-word prompt edit
|
|
5
|
+
# rebuilds the image. Dependencies and the platform layer are cached, and only
|
|
6
|
+
# agents/ + workflows/ invalidate at the very end, so that rebuild stays cheap.
|
|
7
|
+
FROM python:3.12-slim-bookworm AS builder
|
|
8
|
+
|
|
9
|
+
# Copy the uv binary in rather than depending on a uv+python tag combination.
|
|
10
|
+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
11
|
+
|
|
12
|
+
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
|
13
|
+
WORKDIR /app
|
|
14
|
+
|
|
15
|
+
# 1. Dependency manifests only -> this layer survives every source change.
|
|
16
|
+
# THESE MEMBER MANIFESTS ARE INERT WITH TODAY'S uv, AND THAT WAS MEASURED
|
|
17
|
+
# rather than assumed. `uv sync --frozen --no-install-workspace` resolves
|
|
18
|
+
# entirely from `uv.lock`: on uv 0.11.26 the step below succeeds with only
|
|
19
|
+
# `pyproject.toml` and `uv.lock` in the context and every line beneath this
|
|
20
|
+
# comment deleted. What it CANNOT do without the real source is the second
|
|
21
|
+
# sync, which installs the workspace — and that source arrives with
|
|
22
|
+
# `COPY packages/` further down, so these lines are not what makes it work.
|
|
23
|
+
#
|
|
24
|
+
# THEY ARE KEPT, AND THE REASON IS READABILITY RATHER THAN RESOLUTION. The
|
|
25
|
+
# list is how a reader sees which members this image's graph contains, so an
|
|
26
|
+
# INCONSISTENT list is worse than a uniformly inert one: naming
|
|
27
|
+
# agentkit-core and not the package beneath it reads as a statement that the
|
|
28
|
+
# second is not in the graph. `tests/test_docker_cache_layers.py` keeps the
|
|
29
|
+
# set closed under the workspace dependency relation for that reason, and
|
|
30
|
+
# keeps it from growing — every file here is part of this layer's CACHE KEY,
|
|
31
|
+
# so a manifest nothing needs makes an unrelated edit reinstall every
|
|
32
|
+
# dependency.
|
|
33
|
+
#
|
|
34
|
+
# WORTH DELETING OUTRIGHT, as a change of its own. `uv:latest` is what the
|
|
35
|
+
# build pulls, so the measurement above is of a moving target — which is an
|
|
36
|
+
# argument for making the decision deliberately rather than by attrition.
|
|
37
|
+
COPY pyproject.toml uv.lock ./
|
|
38
|
+
COPY packages/elan-agentkit-contracts/pyproject.toml packages/elan-agentkit-contracts/
|
|
39
|
+
COPY packages/agentkit-core/pyproject.toml packages/agentkit-core/
|
|
40
|
+
COPY agent-pipeline/plugins/pyproject.toml agent-pipeline/plugins/
|
|
41
|
+
COPY agent-pipeline/runtime/pyproject.toml agent-pipeline/runtime/
|
|
42
|
+
# --package selects ONLY the runtime and its workspace dependencies. Without it
|
|
43
|
+
# uv resolves the root aggregate package, which depends on every service and
|
|
44
|
+
# would need ledger/rt/observability sources in this image.
|
|
45
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
46
|
+
uv sync --frozen --no-install-workspace --no-dev --package elan-agentkit-runtime
|
|
47
|
+
|
|
48
|
+
# 2. Platform source — changes only when the runtime or plugins change.
|
|
49
|
+
COPY packages/ packages/
|
|
50
|
+
COPY agent-pipeline/plugins/ agent-pipeline/plugins/
|
|
51
|
+
COPY agent-pipeline/runtime/ agent-pipeline/runtime/
|
|
52
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
53
|
+
uv sync --frozen --no-dev --package elan-agentkit-runtime
|
|
54
|
+
|
|
55
|
+
# 3. Target definitions LAST — the layer that changes most often.
|
|
56
|
+
COPY agent-pipeline/agents/ agent-pipeline/agents/
|
|
57
|
+
COPY agent-pipeline/workflows/ agent-pipeline/workflows/
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
FROM python:3.12-slim-bookworm AS runtime
|
|
61
|
+
|
|
62
|
+
RUN useradd --create-home --uid 1000 app
|
|
63
|
+
WORKDIR /app
|
|
64
|
+
COPY --from=builder --chown=app:app /app /app
|
|
65
|
+
|
|
66
|
+
ENV PATH="/app/.venv/bin:$PATH" \
|
|
67
|
+
PYTHONUNBUFFERED=1 \
|
|
68
|
+
PYTHONDONTWRITEBYTECODE=1 \
|
|
69
|
+
TARGETS_ROOT=/app/agent-pipeline \
|
|
70
|
+
PORT=8080
|
|
71
|
+
|
|
72
|
+
USER app
|
|
73
|
+
EXPOSE 8080
|
|
74
|
+
CMD ["sh", "-c", "uvicorn agentkit_runtime.main:app --host 0.0.0.0 --port ${PORT}"]
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# The image every TENANT image is built on top of: the platform runtime, and
|
|
2
|
+
# nothing of this repo's own agents.
|
|
3
|
+
#
|
|
4
|
+
# WHY THIS IS A SEPARATE FILE FROM `Dockerfile`. That one builds the platform's
|
|
5
|
+
# own fleet and copies `agent-pipeline/agents/` and `agent-pipeline/workflows/`
|
|
6
|
+
# in at the last layer. A tenant image built on it would CONTAIN OUR EXAMPLES,
|
|
7
|
+
# and `manifest_export` enumerates whatever is under the targets root — so the
|
|
8
|
+
# tenant's own crosscheck would be handed `hotel-concierge` as an undeclared
|
|
9
|
+
# target and their deploy would be refused for an agent they have never seen.
|
|
10
|
+
# The fix is not to filter the export; it is not to ship them.
|
|
11
|
+
#
|
|
12
|
+
# THREE THINGS THE TENANT LAYER NEEDS THAT THE FLEET IMAGE DOES NOT HAVE, which
|
|
13
|
+
# is the rest of the reason this file exists:
|
|
14
|
+
#
|
|
15
|
+
# 1. `uv` IN THE FINAL STAGE. `Dockerfile` copies it into the builder stage
|
|
16
|
+
# only, so `RUN uv sync` against that image fails with `uv: not found`.
|
|
17
|
+
# A tenant layer installs dependencies, so it needs the installer.
|
|
18
|
+
# 2. A VENV IT MAY ADD TO. `UV_PROJECT_ENVIRONMENT` points at the same
|
|
19
|
+
# `/app/.venv` the platform runtime lives in, so a tenant's dependencies
|
|
20
|
+
# are resolved AGAINST ours rather than beside them — see Dockerfile.tenant
|
|
21
|
+
# for why that is the honest arrangement.
|
|
22
|
+
# 3. WRITABLE OWNERSHIP for uid 1000, so the tenant layer installs as a user
|
|
23
|
+
# rather than needing root back.
|
|
24
|
+
#
|
|
25
|
+
# IT ALSO CARRIES `Dockerfile.tenant` AT /opt/elan/. That recipe is written
|
|
26
|
+
# against THIS image's internals — the venv path, the user, uv being present —
|
|
27
|
+
# so publishing the two separately means they can drift, and the drift surfaces
|
|
28
|
+
# as a tenant's build failing on something they did not write. Shipping the
|
|
29
|
+
# recipe inside the image it is pinned to makes `RUNTIME_BASE` one thing to
|
|
30
|
+
# pin instead of two things to keep in step. The tenant build extracts it with
|
|
31
|
+
# `docker cp`; see gitops/gcp/cloudbuild-tenant.yaml.
|
|
32
|
+
|
|
33
|
+
FROM python:3.12-slim-bookworm AS builder
|
|
34
|
+
|
|
35
|
+
# PINNED, unlike the fleet image's `uv:latest`. This image is a published
|
|
36
|
+
# artifact other people's builds depend on, so "whatever uv was current the day
|
|
37
|
+
# it built" is not a property it may have.
|
|
38
|
+
COPY --from=ghcr.io/astral-sh/uv:0.9.7 /uv /uvx /bin/
|
|
39
|
+
|
|
40
|
+
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
|
41
|
+
WORKDIR /app
|
|
42
|
+
|
|
43
|
+
# THESE MEMBER MANIFESTS ARE INERT WITH TODAY'S uv, AND THAT WAS MEASURED
|
|
44
|
+
# rather than assumed. `uv sync --frozen --no-install-workspace` resolves
|
|
45
|
+
# entirely from `uv.lock`: on uv 0.11.26 the step below succeeds with only
|
|
46
|
+
# `pyproject.toml` and `uv.lock` in the context and every line beneath this
|
|
47
|
+
# comment deleted. What it CANNOT do without the real source is the second
|
|
48
|
+
# sync, which installs the workspace — and that source arrives with
|
|
49
|
+
# `COPY packages/` further down, so these lines are not what makes it work.
|
|
50
|
+
#
|
|
51
|
+
# THEY ARE KEPT, AND THE REASON IS READABILITY RATHER THAN RESOLUTION. The
|
|
52
|
+
# list is how a reader sees which members this image's graph contains, so an
|
|
53
|
+
# INCONSISTENT list is worse than a uniformly inert one: naming
|
|
54
|
+
# agentkit-core and not the package beneath it reads as a statement that the
|
|
55
|
+
# second is not in the graph. `tests/test_docker_cache_layers.py` keeps the
|
|
56
|
+
# set closed under the workspace dependency relation for that reason, and
|
|
57
|
+
# keeps it from growing — every file here is part of this layer's CACHE KEY,
|
|
58
|
+
# so a manifest nothing needs makes an unrelated edit reinstall every
|
|
59
|
+
# dependency.
|
|
60
|
+
#
|
|
61
|
+
# WORTH DELETING OUTRIGHT, as a change of its own. `uv:latest` is what the
|
|
62
|
+
# build pulls, so the measurement above is of a moving target — which is an
|
|
63
|
+
# argument for making the decision deliberately rather than by attrition.
|
|
64
|
+
COPY pyproject.toml uv.lock ./
|
|
65
|
+
COPY packages/elan-agentkit-contracts/pyproject.toml packages/elan-agentkit-contracts/
|
|
66
|
+
COPY packages/agentkit-core/pyproject.toml packages/agentkit-core/
|
|
67
|
+
COPY agent-pipeline/plugins/pyproject.toml agent-pipeline/plugins/
|
|
68
|
+
COPY agent-pipeline/runtime/pyproject.toml agent-pipeline/runtime/
|
|
69
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
70
|
+
uv sync --frozen --no-install-workspace --no-dev --package elan-agentkit-runtime
|
|
71
|
+
|
|
72
|
+
COPY packages/ packages/
|
|
73
|
+
COPY agent-pipeline/plugins/ agent-pipeline/plugins/
|
|
74
|
+
COPY agent-pipeline/runtime/ agent-pipeline/runtime/
|
|
75
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
76
|
+
uv sync --frozen --no-dev --package elan-agentkit-runtime
|
|
77
|
+
|
|
78
|
+
# NO `COPY agent-pipeline/agents/` AND NO `COPY agent-pipeline/workflows/`.
|
|
79
|
+
# That absence is the whole point of the file; see the header.
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
FROM python:3.12-slim-bookworm AS runtime
|
|
83
|
+
|
|
84
|
+
# DEBIAN SECURITY UPDATES, AND THE UPSTREAM TAG DOES NOT CARRY THEM.
|
|
85
|
+
#
|
|
86
|
+
# This is not belt-and-braces. Measured on 2026-09-27: `python:3.12-slim-
|
|
87
|
+
# bookworm`, freshly pulled, ships `openssl 3.0.20-1~deb12u2` while Debian's
|
|
88
|
+
# own security repository has offered `3.0.22-1~deb12u1` — the fix for
|
|
89
|
+
# CVE-2026-75803 — for some time. The image tag is rebuilt on its own
|
|
90
|
+
# schedule, so "pull the latest base" does NOT get the patch, and the first
|
|
91
|
+
# tenant deploy after a CVE lands is refused by our own scan gate with nothing
|
|
92
|
+
# the tenant can do about it. That is what happened.
|
|
93
|
+
#
|
|
94
|
+
# EVERY PACKAGE, NOT A LIST OF THE ONES WE KNOW ABOUT. A targeted
|
|
95
|
+
# `--only-upgrade openssl libssl3` fixes today and needs editing the next time
|
|
96
|
+
# a different library is the one with the CVE — and the way we would find out
|
|
97
|
+
# is another tenant's deploy being refused. The scan gate is what makes this
|
|
98
|
+
# safe to do broadly: an upgrade that broke something would fail the build
|
|
99
|
+
# rather than ship.
|
|
100
|
+
#
|
|
101
|
+
# THIS DOES NOT MAKE THE IMAGE UNREPRODUCIBLE in any way it was not already.
|
|
102
|
+
# `apt-get update` already pins nothing; what makes a platform image
|
|
103
|
+
# reproducible here is that every consumer references it BY DIGEST, and the
|
|
104
|
+
# digest changes when this layer does.
|
|
105
|
+
RUN apt-get update \
|
|
106
|
+
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y --no-install-recommends \
|
|
107
|
+
&& apt-get clean \
|
|
108
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
109
|
+
|
|
110
|
+
COPY --from=ghcr.io/astral-sh/uv:0.9.7 /uv /uvx /bin/
|
|
111
|
+
|
|
112
|
+
RUN useradd --create-home --uid 1000 app
|
|
113
|
+
WORKDIR /app
|
|
114
|
+
COPY --from=builder --chown=app:app /app /app
|
|
115
|
+
|
|
116
|
+
# The recipe that builds a tenant image on top of this one. Read by the build,
|
|
117
|
+
# never by the running pod.
|
|
118
|
+
COPY --chown=root:root agent-pipeline/runtime/Dockerfile.tenant /opt/elan/Dockerfile.tenant
|
|
119
|
+
|
|
120
|
+
ENV PATH="/app/.venv/bin:$PATH" \
|
|
121
|
+
# `VIRTUAL_ENV`, and NOT `UV_PROJECT_ENVIRONMENT`, which governs uv's
|
|
122
|
+
# PROJECT commands (`uv sync`, `uv run`) — and the tenant layer uses
|
|
123
|
+
# `uv pip`, which reads this one. With neither set, `uv pip install`
|
|
124
|
+
# discovers `.venv` relative to the working directory, so it happens to
|
|
125
|
+
# work from /app and silently creates a second environment from anywhere
|
|
126
|
+
# else. uvicorn would never look in that one.
|
|
127
|
+
VIRTUAL_ENV=/app/.venv \
|
|
128
|
+
UV_LINK_MODE=copy \
|
|
129
|
+
PYTHONUNBUFFERED=1 \
|
|
130
|
+
PYTHONDONTWRITEBYTECODE=1 \
|
|
131
|
+
# POINTED AT A DIRECTORY THAT IS EMPTY HERE, and populated by the tenant
|
|
132
|
+
# layer. Running this image directly discovers no targets, which is correct:
|
|
133
|
+
# it is a base, not a runnable agent.
|
|
134
|
+
TARGETS_ROOT=/app/targets \
|
|
135
|
+
PORT=8080
|
|
136
|
+
|
|
137
|
+
# `/app` ITSELF, not only its contents. `COPY --from=builder --chown=app:app`
|
|
138
|
+
# above sets ownership on what it copies IN, and leaves the directory it copies
|
|
139
|
+
# into owned by root — so the tenant layer can write a file under /app and then
|
|
140
|
+
# not be able to delete it, because unlinking needs write on the PARENT. That
|
|
141
|
+
# surfaces as `rm: cannot remove: Permission denied` two files away from the
|
|
142
|
+
# line that caused it.
|
|
143
|
+
RUN chown app:app /app \
|
|
144
|
+
&& mkdir -p /app/targets/agents /app/targets/workflows \
|
|
145
|
+
&& chown -R app:app /app/targets
|
|
146
|
+
|
|
147
|
+
USER app
|
|
148
|
+
EXPOSE 8080
|
|
149
|
+
CMD ["sh", "-c", "uvicorn agentkit_runtime.main:app --host 0.0.0.0 --port ${PORT}"]
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# The image a TENANT'S repo becomes. Supplied by the platform, never by them.
|
|
2
|
+
#
|
|
3
|
+
# NO TENANT-SUPPLIED DOCKERFILE, and that removes a whole attack surface rather
|
|
4
|
+
# than mitigating one. A Dockerfile is a program: it can `RUN` anything, add any
|
|
5
|
+
# base image, and install from any registry — so accepting one would mean the
|
|
6
|
+
# build sandbox's contents were chosen by the same person whose code we are
|
|
7
|
+
# sandboxing. `elan.yaml` has no `dockerfile:` key for this reason.
|
|
8
|
+
#
|
|
9
|
+
# ONE IMAGE FOR THE WHOLE REPO, with TARGET_SLUG selecting which agent a pod
|
|
10
|
+
# runs. The layer ordering below is what makes that cheap: the tenant's
|
|
11
|
+
# dependencies resolve before any of their agent code is copied, so editing an
|
|
12
|
+
# agent rebuilds one layer rather than reinstalling everything.
|
|
13
|
+
#
|
|
14
|
+
# THE COST, STATED PLAINLY because a tenant will meet it: every target in the
|
|
15
|
+
# repo shares one dependency set. Two agents wanting incompatible versions of
|
|
16
|
+
# one library is a BUILD failure rather than an isolated one, and every agent's
|
|
17
|
+
# cold start pays for every dependency in the repo. The escape hatch is to split
|
|
18
|
+
# into two projects — two repos, two images, two elan.yaml files.
|
|
19
|
+
#
|
|
20
|
+
# THIS FILE SHIPS INSIDE THE BASE IMAGE at /opt/elan/Dockerfile.tenant and the
|
|
21
|
+
# build extracts it from there. It is written against that image's internals —
|
|
22
|
+
# the venv at /app/.venv, uid 1000 owning it, uv on PATH — so the two travel
|
|
23
|
+
# together and `RUNTIME_BASE` is one thing to pin. See Dockerfile.base.
|
|
24
|
+
|
|
25
|
+
ARG RUNTIME_BASE
|
|
26
|
+
FROM ${RUNTIME_BASE}
|
|
27
|
+
|
|
28
|
+
# NOT `USER root`. The base already dropped to uid 1000 and gave it the venv, so
|
|
29
|
+
# a tenant's dependencies install as an unprivileged user — which matters here
|
|
30
|
+
# more than usual, because resolving a dependency runs ARBITRARY CODE: a
|
|
31
|
+
# source-only package's build backend is tenant-chosen Python executing at
|
|
32
|
+
# install time.
|
|
33
|
+
WORKDIR /app
|
|
34
|
+
|
|
35
|
+
# Their DEPENDENCIES, before their code, so an edit to an agent does not
|
|
36
|
+
# reinstall them.
|
|
37
|
+
#
|
|
38
|
+
# INTO A DIRECTORY OF ITS OWN, AND STILL CALLED `pyproject.toml`, for two
|
|
39
|
+
# separate reasons that both look like fussiness until they bite:
|
|
40
|
+
#
|
|
41
|
+
# /app ALREADY HAS A pyproject.toml — the platform's. Copying the tenant's
|
|
42
|
+
# over it would replace the description of the environment their code runs
|
|
43
|
+
# in with a description of their own package.
|
|
44
|
+
#
|
|
45
|
+
# uv DISPATCHES ON THE FILENAME. `uv pip install -r tenant-pyproject.toml`
|
|
46
|
+
# does not read a renamed pyproject; it refuses with "is not a valid PEP 751
|
|
47
|
+
# filename: expected TOML file to start with `pylock.`", which names a
|
|
48
|
+
# standard nobody here is using and sends you looking for a lockfile.
|
|
49
|
+
# AND IT IS OPTIONAL. The bracket glob is Docker's way of saying "copy this
|
|
50
|
+
# if it exists" — a plain COPY of a missing file fails the build with
|
|
51
|
+
# `"/pyproject.toml" not found`, from a layer, naming neither elan.yaml nor
|
|
52
|
+
# targetsRoot. The first canary deploy died exactly there.
|
|
53
|
+
#
|
|
54
|
+
# A repo whose agents need nothing beyond the platform runtime has nothing to
|
|
55
|
+
# declare, and should not have to write an empty file to say so. That is a
|
|
56
|
+
# real tenant case and not an accommodation for the canary — though the
|
|
57
|
+
# canary is what found it.
|
|
58
|
+
COPY --chown=app:app pyproject.tom[l] /app/.tenant/
|
|
59
|
+
|
|
60
|
+
# `uv pip install`, NEVER `uv sync`. Sync makes the environment MATCH the
|
|
61
|
+
# lockfile, and the tenant's lockfile does not contain the platform runtime —
|
|
62
|
+
# so a sync would uninstall the very thing this image exists to provide, and
|
|
63
|
+
# the pod would fail on `uvicorn: not found` long after the build went green.
|
|
64
|
+
# Installing adds to what is already here.
|
|
65
|
+
#
|
|
66
|
+
# `uv pip check` is what makes the header's promise true rather than
|
|
67
|
+
# aspirational. Without it a tenant pinning an older pydantic simply overwrites
|
|
68
|
+
# ours, the build succeeds, and agentkit_core raises on import inside a pod at
|
|
69
|
+
# 3am. With it, incompatible pins are a BUILD failure that names both sides.
|
|
70
|
+
# THE INSTALL IS SKIPPED WHEN THERE IS NOTHING TO INSTALL, and `uv pip check`
|
|
71
|
+
# still runs: an image with no tenant dependencies should still be verified
|
|
72
|
+
# consistent, because the base itself can regress.
|
|
73
|
+
RUN --mount=type=cache,target=/home/app/.cache/uv,uid=1000,gid=1000 \
|
|
74
|
+
if [ -f /app/.tenant/pyproject.toml ]; then \
|
|
75
|
+
uv pip install --requirement /app/.tenant/pyproject.toml; \
|
|
76
|
+
else \
|
|
77
|
+
echo "no pyproject.toml in the targets root — nothing to install"; \
|
|
78
|
+
fi \
|
|
79
|
+
&& uv pip check \
|
|
80
|
+
&& rm -rf /app/.tenant
|
|
81
|
+
|
|
82
|
+
# Their targets, LAST, so this is the only layer an ordinary edit invalidates.
|
|
83
|
+
# TARGETS_ROOT is already /app/targets in the base; these two directories are
|
|
84
|
+
# exactly what `agentkit_runtime.registry.discover` scans.
|
|
85
|
+
#
|
|
86
|
+
# BOTH ARE GUARANTEED TO EXIST by the clone step, which creates them empty if
|
|
87
|
+
# the repo has only one kind. A `COPY` of a missing directory is a build
|
|
88
|
+
# failure, and "you have no workflows/ directory" is not a thing to fail a
|
|
89
|
+
# tenant's deploy over.
|
|
90
|
+
COPY --chown=app:app agents/ /app/targets/agents/
|
|
91
|
+
COPY --chown=app:app workflows/ /app/targets/workflows/
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: elan-agentkit-runtime
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The single container that runs any agent or workflow, selected by TARGET_SLUG
|
|
5
|
+
Project-URL: Homepage, https://openelan.ai
|
|
6
|
+
Project-URL: Documentation, https://openelan.ai/app/docs
|
|
7
|
+
Author-email: Elan <support@openelan.ai>
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: adk,agents,llm,runtime
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: asyncpg>=0.30
|
|
19
|
+
Requires-Dist: elan-agentkit-core
|
|
20
|
+
Requires-Dist: elan-agentkit-plugins
|
|
21
|
+
Requires-Dist: fastapi>=0.115
|
|
22
|
+
Requires-Dist: google-adk<3,>=2.8.0
|
|
23
|
+
Requires-Dist: google-auth>=2.35
|
|
24
|
+
Requires-Dist: google-cloud-pubsub>=2.23
|
|
25
|
+
Requires-Dist: google-cloud-storage>=2.18
|
|
26
|
+
Requires-Dist: greenlet>=3.1
|
|
27
|
+
Requires-Dist: mcp<2,>=1.2
|
|
28
|
+
Requires-Dist: pydantic-settings>=2.6
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
31
|
+
Requires-Dist: uvicorn[standard]>=0.32
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# elan-agentkit-runtime
|
|
35
|
+
|
|
36
|
+
The container runtime that runs any Elan agent or workflow, selected by
|
|
37
|
+
`TARGET_SLUG`. It builds the ADK app, wires the plugins, and serves the
|
|
38
|
+
invocation and resume paths.
|
|
39
|
+
|
|
40
|
+
**This is a dependency, not a product.** `elan env` installs it into your
|
|
41
|
+
project's virtual environment so `elan validate` and `elan adk` can read your
|
|
42
|
+
manifests and run your agents locally. You are not expected to import it
|
|
43
|
+
directly.
|
|
44
|
+
|
|
45
|
+
Start at <https://openelan.ai/app/docs>.
|
|
46
|
+
|
|
47
|
+
## Licence
|
|
48
|
+
|
|
49
|
+
Apache-2.0. See `LICENSE`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# elan-agentkit-runtime
|
|
2
|
+
|
|
3
|
+
The container runtime that runs any Elan agent or workflow, selected by
|
|
4
|
+
`TARGET_SLUG`. It builds the ADK app, wires the plugins, and serves the
|
|
5
|
+
invocation and resume paths.
|
|
6
|
+
|
|
7
|
+
**This is a dependency, not a product.** `elan env` installs it into your
|
|
8
|
+
project's virtual environment so `elan validate` and `elan adk` can read your
|
|
9
|
+
manifests and run your agents locally. You are not expected to import it
|
|
10
|
+
directly.
|
|
11
|
+
|
|
12
|
+
Start at <https://openelan.ai/app/docs>.
|
|
13
|
+
|
|
14
|
+
## Licence
|
|
15
|
+
|
|
16
|
+
Apache-2.0. See `LICENSE`.
|