Skip to content

Commit

Permalink
Add check if we can do docker pull on the image
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Jan 25, 2024
1 parent e0cc00e commit a20da6e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_docker_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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"
Expand Down

0 comments on commit a20da6e

Please sign in to comment.