diff --git a/src/soopervisor/airflow/export.py b/src/soopervisor/airflow/export.py index 30aaf8d..a7e7303 100644 --- a/src/soopervisor/airflow/export.py +++ b/src/soopervisor/airflow/export.py @@ -71,6 +71,8 @@ def _export(cfg, env_name, mode, until, skip_tests, ignore_git, """ with Commander(workspace=env_name, templates_path=('soopervisor', 'assets')) as e: + commons.docker.validate_installation(e) + tasks, args = commons.load_tasks(cmdr=e, name=env_name, mode=mode, diff --git a/src/soopervisor/argo/export.py b/src/soopervisor/argo/export.py index 47d7733..ce272d5 100644 --- a/src/soopervisor/argo/export.py +++ b/src/soopervisor/argo/export.py @@ -48,6 +48,7 @@ def _export(cfg, env_name, mode, until, skip_tests, ignore_git, with Commander(workspace=env_name, templates_path=('soopervisor', 'assets')) as cmdr: + docker.validate_installation(cmdr) tasks, args = commons.load_tasks(cmdr=cmdr, name=env_name, diff --git a/src/soopervisor/aws/batch.py b/src/soopervisor/aws/batch.py index 366ed43..44ca6c6 100644 --- a/src/soopervisor/aws/batch.py +++ b/src/soopervisor/aws/batch.py @@ -247,6 +247,8 @@ def _export(cls, cfg, env_name, mode, until, skip_tests, ignore_git, lazy_import): with Commander(workspace=env_name, templates_path=('soopervisor', 'assets')) as cmdr: + docker.validate_installation(cmdr) + tasks, cli_args = commons.load_tasks(cmdr=cmdr, name=env_name, mode=mode, diff --git a/src/soopervisor/commons/docker.py b/src/soopervisor/commons/docker.py index e3aed20..6cd5030 100644 --- a/src/soopervisor/commons/docker.py +++ b/src/soopervisor/commons/docker.py @@ -31,6 +31,23 @@ def modify_wildcard(entity): return entity.replace("*", "ploomber") +def validate_installation(cmdr): + """ valdiate if docker is installed. + + Paramemters + ----------- + cmdr : Commander + Commander instance + """ + + cmdr.run( + 'docker --version | awk \'NR==1{print $1}\'', + capture_output=True, + expected_output="Docker", + error_message="Did you install Docker?", + ) + + def get_dependencies(): """ Fetch all dependency files and corresponding lock files diff --git a/src/soopervisor/kubeflow/export.py b/src/soopervisor/kubeflow/export.py index 440fb44..f8830a0 100644 --- a/src/soopervisor/kubeflow/export.py +++ b/src/soopervisor/kubeflow/export.py @@ -49,6 +49,8 @@ def _export(cfg, env_name, mode, until, skip_tests, ignore_git, """ with Commander(workspace=env_name, templates_path=('soopervisor', 'assets')) as e: + commons.docker.validate_installation(e) + tasks, args = commons.load_tasks(cmdr=e, name=env_name, mode=mode) dag, relative_path = commons.load_dag(cmdr=e, name=env_name,