Skip to content
Open
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
2 changes: 1 addition & 1 deletion backend/health/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
@api_view(["GET"])
@require_http_methods(["GET"])
def health_check(request: Request) -> Response:
logger.debug("Verifying backend health..")
logger.debug("Verifying backend health")
return Response(status=200)
8 changes: 5 additions & 3 deletions docker/dockerfiles/backend.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Use a specific version of Python slim image
FROM python:3.12-slim-trixie AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="Backend Service Container" \
version="${VERSION}"
description="Backend Service Container"

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
Expand Down Expand Up @@ -80,4 +78,8 @@ RUN if [ -f requirements.txt ]; then \

EXPOSE 8000

# Capture build version at the very end so it doesn't affect layer caching
ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}
Comment on lines +82 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 UNSTRACT_APPS_VERSION env var set but never consumed

UNSTRACT_APPS_VERSION is now baked into every image as a runtime environment variable, but a search of the entire codebase shows zero consumers of this variable — no Python code, Helm chart, or CI script reads it.

Setting an ENV here does still create a Docker layer (unlike LABEL), which means it will be rebuilt every time VERSION changes. The cache-fix goal is fully achieved by simply omitting the ARG/ENV entirely at the end. If the intent is to make the version introspectable at runtime (e.g. for a /health or /version endpoint), that's a good goal — but the consuming code hasn't been added yet.

The same applies to all seven Dockerfiles in this PR (platform.Dockerfile, prompt.Dockerfile, runner.Dockerfile, tool-sidecar.Dockerfile, worker-unified.Dockerfile, x2text.Dockerfile).

If you want to keep it for future use, consider adding a comment explaining its purpose so reviewers don't treat it as dead configuration.

Prompt To Fix With AI
This is a comment left during a code review.
Path: docker/dockerfiles/backend.Dockerfile
Line: 82-83

Comment:
**`UNSTRACT_APPS_VERSION` env var set but never consumed**

`UNSTRACT_APPS_VERSION` is now baked into every image as a runtime environment variable, but a search of the entire codebase shows zero consumers of this variable — no Python code, Helm chart, or CI script reads it.

Setting an `ENV` here does still create a Docker layer (unlike `LABEL`), which means it will be rebuilt every time `VERSION` changes. The cache-fix goal is fully achieved by simply omitting the `ARG`/`ENV` entirely at the end. If the intent is to make the version introspectable at runtime (e.g. for a `/health` or `/version` endpoint), that's a good goal — but the consuming code hasn't been added yet.

The same applies to all seven Dockerfiles in this PR (`platform.Dockerfile`, `prompt.Dockerfile`, `runner.Dockerfile`, `tool-sidecar.Dockerfile`, `worker-unified.Dockerfile`, `x2text.Dockerfile`).

If you want to keep it for future use, consider adding a comment explaining its purpose so reviewers don't treat it as dead configuration.

How can I resolve this? If you propose a fix, please make it concise.


ENTRYPOINT [ "./entrypoint.sh" ]
7 changes: 4 additions & 3 deletions docker/dockerfiles/platform.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Use a specific version of Python slim image
FROM python:3.12-slim-trixie AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="Platform Service Container" \
version="${VERSION}"
description="Platform Service Container"

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
Expand Down Expand Up @@ -82,5 +80,8 @@ RUN uv sync --group deploy --locked && \

EXPOSE 3001

ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}

# During debugging, this entry point will be overridden
CMD [".venv/bin/gunicorn", "--bind", "0.0.0.0:3001", "--timeout", "300", "unstract.platform_service.run:app"]
7 changes: 4 additions & 3 deletions docker/dockerfiles/prompt.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Use a specific version of Python slim image
FROM python:3.12-slim-trixie AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="Prompt Service Container" \
version="${VERSION}"
description="Prompt Service Container"

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
Expand Down Expand Up @@ -97,4 +95,7 @@ RUN mkdir -p prompt-studio-data

EXPOSE 3003

ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}

CMD ["./entrypoint.sh"]
7 changes: 4 additions & 3 deletions docker/dockerfiles/runner.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Use a specific version of Python slim image
FROM python:3.12-slim-trixie AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="Runner Service Container" \
version="${VERSION}"
description="Runner Service Container"

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
Expand Down Expand Up @@ -83,4 +81,7 @@ RUN if [ -f cloud_requirements.txt ]; then \

EXPOSE 5002

ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}

CMD [ "./entrypoint.sh" ]
7 changes: 4 additions & 3 deletions docker/dockerfiles/tool-sidecar.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Use Python 3.12.9-slim for minimal size
FROM python:3.12-slim-trixie AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="Tool Sidecar Container" \
version="${VERSION}"
description="Tool Sidecar Container"

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
Expand Down Expand Up @@ -81,4 +79,7 @@ RUN uv sync --group deploy --locked && \
uv run opentelemetry-bootstrap -a requirements | uv pip install --requirement - && \
chmod +x ./entrypoint.sh

ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}

CMD ["./entrypoint.sh"]
8 changes: 5 additions & 3 deletions docker/dockerfiles/worker-unified.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Unified Worker Dockerfile - Optimized for fast builds
FROM python:3.12.9-slim AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="Unified Worker Container for All Worker Types" \
version="${VERSION}"
description="Unified Worker Container for All Worker Types"

# Set environment variables (CRITICAL: PYTHONPATH makes paths work!)
ENV PYTHONDONTWRITEBYTECODE=1 \
Expand Down Expand Up @@ -87,6 +85,10 @@ RUN uv sync --group deploy --locked && \
USER worker


# Capture build version at the very end so it doesn't affect layer caching
ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}

# Default command - runs the Docker-optimized worker script
ENTRYPOINT ["/app/run-worker-docker.sh"]
CMD ["general"]
7 changes: 4 additions & 3 deletions docker/dockerfiles/x2text.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Use a specific version of Python slim image
FROM python:3.12-slim-trixie AS base

ARG VERSION=dev
LABEL maintainer="Zipstack Inc." \
description="X2Text Service Container" \
version="${VERSION}"
description="X2Text Service Container"

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
Expand Down Expand Up @@ -70,5 +68,8 @@ RUN uv sync --group deploy --locked && \

EXPOSE 3004

ARG VERSION=dev
ENV UNSTRACT_APPS_VERSION=${VERSION}

# During debugging, this entry point will be overridden.
CMD [".venv/bin/gunicorn", "--bind", "0.0.0.0:3004", "--timeout", "300", "run:app"]
2 changes: 1 addition & 1 deletion prompt-service/src/unstract/prompt_service/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create_app() -> Flask:
log_level = getattr(logging, log_level, logging.INFO)
app = Flask("prompt-service")
app.logger.setLevel(log_level)
app.logger.info("Initializing Flask application...")
app.logger.info("Initializing Flask application")

# Load plugins
plugins_dir = Path(__file__).parent / "plugins"
Expand Down
Loading