コード例 #1
0
ファイル: client.py プロジェクト: rom1504/tf-yarn
def _setup_pyenvs(
        pyenv_zip_path: Union[str, Dict[topologies.NodeLabel, str]]
) -> Dict[topologies.NodeLabel, _env.PythonEnvDescription]:
    if isinstance(pyenv_zip_path, str):
        pyenv = _env.gen_pyenv_from_existing_archive(pyenv_zip_path)
        pyenvs = {
            topologies.NodeLabel.CPU: pyenv,
            topologies.NodeLabel.GPU: pyenv
        }
    else:
        pyenvs = {label: _env.gen_pyenv_from_existing_archive(env_zip_path)
                  for label, env_zip_path in pyenv_zip_path.items()}
    return pyenvs
コード例 #2
0
def test_gen_pyenvs_from_existing_env(path_to_archive, expected_cmd,
                                      expected_dest_path,
                                      standalone_client_mode):
    result = gen_pyenv_from_existing_archive(path_to_archive,
                                             standalone_client_mode)
    assert result.path_to_archive == path_to_archive
    assert result.dispatch_task_cmd == expected_cmd
    assert result.dest_path == expected_dest_path
コード例 #3
0
ファイル: test_env.py プロジェクト: zhouyonglong/tf-yarn
def test_gen_pyenvs_from_unknown_format():
    with pytest.raises(ValueError):
        gen_pyenv_from_existing_archive("/path/to/pack.tar.bz2")
コード例 #4
0
def test_gen_pyenvs_from_unknown_format():
    with pytest.raises(ValueError):
        gen_pyenv_from_existing_archive("/path/to/pack.tar.bz2",
                                        standalone_client_mode=False)