Commit a250228b authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Revert to the proven non-Docker CI setup, keep the deploy_prod SSH key fix

Confirmed via the GitLab API: the non-Docker test job (torch/demucs removed,
cached static ffmpeg, sidechain test fixed) already ran successfully in
4m14s (pipeline 1016). A second run of the same setup spiked to 26 minutes
due to runner contention unrelated to what's installed - the Docker Hub
pre-baked image wouldn't reliably fix that either, so dropping that
direction rather than adding a registry/visibility decision for marginal,
inconsistent benefit.

The revert to 9a952fea's .gitlab-ci.yml would have also reintroduced the
already-fixed deploy_prod SSH key bug (chmod on raw key text instead of a
written-out file) - confirmed via API that pipeline 1019's deploy_prod
failed on exactly that. Re-applied that fix on top of the reverted test job.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent 6b0d6620
Pipeline #1024 canceled with stages
in 48 minutes and 13 seconds
stages: stages:
- build
- test - test
- deploy - deploy
variables: variables:
CI_TEST_IMAGE: "$DOCKERHUB_USER/stax-ci-test:latest" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
FFMPEG_CACHE_DIR: "$CI_PROJECT_DIR/.cache/ffmpeg-static"
# Manual only - builds Dockerfile.ci (system packages + all of requirements.txt already cache:
# installed) and pushes it to Docker Hub. Run this by hand (Build > Pipelines > this pipeline key: ${CI_COMMIT_REF_SLUG}
# > play button on build_ci_image) the first time, and again whenever requirements.txt or paths:
# Dockerfile.ci's system deps change. The test job below pulls whatever this last pushed - - .cache/pip/
# nothing else in this pipeline rebuilds it automatically. - .cache/ffmpeg-static/
#
# Needs DOCKERHUB_USER and DOCKERHUB_TOKEN as CI/CD variables (Settings > CI/CD > Variables) -
# DOCKERHUB_TOKEN should be a Docker Hub access token (hub.docker.com > Account Settings >
# Security > New Access Token), not your account password.
build_ci_image:
stage: build
image: docker:24.0
services:
- docker:24.0-dind
variables:
DOCKER_TLS_CERTDIR: "/certs"
before_script:
- echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USER" --password-stdin
script:
- docker build -t "$CI_TEST_IMAGE" -f Dockerfile.ci .
- docker push "$CI_TEST_IMAGE"
when: manual
only:
- dev
- main
# Runs on every push to dev or main. Pulls the pre-baked image built above and just runs # Runs on every push to dev or main. No deploy here - just fast feedback while you're
# pytest - no apt-get, no pip install, no ffmpeg download here anymore. All of that cost was # developing on dev, and a second confirmation right before deploy_prod fires on main.
# moved into build_ci_image, which only runs when someone triggers it, not on every push.
test: test:
stage: test stage: test
image: "$CI_TEST_IMAGE" image: python:3.10-slim
before_script:
# apt's `ffmpeg` package drags in ~185 packages (video codecs, X11/Mesa, fonts, speech
# recognition libs) that took ~3min to unpack/configure on this runner, for functionality
# this project never uses (audio-only). A static, dependency-free ffmpeg build sidesteps
# apt/dpkg entirely - cached across runs so even the download only happens once. git isn't
# needed here at all (GitLab's own checkout doesn't use the job container's git).
- apt-get update -qq && apt-get install -y -qq --no-install-recommends libsndfile1 curl ca-certificates xz-utils
- |
if [ ! -x "$FFMPEG_CACHE_DIR/ffmpeg" ]; then
mkdir -p "$FFMPEG_CACHE_DIR"
curl -sL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o /tmp/ffmpeg.tar.xz
tar -xf /tmp/ffmpeg.tar.xz -C /tmp
cp /tmp/ffmpeg-*-amd64-static/ffmpeg /tmp/ffmpeg-*-amd64-static/ffprobe "$FFMPEG_CACHE_DIR/"
fi
cp "$FFMPEG_CACHE_DIR/ffmpeg" "$FFMPEG_CACHE_DIR/ffprobe" /usr/local/bin/
# No torch/demucs here on purpose - requirements-remix.txt (the heavy stem-separation
# model) is prod-only. Nothing in the test suite needs the real separator; see
# remix_engine.py's _get_separator() and requirements-remix.txt for why that's safe.
- pip install --prefer-binary -q -r requirements.txt
script: script:
- PYTHONPATH=. pytest tests/ -v - PYTHONPATH=. pytest tests/ -v
only: only:
......
# Pre-baked CI test image - system packages AND all of requirements.txt already installed,
# so the test job in .gitlab-ci.yml does nothing but pull this image and run pytest. Every
# apt-get/pip cost that used to happen on every single push happens once here instead, when
# this image gets rebuilt (manually, via the build_ci_image job, whenever requirements.txt or
# these system deps change).
#
# Deliberately excludes requirements-remix.txt (torch/demucs) - nothing in the test suite
# needs the real stem-separation model, see remix_engine.py's _get_separator(). Keeping this
# image to only what tests actually need is what keeps it (and every pull of it) small.
FROM python:3.10-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --prefer-binary -r /tmp/requirements.txt
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