diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ef1445..f414148 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,8 +57,7 @@ jobs: cache-to: type=gha,mode=max,scope=stt backfill: - # On private->public flip or manual re-run: build every existing v* tag, - # both images per tag. + # On private->public flip or manual re-run: build each v* tag that has no published image; a published image is never overwritten. if: github.event_name == 'public' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: @@ -80,17 +79,24 @@ jobs: echo "No v* tags found, nothing to backfill." exit 0 fi + build_missing() { + if docker manifest inspect "$1" >/dev/null 2>&1; then + echo "$1 is published, skipped" + else + docker build -t "$1" -f "$2" . + docker push "$1" + fi + } for tag in $tags; do echo "::group::$tag" git checkout "$tag" - docker build -t "$WIZARD_IMAGE:$tag" -f Dockerfile . - docker push "$WIZARD_IMAGE:$tag" - docker build -t "$STT_IMAGE:$tag" -f stt-service/Dockerfile . - docker push "$STT_IMAGE:$tag" + build_missing "$WIZARD_IMAGE:$tag" Dockerfile + build_missing "$STT_IMAGE:$tag" stt-service/Dockerfile echo "::endgroup::" done latest=$(echo "$tags" | tail -1) - docker tag "$WIZARD_IMAGE:$latest" "$WIZARD_IMAGE:latest" - docker push "$WIZARD_IMAGE:latest" - docker tag "$STT_IMAGE:$latest" "$STT_IMAGE:latest" - docker push "$STT_IMAGE:latest" + for image in "$WIZARD_IMAGE" "$STT_IMAGE"; do + docker pull "$image:$latest" + docker tag "$image:$latest" "$image:latest" + docker push "$image:latest" + done diff --git a/Dockerfile b/Dockerfile index 90a6db8..4609db7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # Stage 1: Get the library -FROM ghcr.io/action-prediction-lab/pepper-box:latest AS bridge-source +FROM ghcr.io/action-prediction-lab/pepper-box:v2.3.1@sha256:cb296a2ac483ac7d5789bc0367227464b191c6da9110b9db5c565bb81938d8f8 AS bridge-source # Stage 2: Build the Wizard -FROM python:3.9-slim +FROM python:3.9-slim@sha256:2d97f6910b16bd338d3060f261f53f144965f755599aab1acda1e13cf1731b1b # Set the working directory in the container WORKDIR /usr/src/app @@ -17,6 +17,10 @@ RUN apt-get update && apt-get install -y \ # Copy the requirements file into the container COPY requirements.txt . +# Every pip install takes package versions from constraints.txt, the package list of the v2.3.1 image +COPY constraints.txt . +ENV PIP_CONSTRAINT=/usr/src/app/constraints.txt + # Install base requirements RUN pip install --no-cache-dir -r requirements.txt diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 0000000..6e2686f --- /dev/null +++ b/constraints.txt @@ -0,0 +1,67 @@ +Flask==3.1.3 +Jinja2==3.1.6 +MarkupSafe==3.0.3 +PyYAML==6.0.3 +Werkzeug==3.1.8 +annotated-types==0.7.0 +anthropic==0.105.2 +anyio==4.12.1 +av==15.1.0 +blinker==1.9.0 +certifi==2026.5.20 +charset-normalizer==3.4.7 +click==8.1.8 +distro==1.9.0 +docstring_parser==0.18.0 +exceptiongroup==1.3.1 +filelock==3.19.1 +fsspec==2025.10.0 +h11==0.16.0 +hf-xet==1.5.0 +httpcore==1.0.9 +httpx==0.28.1 +huggingface_hub==0.36.2 +idna==3.18 +importlib_metadata==8.7.1 +itsdangerous==2.2.0 +jiter==0.15.0 +mpmath==1.3.0 +networkx==3.2.1 +numpy==2.0.2 +nvidia-cublas-cu12==12.8.4.1 +nvidia-cuda-cupti-cu12==12.8.90 +nvidia-cuda-nvrtc-cu12==12.8.93 +nvidia-cuda-runtime-cu12==12.8.90 +nvidia-cudnn-cu12==9.10.2.21 +nvidia-cufft-cu12==11.3.3.83 +nvidia-cufile-cu12==1.13.1.3 +nvidia-curand-cu12==10.3.9.90 +nvidia-cusolver-cu12==11.7.3.90 +nvidia-cusparse-cu12==12.5.8.93 +nvidia-cusparselt-cu12==0.7.1 +nvidia-nccl-cu12==2.27.3 +nvidia-nvjitlink-cu12==12.8.93 +nvidia-nvtx-cu12==12.8.90 +opencv-python-headless==4.13.0.92 +packaging==26.2 +prompt_toolkit==3.0.52 +pydantic==2.13.4 +pydantic_core==2.46.4 +pyzmq==27.1.0 +regex==2026.1.15 +requests==2.32.5 +safetensors==0.7.0 +scipy==1.13.1 +sentencepiece==0.2.1 +sniffio==1.3.1 +sympy==1.14.0 +tokenizers==0.22.2 +torch==2.8.0 +tqdm==4.67.3 +transformers==4.57.6 +triton==3.4.0 +typing-inspection==0.4.2 +typing_extensions==4.15.0 +urllib3==2.6.3 +wcwidth==0.7.0 +zipp==3.23.1 diff --git a/requirements.txt b/requirements.txt index cc06b03..7676cbf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ prompt_toolkit numpy scipy transformers -torch --extra-index-url https://download.pytorch.org/whl/cpu +torch sentencepiece anthropic av