c54853d45b9d5084a3f91d492887e2e859ee995a,python/ray/autoscaler/command_runner.py,DockerCommandRunner,_check_docker_installed,#DockerCommandRunner#,661
Before Change
self.container_name)
def _check_docker_installed(self):
try:
self.ssh_command_runner.run("command -v docker")
return
except Exception:
install_commands = [
"curl -fsSL https://get.docker.com -o get-docker.sh",
"sudo sh get-docker.sh", "sudo usermod -aG docker $USER",
"sudo systemctl restart docker -f"
]
logger.error(
"Docker not installed. You can install Docker by adding the "
"following commands to "initialization_commands":\n" +
"\n".join(install_commands))
def _shutdown_after_next_cmd(self):
self.shutdown = True
def _check_container_status(self):
After Change
no_exist = "NoExist"
output = self.ssh_command_runner.run(
f"command -v docker || echo "{no_exist}"", with_output=True)
cleaned_output = output.decode().strip()
if no_exist in cleaned_output or "docker" not in cleaned_output:
install_commands = [
"curl -fsSL https://get.docker.com -o get-docker.sh",
"sudo sh get-docker.sh", "sudo usermod -aG docker $USER",
"sudo systemctl restart docker -f"
]
logger.error(
"Docker not installed. You can install Docker by adding the "
"following commands to "initialization_commands":\n" +
"\n".join(install_commands))
def _shutdown_after_next_cmd(self):
self.shutdown = True
def _check_container_status(self):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: ray-project/ray
Commit Name: c54853d45b9d5084a3f91d492887e2e859ee995a
Time: 2020-09-03
Author: ian.rodney@gmail.com
File Name: python/ray/autoscaler/command_runner.py
Class Name: DockerCommandRunner
Method Name: _check_docker_installed
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 0685052da871976e773c59dc732811019b90a612
Time: 2016-06-29
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/openstack/os_disk.py
Class Name: OpenStackDisk
Method Name: _Exists
Project Name: thenetcircle/dino
Commit Name: 6c35c2137e292e00c3ac3a47eb28fac29424453a
Time: 2018-01-17
Author: oscar.eriks@gmail.com
File Name: dino/validation/request.py
Class Name: RequestValidator
Method Name: on_message