Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/jmrplens/phonometry. Standards-conformant acoustics library for Python: measurement and metrology, docs.jmrp.io/phonometry
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455#!/bin/sh# Provision a phonometry node image: Python 3.13 with the pinned requirements# and the figure stack, the DejaVu fonts the figures are drawn with, a static# ffmpeg build and make. Run once by each stage of docker/node/Dockerfile, on# Ubuntu 24.04 with or without CUDA, with FFMPEG_URL and FFMPEG_SHA256 set by# the Dockerfile.## The apt packages go unpinned: Ubuntu replaces them with each security fix,# and the deadsnakes PPA keeps only the latest build of each Python patch# release, so an exact version would stop the image building at the next one.# Ubuntu 24.04 ships Python 3.12, so Python 3.13 comes from that PPA; its# signing key is fetched by its full fingerprint, and the build stops unless# the file holds that one key.## ffmpeg is not Ubuntu's, whose 6.1 carries SVT-AV1 1.7: the documentation# clips' SVT-AV1 setting is calibrated on SVT-AV1 4, and a CRF means# something else from one SVT-AV1 major release to the next. The download is# checked against the SHA-256 the Dockerfile pins before anything in it is# unpacked, and the build stops on a different sum, a failed download or an# empty pin. Only ffmpeg, ffprobe and the build's licence are kept.set -eu: "${FFMPEG_URL:?docker/node/Dockerfile pins it}" "${FFMPEG_SHA256:?docker/node/Dockerfile pins it}"key=F23C5A6CF475977595C89F51BA6932366A755776apt-get updateapt-get install -y --no-install-recommends \ ca-certificates curl gnupg make xz-utils fonts-dejavu-core fontconfigcurl -fsSL --proto '=https' --retry 3 -o /tmp/ffmpeg.tar.xz "$FFMPEG_URL"printf '%s %s\n' "$FFMPEG_SHA256" /tmp/ffmpeg.tar.xz | sha256sum -c -mkdir /tmp/ffmpegtar -xJf /tmp/ffmpeg.tar.xz -C /tmp/ffmpeg --strip-components=1install -m 0755 /tmp/ffmpeg/bin/ffmpeg /tmp/ffmpeg/bin/ffprobe /usr/local/bin/install -D -m 0644 /tmp/ffmpeg/LICENSE.txt /usr/local/share/doc/ffmpeg/LICENSE.txtrm -rf /tmp/ffmpeg /tmp/ffmpeg.tar.xzinstall -d -m 0755 /etc/apt/keyringscurl -fsSL --proto '=https' --retry 3 -o /etc/apt/keyrings/deadsnakes.asc \ "https://keyserver.ubuntu.com/pks/lookup?op=get&options=mr&search=0x$key"gpg --show-keys --with-colons /etc/apt/keyrings/deadsnakes.asc > /tmp/deadsnakes.keystest "$(grep -c '^pub:' /tmp/deadsnakes.keys)" = 1grep -q "^fpr:::::::::$key:\$" /tmp/deadsnakes.keysrm -rf /tmp/deadsnakes.keys /root/.gnupgprintf '%s\n' "Types: deb" \ "URIs: https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu" \ "Suites: noble" "Components: main" \ "Signed-By: /etc/apt/keyrings/deadsnakes.asc" \ > /etc/apt/sources.list.d/deadsnakes.sourcesapt-get updateapt-get install -y --no-install-recommends python3.13 python3.13-venvapt-get purge -y curlapt-get autoremove -yrm -rf /var/lib/apt/lists/*python3.13 -m venv /opt/venv/opt/venv/bin/pip install --no-cache-dir \ -r /tmp/node/requirements.txt -r /tmp/node/requirements-figures.txtrm -rf /tmp/node