()
| 89 | |
| 90 | |
| 91 | def check_docker(): |
| 92 | executable = shutil.which("docker") |
| 93 | if executable is None: |
| 94 | clean_exit("'docker' executable not found, install it first (e.g. 'apt install docker.io')") |
| 95 | |
| 96 | if sys.platform == "linux": |
| 97 | # Check that the user is in the docker group before running |
| 98 | try: |
| 99 | group = grp.getgrnam("docker") |
| 100 | if getpass.getuser() not in group.gr_mem: |
| 101 | warnings.append( |
| 102 | f"Note: User '{getpass.getuser()}' is not in the 'docker' group, either:\n" |
| 103 | " * run with 'sudo'\n" |
| 104 | " * add user to 'docker': sudo usermod -aG docker $(whoami), then log out and back in", |
| 105 | ) |
| 106 | except KeyError: |
| 107 | warnings.append("Note: 'docker' group does not exist") |
| 108 | |
| 109 | |
| 110 | def check_gpu(): |
no test coverage detected
searching dependent graphs…