|
13 | 13 | cmake_config_dockerfile,
|
14 | 14 | cmake_install_dockerfile,
|
15 | 15 | )
|
| 16 | +from wigwam._docker_distrib import distrib_dockerfile |
16 | 17 | from wigwam._docker_git import git_extract_dockerfile
|
| 18 | +from wigwam._utils import get_libdir |
| 19 | +from wigwam.defaults import install_prefix |
17 | 20 | from wigwam.setup_commands import setup_all
|
18 | 21 |
|
19 | 22 | from .utils import determine_scope, generate_tag, remove_docker_image
|
@@ -87,6 +90,20 @@ def isce3_env_dev_image_tag(
|
87 | 90 | raise ValueError("No development environment image tag found.")
|
88 | 91 |
|
89 | 92 |
|
| 93 | +@fixture(scope=determine_scope) |
| 94 | +def isce3_env_runtime_image_tag( |
| 95 | + isce3_build_tag: str, |
| 96 | + isce3_setup_images: dict[str, Image], |
| 97 | +) -> str: |
| 98 | + """Return the tag of the ISCE3 development environment image.""" |
| 99 | + pattern = re.compile(rf".*{isce3_build_tag}.*mamba-runtime") |
| 100 | + for tag in isce3_setup_images: |
| 101 | + if pattern.match(tag): |
| 102 | + return tag |
| 103 | + |
| 104 | + raise ValueError("No development environment image tag found.") |
| 105 | + |
| 106 | + |
90 | 107 | @fixture(scope=determine_scope)
|
91 | 108 | def isce3_git_repo_tag() -> str:
|
92 | 109 | """Return a tag for the ISCE3 repository image."""
|
@@ -191,3 +208,36 @@ def isce3_cmake_install_image(
|
191 | 208 | )
|
192 | 209 |
|
193 | 210 | remove_docker_image(isce3_cmake_install_tag)
|
| 211 | + |
| 212 | + |
| 213 | +@fixture(scope=determine_scope) |
| 214 | +def isce3_distributable_tag() -> str: |
| 215 | + """Return a tag for the ISCE3 CMake install image.""" |
| 216 | + return generate_tag("isce3-distributable") |
| 217 | + |
| 218 | + |
| 219 | +@fixture(scope=determine_scope) |
| 220 | +def isce3_distributable_image( |
| 221 | + isce3_distributable_tag: str, |
| 222 | + isce3_cmake_install_tag: str, |
| 223 | + isce3_env_runtime_image_tag: str, |
| 224 | + isce3_cmake_install_image: Image, # type: ignore |
| 225 | +) -> Iterator[Image]: |
| 226 | + """Return the ISCE3 distributable image.""" |
| 227 | + libdir = get_libdir(isce3_cmake_install_tag) |
| 228 | + |
| 229 | + dockerfile = distrib_dockerfile( |
| 230 | + base=isce3_env_runtime_image_tag, |
| 231 | + source_tag=isce3_cmake_install_tag, |
| 232 | + source_path=install_prefix(), |
| 233 | + distrib_path=install_prefix(), |
| 234 | + libdir=libdir, |
| 235 | + ) |
| 236 | + |
| 237 | + yield Image.build( |
| 238 | + tag=isce3_distributable_tag, |
| 239 | + dockerfile_string=dockerfile, |
| 240 | + no_cache=False, |
| 241 | + ) |
| 242 | + |
| 243 | + remove_docker_image(isce3_distributable_tag) |
0 commit comments