def run(self, repo: str, branch: str, task: Task, git_repo: Repo, repo_path: Path):
from fabric import api<EOL>from fabric.exceptions import CommandTimeout<EOL>vm_location = self.get_vm_location()<EOL>self.ensure_vm_running(vm_location)<EOL>logger.info("<STR_LIT>", vm_location)<EOL>self.check_docker_access()  <EOL>self.get_image_for_repo(repo, branch, git_repo, repo_path)<EOL>requirements_option, requirements_hash = self.get_requirements_information(repo_path)<EOL>image_tag = self.get_image_tag(requirements_option, requirements_hash, self.get_dependencies())<EOL>image_name = self.use_registry_name<EOL>task_filename, task_json = self.serialized_task(task)<EOL>(vm_location / task_filename).write_text(task_json)<EOL>container_name = self.get_container_name(repo, branch, git_repo)<EOL>api.env.hosts = [self.vagrant.user_hostname_port()]<EOL>api.env.key_filename = self.vagrant.keyfile()<EOL>api.env.disable_known_hosts = True  <EOL>api.env.abort_exception = BuildError  <EOL>api.env.shell = "<STR_LIT>"<EOL>if self.quiet:<EOL><INDENT>api.output.everything = False<EOL><DEDENT>else:<EOL><INDENT>api.output.everything = True<EOL><DEDENT>try:<EOL><INDENT>res = api.execute(self.fabric_task,<EOL>container_name=container_name,<EOL>definition_filename=task_filename,<EOL>image_name=image_name,<EOL>image_tag=image_tag,<EOL>repository=str(repo_path.relative_to(Path(self._arca.base_dir).resolve() / '<STR_LIT>')),<EOL>timeout=task.timeout)<EOL>return Result(res[self.vagrant.user_hostname_port()].stdout)<EOL><DEDENT>except CommandTimeout:<EOL><INDENT>raise BuildTimeoutError(f"<STR_LIT>")<EOL><DEDENT>except BuildError:  <EOL><INDENT>raise<EOL><DEDENT>except Exception as e:<EOL><INDENT>logger.exception(e)<EOL>raise BuildError("<STR_LIT>", extra_info={<EOL>"<STR_LIT>": e<EOL>})<EOL><DEDENT>finally:<EOL><INDENT>if not self.keep_vm_running:<EOL><INDENT>if self.destroy:<EOL><INDENT>self.vagrant.destroy()<EOL>shutil.rmtree(self.vagrant.root, ignore_errors=True)<EOL>self.vagrant = None<EOL><DEDENT>else:<EOL><INDENT>self.vagrant.halt()<EOL><DEDENT><DEDENT><DEDENT>
Starts up a VM, builds an docker image and gets it to the VM, runs the script over SSH, returns result.
            Stops the VM if ``keep_vm_running`` is not set.