Sign inSign up

sprakbankental/python

By sprakbankental

Updated 5 months ago

Python runtime for SBT OS

Image
0

1.7K

sprakbankental/python repository overview

sprakbankental/python

Språkbanken Tal's Python resource image. Provides CPython 3.12.13 built from source and a curated set of Python packages, on top of sprakbankental/os-ubuntu.

This is a resource cache image: its primary purpose is to supply Python and packages to downstream images via COPY --from=. It can also be run directly.

GPU exception: SBTal GPU machines run pinned Nvidia-optimised containers (nvcr.io/nvidia/pytorch) rather than standard SBTal runtime containers. This image is not used on GPU machines. GPU-specific Python environments are managed through the Nvidia container stack and are outside the scope of the oci-basic cascade.

What's included

Python
  • CPython 3.12.13 — built from source; installed at /opt/python
  • /usr/bin/python3 and /usr/bin/python3.12 symlinks
  • pip 25.1.1; /usr/bin/pip3 symlink
Packages

Two groups of packages are installed on top of CPython.

Audio packages

Provides librosa and its full transitive closure (16 packages):

  • pycparser 3.0, cffi 2.0.0
  • certifi 2026.4.22, idna 3.13, urllib3 2.6.3, requests 2.33.1
  • platformdirs 4.9.6, audioread 3.1.0, decorator 5.2.1
  • lazy-loader 0.5, msgpack 1.1.2, soxr 1.0.0
  • typing-extensions 4.15.0, pooch 1.9.0
  • soundfile 0.13.1, librosa 0.11.0
Scientific and ML packages

Provides numpy, scipy, pandas, scikit-learn, matplotlib, umap-learn, and mlxtend with their dependencies (24 packages):

  • numpy 2.4.4, scipy 1.17.1
  • pandas 3.0.2, pyarrow 24.0.0
  • joblib 1.5.3, threadpoolctl 3.6.0, scikit-learn 1.8.0
  • contourpy 1.3.3, cycler 0.12.1, fonttools 4.62.1, kiwisolver 1.5.0, pillow 12.2.0, pyparsing 3.3.2, packaging 26.2, matplotlib 3.10.9
  • kneed 0.8.6
  • llvmlite 0.47.0, numba 0.65.1, pynndescent 0.6.0, umap-learn 0.5.12
  • mlxtend 0.24.0
  • six 1.17.0, python-dateutil 2.9.0.post0, tqdm 4.67.3
R bridge
  • rpy2 3.6.7 — Python interface to R; compiles C extensions against libR.so supplied by sprakbankental/os-ubuntu.

All package versions are pinned. To inspect them:

show-sbt-env versions
Fixture-sensitive pins

Three package versions are hard constraints. They must not be changed without a deliberate decision and full regression testing of downstream fixtures:

PackageVersionReason
scikit-learn1.8.0Cluster assignments and model outputs in downstream fixtures are tied to this version. Upgrading may silently change numeric results.
umap-learn0.5.12UMAP embeddings are non-deterministic across versions even with a fixed random seed. Fixture data requires full regeneration on any version change.
mlxtend0.24.0Association rule fixtures depend on mlxtend's internal computation. Output format and numeric values may shift across versions.

Usage

As a resource cache in a downstream Dockerfile
ARG OCI_BASIC_VERSION=stable

FROM sprakbankental/python:${OCI_BASIC_VERSION}-aggr AS aggr-python

FROM sprakbankental/os-ubuntu:${OCI_BASIC_VERSION} AS prod-env
# ...

FROM prod-env AS prod
RUN --mount=type=bind,from=aggr-python,source=/artifacts,target=/artifacts \
    cp -a /artifacts/. /

The -aggr tag carries the artifact tree only (no OS layer). Use it as the source for COPY --from= or bind-mount operations.

Running directly
docker run --rm sprakbankental/python:stable python3 --version
docker run --rm sprakbankental/python:stable python3 -c "import librosa; print(librosa.__version__)"

Tags

Follows the same tag scheme as sprakbankental/os-ubuntu. See that image for the full tag reference.

Each version publishes two targets:

Tag suffixContents
(none)Full runnable image (runtime stage)
-aggrArtifact tree only; use as a COPY --from= source

Changes

v1.6.3
  • NEW: rpy2 3.6.7 — Python–R bridge; installed in prep-r-bridge. Requires libR.so from sprakbankental/os-ubuntu (also new in v1.6.3).
  • sprakbankental/python wired into sprakbankental/os assembly image.
v1.6.2
  • NEW: sprakbankental/python image added to the cascade.
  • CPython 3.12.13 built from source; installed at /opt/python.
  • Audio packages: librosa 0.11.0 and closure (16 packages).
  • ML packages: numpy 2.4.4, scipy 1.17.1, scikit-learn 1.8.0, umap-learn 0.5.12, mlxtend 0.24.0, matplotlib 3.10.9, numba 0.65.1 / llvmlite 0.47.0 and closure (24 packages).

Planned changes

A future version will split the -aggr tag into two tiers:

  • sprakbankental/python — CPython and audio packages only
  • sprakbankental/python-ml — inherits python, adds the scientific and ML packages

This will allow lightweight downstream images (such as ASR services that need only audio processing) to avoid pulling the full ML stack.

Hooks

The hooks/ directory is present and follows the standard SBTal pattern. Each hook script sources launch_shared with its own name as the first argument; launch_shared then finds and sources the shared version of the hook. The hook set is identical across all oci-basic runtime images.

Licence

Copyright 2022–2026 Språkbanken Tal, Department of Speech, Music and Hearing, KTH Royal Institute of Technology.

Licensed under the Apache License 2.0.

Part of the oci-basic image family.

Tag summary

Content type

Image

Digest

sha256:307d89655

Size

630.1 MB

Last updated

5 months ago

docker pull sprakbankental/python