|
|
|
|
|
|
def get_communicator(worker_id, base_port, timeout_wait): |
|
|
|
return RpcCommunicator(worker_id, base_port, timeout_wait) |
|
|
|
|
|
|
|
def executable_launcher(self, file_name, docker_training, no_graphics, args): |
|
|
|
cwd = os.getcwd() |
|
|
|
file_name = ( |
|
|
|
file_name.strip() |
|
|
|
@staticmethod |
|
|
|
def validate_environment_path(env_path: str) -> Optional[str]: |
|
|
|
# Strip out executable extensions if passed |
|
|
|
env_path = ( |
|
|
|
env_path.strip() |
|
|
|
true_filename = os.path.basename(os.path.normpath(file_name)) |
|
|
|
true_filename = os.path.basename(os.path.normpath(env_path)) |
|
|
|
|
|
|
|
if not (glob.glob(env_path) or glob.glob(env_path + ".*")): |
|
|
|
return None |
|
|
|
|
|
|
|
cwd = os.getcwd() |
|
|
|
true_filename = os.path.basename(os.path.normpath(env_path)) |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name) + ".x86_64") |
|
|
|
candidates = glob.glob(os.path.join(cwd, env_path) + ".x86_64") |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name) + ".x86") |
|
|
|
candidates = glob.glob(os.path.join(cwd, env_path) + ".x86") |
|
|
|
candidates = glob.glob(file_name + ".x86_64") |
|
|
|
candidates = glob.glob(env_path + ".x86_64") |
|
|
|
candidates = glob.glob(file_name + ".x86") |
|
|
|
candidates = glob.glob(env_path + ".x86") |
|
|
|
os.path.join( |
|
|
|
cwd, file_name + ".app", "Contents", "MacOS", true_filename |
|
|
|
) |
|
|
|
os.path.join(cwd, env_path + ".app", "Contents", "MacOS", true_filename) |
|
|
|
os.path.join(file_name + ".app", "Contents", "MacOS", true_filename) |
|
|
|
os.path.join(env_path + ".app", "Contents", "MacOS", true_filename) |
|
|
|
os.path.join(cwd, file_name + ".app", "Contents", "MacOS", "*") |
|
|
|
os.path.join(cwd, env_path + ".app", "Contents", "MacOS", "*") |
|
|
|
os.path.join(file_name + ".app", "Contents", "MacOS", "*") |
|
|
|
os.path.join(env_path + ".app", "Contents", "MacOS", "*") |
|
|
|
candidates = glob.glob(os.path.join(cwd, file_name + ".exe")) |
|
|
|
candidates = glob.glob(os.path.join(cwd, env_path + ".exe")) |
|
|
|
candidates = glob.glob(file_name + ".exe") |
|
|
|
candidates = glob.glob(env_path + ".exe") |
|
|
|
return launch_string |
|
|
|
|
|
|
|
def executable_launcher(self, file_name, docker_training, no_graphics, args): |
|
|
|
launch_string = self.validate_environment_path(file_name) |
|
|
|
"Couldn't launch the {0} environment. " |
|
|
|
"Provided filename does not match any environments.".format( |
|
|
|
true_filename |
|
|
|
) |
|
|
|
f"Couldn't launch the {file_name} environment. Provided filename does not match any environments." |
|
|
|
) |
|
|
|
else: |
|
|
|
logger.debug("This is the launch string {}".format(launch_string)) |
|
|
|