Skip to content

Commit 21f9ac0

Browse files
Add system dependency checker for Docker, Apptainer, and Singularity
1 parent 67e574e commit 21f9ac0

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

app_gui.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ def _find_python_interpreter():
5050

5151
PYTHON_EXE = _find_python_interpreter()
5252

53+
def check_system_dependencies():
54+
"""Check for availability of docker, apptainer, and singularity."""
55+
docker_installed = shutil.which('docker') is not None
56+
docker_running = False
57+
if docker_installed:
58+
try:
59+
# Check if daemon is responsive
60+
subprocess.run(['docker', 'info'], capture_output=True, timeout=2, check=True)
61+
docker_running = True
62+
except (subprocess.SubprocessError, FileNotFoundError):
63+
docker_running = False
64+
65+
return {
66+
'docker': docker_installed,
67+
'docker_running': docker_running,
68+
'apptainer': shutil.which('apptainer') is not None,
69+
'singularity': shutil.which('singularity') is not None,
70+
'datalad': shutil.which('datalad') is not None
71+
}
72+
5373
LOG_DIR = BASE_DIR / "logs"
5474

5575
@app.before_request

0 commit comments

Comments
 (0)