diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f13fb043..07d815b3 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -39,7 +39,7 @@ jobs: packages: write strategy: matrix: - image: [extproc, llm-katan, dashboard] + image: [extproc, llm-katan, dashboard, model-downloader] # Multi-architecture build strategy: # - AMD64: Native build on ubuntu-latest (fast) # - ARM64: Cross-compilation on ubuntu-latest (faster than emulation) @@ -171,6 +171,10 @@ jobs: echo "context=." >> $GITHUB_OUTPUT echo "dockerfile=./dashboard/backend/Dockerfile" >> $GITHUB_OUTPUT echo "platform=linux/${{ matrix.arch }}" >> $GITHUB_OUTPUT + elif [ "${{ matrix.image }}" = "model-downloader" ]; then + echo "context=." >> $GITHUB_OUTPUT + echo "dockerfile=./Dockerfile.model-downloader" >> $GITHUB_OUTPUT + echo "platform=linux/${{ matrix.arch }}" >> $GITHUB_OUTPUT fi - name: Generate tags @@ -236,7 +240,7 @@ jobs: packages: write strategy: matrix: - image: [extproc, llm-katan, dashboard] + image: [extproc, llm-katan, dashboard, model-downloader] steps: - name: Log in to GitHub Container Registry diff --git a/Dockerfile.model-downloader b/Dockerfile.model-downloader new file mode 100644 index 00000000..6883e87d --- /dev/null +++ b/Dockerfile.model-downloader @@ -0,0 +1,24 @@ +FROM python:3.11-slim + +# Set environment variables +ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_NO_CACHE_DIR=1 \ + PYTHONUNBUFFERED=1 + +# Add OCI labels +LABEL org.opencontainers.image.source="https://github.com/vllm-project/semantic-router" \ + org.opencontainers.image.description="Lightweight model downloader for Semantic Router with huggingface_hub pre-installed" + +WORKDIR /app + +# Install minimal dependencies in a single layer +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ + && pip install --no-cache-dir "huggingface_hub>=0.19.0" \ + && find /usr/local -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true \ + && find /usr/local -type f -name '*.pyc' -delete + +# Set default entrypoint to bash to allow script execution from arguments +ENTRYPOINT ["/bin/bash", "-c"]