def upload_and_install_wheels( tmp_wheel_dir: str, yaml: str, core_wheel: str, plugin_wheels: List[str], ) -> None: ray_rsync_up(yaml, tmp_wheel_dir + "/", temp_remote_wheel_dir) log.info(f"Install hydra-core wheel {core_wheel}") _run_command( [ "ray", "exec", yaml, f"pip install --no-index --find-links={temp_remote_wheel_dir} {temp_remote_wheel_dir}{core_wheel}", ] ) for p in plugin_wheels: log.info(f"Install plugin wheel {p}") _run_command( [ "ray", "exec", yaml, f"pip install --no-index --find-links={temp_remote_wheel_dir} {temp_remote_wheel_dir}{p}", ] )
def validate_lib_version(yaml: str) -> None: # a few lib versions that we care about libs = ["ray", "cloudpickle", "pickle5"] for lib in libs: local_version = f"{pkg_resources.get_distribution(lib).version}" out, _ = _run_command([ "ray", "exec", yaml, f"pip freeze | grep {lib}", ]) assert local_version in out, f"{lib} version mismatch" # validate python version info = sys.version_info local_python = f"{info.major}.{info.minor}.{info.micro}" out, _ = _run_command([ "ray", "exec", yaml, "python --version", ]) remove_python = out.split()[1] assert ( local_python == remove_python ), f"Python version mismatch, local={local_python}, remote={remove_python}"
def validate_lib_version(yaml: str) -> None: # a few lib versions that we care about libs = ["ray", "cloudpickle", "pickle5"] local_versions = set() for lib in libs: v = pkg_resources.get_distribution(lib).version local_versions.add(f"{lib}=={v}") log.info(f"Locally running {local_versions}") out, _ = _run_command( [ "ray", "exec", yaml, "pip freeze", ] ) remote_versions = out.split() log.info(f"Remotely running {remote_versions}") for local in local_versions: if local not in remote_versions: raise ValueError( f"lib version not matching, local_version: {local} \nremote_versions: {remote_versions}" ) # validate python version info = sys.version_info local_python = f"{info.major}.{info.minor}.{info.micro}" out, _ = _run_command( [ "ray", "exec", yaml, "python --version", ] ) remove_python = out.split()[1] assert ( local_python == remove_python ), f"Python version mismatch, local={local_python}, remote={remove_python}"