Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions base_images/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# OpenProblems Base Images v1.2.0

## BUG FIXES

* `base_pytorch_nvidia`: drop the pip-installed `cmake` in favour of apt's (PR #48). The pip
shims in `/usr/local/bin` shadow `/usr/bin/cmake`, and they fail with `ModuleNotFoundError:
No module named 'cmake'` when a build calls them from inside a pip build isolation
environment -- which broke, among others, building `louvain` for `cellplm`.

## TESTING

* Check that `cmake`, `cpack` and `ctest` resolve to the apt-provided binaries in
`base_pytorch_nvidia` (PR #48).

# OpenProblems Base Images v1.1.0

## MAJOR CHANGES
Expand Down
2 changes: 1 addition & 1 deletion base_images/_viash.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
organization: openproblems
version: 1.1.0
version: 1.2.0
viash_version: 0.9.7
links:
repository: https://github.com/openproblems-bio/base_images
8 changes: 8 additions & 0 deletions base_images/src/pytorch_nvidia/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ description: An nvcr.io pytorch with anndata preinstalled.
test_resources:
- type: python_script
path: test_pytorch.py
- type: python_script
path: test_cmake.py
- type: python_script
path: ../python/test_anndata.py
engines:
Expand All @@ -13,6 +15,12 @@ engines:
packages:
- procps
- git
- cmake
# The nvcr image pip-installs cmake, whose shims in /usr/local/bin shadow
# apt's cmake because /usr/local/bin comes first on PATH. Drop the package
# so builds pick up the working /usr/bin/cmake instead.
- type: docker
run: pip uninstall -y cmake
- type: python
packages:
- anndata~=0.12.0
Expand Down
40 changes: 40 additions & 0 deletions base_images/src/pytorch_nvidia/test_cmake.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import shutil
import subprocess
import tempfile

## VIASH START
meta = {
"temp_dir": tempfile.gettempdir(),
}
## VIASH END

# The nvcr pytorch image ships a pip-installed cmake whose shims land in
# /usr/local/bin and shadow apt's cmake. If a base image rebuild ever
# reintroduces them, components that compile from source break in confusing
# ways, so check that cmake resolves to the apt-provided binary and runs.
print("--- Checking cmake ---", flush=True)

cmake = shutil.which("cmake")
print(f"cmake resolves to: {cmake}", flush=True)

assert cmake is not None, "cmake not found on PATH"
assert cmake == "/usr/bin/cmake", (
f"expected apt's /usr/bin/cmake on PATH, got {cmake} -- a pip-installed "
"cmake is probably shadowing it"
)

out = subprocess.run([cmake, "--version"], capture_output=True, text=True)
print(out.stdout.strip(), flush=True)

assert out.returncode == 0, f"`cmake --version` exited {out.returncode}: {out.stderr.strip()}"

# The pip package ships cpack and ctest alongside cmake; removing only the
# cmake shim would leave those two broken.
for tool in ["cpack", "ctest"]:
path = shutil.which(tool)
print(f"{tool} resolves to: {path}", flush=True)
assert path is None or path.startswith("/usr/bin/"), (
f"{tool} resolves to {path}, expected /usr/bin/{tool} or nothing"
)

print("\ncmake test passed!", flush=True)
Loading