From 46b575421936bc428d1533b882781a1c145447f9 Mon Sep 17 00:00:00 2001 From: Brian McMahon Date: Tue, 14 Apr 2026 09:39:31 -0700 Subject: [PATCH] Exclude alpha-engine-lib from Phase 2 Lambda Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Dockerfile installs requirements by shell-splitting grep output and passing each line as a positional arg to pip install. This doesn't work for the alpha-engine-lib entry because it's a pip URL-style requirement (`pkg @ git+https://...`) with whitespace and an `@` separator — the shell splits it into three args and pip errors with "Invalid requirement: '@'". Phase 2 Lambda (lambda/handler.py) doesn't import from alpha-engine-lib — only weekly_collector.main() (the EC2 entrypoint) does. Excluding the dep from the Lambda build is the minimal fix and avoids the need to wire a GitHub PAT into the Docker build as a build secret. If a future Phase 2 change starts importing from alpha-engine-lib, remove this filter and add `--mount=type=secret,id=lib_token` to the RUN step plus matching `build-args` / `secrets` in deploy.yml. Co-Authored-By: Claude Opus 4.6 (1M context) --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ff6dac..a6c3edd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,15 @@ FROM --platform=linux/amd64 public.ecr.aws/lambda/python:3.12 -# Install dependencies (exclude boto3/botocore — pre-installed in Lambda) +# Install dependencies (exclude boto3/botocore — pre-installed in Lambda). +# alpha-engine-lib is excluded because the Phase 2 Lambda handler (lambda/handler.py) +# doesn't import from it — only weekly_collector.main() (the EC2 entry point) does. +# Including it would require wiring a GitHub PAT into the Docker build as a secret, +# which is ceremony for zero benefit here. If a future Phase 2 change imports from +# alpha-engine-lib, remove this filter and add --mount=type=secret,id=lib_token +# plus the matching deploy.yml build-secrets wiring. COPY requirements.txt ${LAMBDA_TASK_ROOT}/ RUN pip install --no-cache-dir \ - $(grep -vE "^#|^$|^pytest|^python-dotenv|^boto3|^botocore|^s3transfer" requirements.txt) \ + $(grep -vE "^#|^$|^pytest|^python-dotenv|^boto3|^botocore|^s3transfer|^alpha-engine-lib" requirements.txt) \ && rm -rf /root/.cache/pip # Copy application code