Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Deploy

# Manual-only (#170): with Dockerfile.lambda files now on main, a push trigger
# would build successfully and deploy main's infra templates/params — which are
# the stale #107 starter set — over the live skills-mobility-dev-* stacks that
# infra/deploy.sh (demo/e2e-aligned) maintains. Re-enable the push trigger only
# once main's templates/params are brought up to date with the demo branch's.
on:
push:
branches:
- main
workflow_dispatch:

# Allow OIDC token issuance for AWS credential exchange.
Expand Down
9 changes: 9 additions & 0 deletions services/context-builder/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for the Context Builder: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/context-builder/Dockerfile.lambda -t context-builder-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/context-builder /build/context-builder
RUN pip install --no-cache-dir /build/context-builder[lambda]

CMD ["context_builder.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/context-builder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ dependencies = [
"pyyaml>=6.0",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
context-builder = "context_builder.app:run"

Expand Down
18 changes: 18 additions & 0 deletions services/context-builder/src/context_builder/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from context_builder.app import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/delivery-router/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for delivery-router: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/delivery-router/Dockerfile.lambda -t delivery-router-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/delivery-router /build/delivery-router
RUN pip install --no-cache-dir /build/delivery-router[lambda]

CMD ["delivery_router.lambda_handler.handler"]
3 changes: 3 additions & 0 deletions services/delivery-router/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ dependencies = [
"uvicorn>=0.30",
]

[project.optional-dependencies]
lambda = ["mangum>=0.19"]

[project.scripts]
delivery-router = "delivery_router.app:run"

Expand Down
18 changes: 18 additions & 0 deletions services/delivery-router/src/delivery_router/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from delivery_router.app import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/delivery-targets/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for the Delivery Targets LLM Decision Service.
# Build from the repo root:
# docker build -f services/delivery-targets/Dockerfile.lambda -t delivery-targets-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/delivery-targets /build/delivery-targets
RUN pip install --no-cache-dir /build/delivery-targets[lambda]

CMD ["delivery_targets.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/delivery-targets/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ dependencies = [
"boto3>=1.35",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
delivery-targets = "delivery_targets.api:run"

Expand Down
18 changes: 18 additions & 0 deletions services/delivery-targets/src/delivery_targets/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from delivery_targets.api import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/event-consumer/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for the Event Consumer: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/event-consumer/Dockerfile.lambda -t event-consumer-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/event-consumer /build/event-consumer
RUN pip install --no-cache-dir /build/event-consumer[lambda]

CMD ["event_consumer.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/event-consumer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ dependencies = [
"uvicorn>=0.30",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
event-consumer = "event_consumer.app:run"

Expand Down
18 changes: 18 additions & 0 deletions services/event-consumer/src/event_consumer/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from event_consumer.app import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/field-mapping/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for field-mapping: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/field-mapping/Dockerfile.lambda -t field-mapping-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/field-mapping /build/field-mapping
RUN pip install --no-cache-dir /build/field-mapping[lambda]

CMD ["field_mapping.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/field-mapping/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ dependencies = [
"boto3>=1.35",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
field-mapping = "field_mapping.api:run"

Expand Down
18 changes: 18 additions & 0 deletions services/field-mapping/src/field_mapping/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL. Local/
compose runs never import this module, so ``mangum`` is an optional (``[lambda]``)
dependency.
"""

from __future__ import annotations

from mangum import Mangum

from field_mapping.api import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/field-synthesis/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for field-synthesis: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/field-synthesis/Dockerfile.lambda -t field-synthesis-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/field-synthesis /build/field-synthesis
RUN pip install --no-cache-dir /build/field-synthesis[lambda]

CMD ["field_synthesis.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/field-synthesis/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ dependencies = [
"boto3>=1.35",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
field-synthesis = "field_synthesis.api:run"

Expand Down
18 changes: 18 additions & 0 deletions services/field-synthesis/src/field_synthesis/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL. Local/
compose runs never import this module, so ``mangum`` is an optional (``[lambda]``)
dependency.
"""

from __future__ import annotations

from mangum import Mangum

from field_synthesis.api import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
13 changes: 13 additions & 0 deletions services/learncard-wallet-adapter/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Container-image Lambda for learncard-wallet-adapter: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/learncard-wallet-adapter/Dockerfile.lambda -t learncard-wallet-adapter-lambda .
FROM public.ecr.aws/lambda/python:3.12

# Workspace path dep (not on PyPI) first, then the service (same pattern as
# mock-lms's libs/events install).
COPY libs/learncard-api /build/learncard-api
COPY services/learncard-wallet-adapter /build/learncard-wallet-adapter
RUN pip install --no-cache-dir /build/learncard-api \
&& pip install --no-cache-dir /build/learncard-wallet-adapter[lambda]

CMD ["learncard_wallet_adapter.lambda_handler.handler"]
3 changes: 3 additions & 0 deletions services/learncard-wallet-adapter/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ dependencies = [
"uvicorn>=0.30",
]

[project.optional-dependencies]
lambda = ["mangum>=0.19"]

[project.scripts]
learncard-wallet-adapter = "learncard_wallet_adapter.app:run"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from learncard_wallet_adapter.app import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
15 changes: 15 additions & 0 deletions services/mock-lms/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Container-image Lambda for the Mock LMS: FastAPI via Mangum behind a Function URL.
# Build from the repo root (needs the libs/events workspace path dependency):
# docker build -f services/mock-lms/Dockerfile.lambda -t mock-lms-lambda .
FROM public.ecr.aws/lambda/python:3.12

# skills-mobility-events is a uv-workspace path dependency, not on PyPI. Install it
# first so the service install below finds the requirement already satisfied
# instead of reaching out to PyPI for it.
COPY libs/events /build/events
COPY services/mock-lms /build/mock-lms
RUN pip install --no-cache-dir /build/events \
&& pip install --no-cache-dir /build/mock-lms[lambda]

# module.function the Lambda runtime imports.
CMD ["mock_lms.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/mock-lms/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ dependencies = [
"uvicorn>=0.30",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
mock-lms = "mock_lms.app:run"
# Authoring tool: generate + capture fixtures. Requires the dev dependency group (Faker).
Expand Down
18 changes: 18 additions & 0 deletions services/mock-lms/src/mock_lms/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from mock_lms.app import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/orchestrator/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for the Orchestrator: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/orchestrator/Dockerfile.lambda -t orchestrator-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/orchestrator /build/orchestrator
RUN pip install --no-cache-dir /build/orchestrator[lambda]

CMD ["orchestrator.lambda_handler.handler"]
4 changes: 4 additions & 0 deletions services/orchestrator/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ dependencies = [
"httpx>=0.27",
]

[project.optional-dependencies]
# Installed only in the container-image Lambda build; keeps local/compose lean.
lambda = ["mangum>=0.19"]

[project.scripts]
orchestrator = "orchestrator.app:run"

Expand Down
18 changes: 18 additions & 0 deletions services/orchestrator/src/orchestrator/lambda_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""AWS Lambda entrypoint.

Wraps the FastAPI app with Mangum so the same ASGI app that serves locally under
uvicorn runs unchanged as a container-image Lambda behind a Function URL (the
synchronous HTTP demo topology; no async event model). Local/compose runs never
import this module, so ``mangum`` is an optional (``[lambda]``) dependency.
"""

from __future__ import annotations

from mangum import Mangum

from orchestrator.app import create_app

# lifespan="off": Mangum's default runs the ASGI shutdown after each event,
# which closes long-lived clients (httpx) and breaks warm reinvocations —
# Lambda's freeze/thaw model has no meaningful ASGI shutdown point.
handler = Mangum(create_app(), lifespan="off")
9 changes: 9 additions & 0 deletions services/transformation-executor/Dockerfile.lambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Container-image Lambda for transformation-executor: FastAPI via Mangum behind a Function URL.
# Build from the repo root:
# docker build -f services/transformation-executor/Dockerfile.lambda -t transformation-executor-lambda .
FROM public.ecr.aws/lambda/python:3.12

COPY services/transformation-executor /build/transformation-executor
RUN pip install --no-cache-dir /build/transformation-executor[lambda]

CMD ["transformation_executor.lambda_handler.handler"]
Loading
Loading