Commit 715396bf authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Add manual job to build a pre-baked CI test image (phase 1/2)

apt-get install ffmpeg/git/libsndfile1 in the test job takes ~2m50s every
single push (confirmed from a job log: ffmpeg drags in ~185 packages -
video codecs, X11/Mesa/GL, fonts, speech-recognition libs - none of which
this project uses), and none of it is cacheable the way pip's downloads are.

This adds build_ci_image (when: manual, new "build" stage) which builds
Dockerfile.ci and pushes it to this project's Container Registry. It does
not touch the test job yet - purely additive, so if this runner turns out
not to support Docker-in-Docker, nothing about the existing working pipeline
changes. Once this job is confirmed to succeed, a follow-up commit switches
test's image to the built one and drops its apt-get step.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent 4a81091f
Pipeline #1014 passed with stages
in 19 minutes and 12 seconds
stages:
- build
- test
- deploy
......@@ -10,6 +11,28 @@ cache:
paths:
- .cache/pip/
# Manual only - builds and pushes the pre-baked test image (Dockerfile.ci) to this project's
# Container Registry. Run this by hand (Build > Pipelines > this pipeline > play button) once,
# and again whenever Dockerfile.ci's system deps change. Doesn't touch the test job below on
# its own - that's switched over separately once this is confirmed working, so a failure here
# (e.g. if this runner doesn't support Docker-in-Docker) can't break the normal pipeline.
build_ci_image:
stage: build
image: docker:24.0
services:
- docker:24.0-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- docker build -t "$CI_REGISTRY_IMAGE/ci-test:latest" -f Dockerfile.ci .
- docker push "$CI_REGISTRY_IMAGE/ci-test:latest"
when: manual
only:
- dev
- main
# Runs on every push to dev or main. No deploy here - just fast feedback while you're
# developing on dev, and a second confirmation right before deploy_prod fires on main.
test:
......
# Pre-baked CI test image - exists purely so the `test` job in .gitlab-ci.yml doesn't have to
# apt-get install ffmpeg (and its ~180-package dependency tree: video codecs, X11/Mesa/GL,
# fonts, speech-recognition libs, none of which this project uses) on every single push.
# Rebuild via the manual build_ci_image job whenever these system deps change.
FROM python:3.10-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg git libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment