From a20da6e07c8664d748e7dca7788b5aec2f2d1364 Mon Sep 17 00:00:00 2001 From: Bart Schilperoort Date: Thu, 25 Jan 2024 16:05:30 +0100 Subject: [PATCH] Add check if we can do docker pull on the image --- tests/test_docker_model.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_docker_model.py b/tests/test_docker_model.py index 2ee1edb6..74bc41c6 100644 --- a/tests/test_docker_model.py +++ b/tests/test_docker_model.py @@ -8,7 +8,9 @@ from PyStemmusScope import forcing_io from PyStemmusScope import soil_io from PyStemmusScope.bmi.implementation import StemmusScopeBmi +from PyStemmusScope.bmi.docker_utils import find_image from . import data_folder +import platform SCOPE_INPUTDATA_v2_1 = "https://github.com/Christiaanvandertol/SCOPE/raw/2.1/input/" @@ -20,12 +22,20 @@ def docker_available(): try: docker.APIClient() + + # Github Actions windows runners couldn't pull the image: + if platform.system() == "Windows": + find_image("ghcr.io/ecoextreml/stemmus_scope:1.5.0") + return True except docker.errors.DockerException as err: if "Error while fetching server API version" in str(err): return False else: raise err # Unknown error. + except docker.errors.ImageNotFound: + return False + cfg_file = data_folder / "config_file_docker.txt"