Commit a85dc40
committed
Modernize Dockerfile to build against current Python and GraphBLAS
The Dockerfile had bit-rotted: the python:3.10-slim-buster base image
no longer builds (Debian buster apt repos are gone), and the most recent
commit simultaneously dropped Python <=3.10 support in pyproject.toml
while leaving the Dockerfile pinned to Python 3.10. Several install
paths and cmake flags were also out of date for SuiteSparse:GraphBLAS
10.x.
Changes:
- Bump base image from python:3.10-slim-buster (EOL) to
python:3.12-slim-bookworm. Update hardcoded python3.10 site-packages
paths to python3.12 in three places.
- Update GraphBLAS header copy: 10.x installs the header at
/usr/include/suitesparse/GraphBLAS.h, not /usr/include/GraphBLAS.h,
and create_headers.py looks for it at
${sys.prefix}/include/suitesparse/GraphBLAS.h.
- Replace deprecated `python3 setup.py install` with
`pip install --no-build-isolation --no-deps .`. The pip-driven path
is required by modern setuptools, and pip is added to the build-time
install list along with pycparser/setuptools/wheel/setuptools-git-versioning
which the build now needs explicitly.
- Add cmake flags matching CI in suitesparse.sh:
-DCMAKE_BUILD_TYPE=Release, -DJITINIT=2, -DGRAPHBLAS_USE_JIT=OFF.
The JIT flags avoid segfaults in tests; without them GraphBLAS may
attempt JIT compilation at runtime.
- Replace stale -DGBCOMPACT cmake flag with the current name -DCOMPACT,
and give ARG COMPACT a default of 0 so the substitution is non-empty
when the build-arg is omitted.
- Make `git tag ${VERSION}` idempotent: wrap with `(... || true)` so
the build does not fail when ${VERSION} matches an existing tag in
the source tree (which is now the case for the current 10.3.1.0
release tag).
- Fix Docker COPY collapsing the libgraphblas symlink chain
(libgraphblas.so -> .so.10 -> .so.10.3.1) into three identical 67MB
regular files. Copy only the real versioned library
(libgraphblas.so.*.*.*) and recreate symlinks via `ln -sf` in a RUN
step. Apply the same fix to libgomp in the final stage. This removes
the `ldconfig: ... is not a symbolic link` warnings and saves ~130MB.
- Cleanup: remove unused `ARG SUITESPARSE` redeclaration in the psg
stage, fix the lowercase `as` -> `AS` for FromAsCasing warnings,
and switch `ENV PYTHONUNBUFFERED 1` to the modern `ENV key=value`
form.
- Drop the bizarre `WORKDIR /build/GraphBLAS/build` that was set
*before* the GraphBLAS git clone, producing the path
/build/GraphBLAS/build/GraphBLAS/build. The clone now happens
directly under /build.
Built and verified by running the doctests inside the produced image:
$ docker build --build-arg SUITESPARSE=v10.3.1 \\
--build-arg VERSION=10.3.1.0 \\
-t psg-test:latest .
$ docker run --rm psg-test:latest python3 -c "
import suitesparse_graphblas; suitesparse_graphblas.initialize()
from suitesparse_graphblas.tests.test_doctest import test_run_doctests
test_run_doctests()"
-> 268 doctests pass, supports_complex=True1 parent 61813ca commit a85dc40
1 file changed
Lines changed: 41 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
17 | 24 | | |
18 | 25 | | |
19 | 26 | | |
20 | | - | |
21 | | - | |
| 27 | + | |
22 | 28 | | |
23 | | - | |
| 29 | + | |
24 | 30 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
36 | | - | |
| 50 | + | |
| 51 | + | |
37 | 52 | | |
38 | | - | |
| 53 | + | |
39 | 54 | | |
40 | 55 | | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
44 | 59 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments