Exemplo n.º 1
0
 def test_generate_streams_conf(self):
     tmp_dir = tempfile.mkdtemp()
     assert os.listdir(tmp_dir) == []
     generate_streams_conf(path=tmp_dir)
     assert set(os.listdir(tmp_dir)) == {
         "polyaxon.main.conf", "polyaxon.base.conf"
     }
Exemplo n.º 2
0
def proxy(component, path, root):
    """Create api proxy."""
    from polyaxon.proxies.generators import (
        generate_api_conf,
        generate_gateway_conf,
        generate_streams_conf,
    )
    from polyaxon.settings import set_proxies_config

    if not root:
        root = os.path.abspath(".")

    set_proxies_config()

    if component == "api":
        generate_api_conf(path=path, root=root)
    elif component == "streams":
        generate_streams_conf(path=path, root=root)
    elif component == "gateway":
        generate_gateway_conf(path=path, root=root)
    else:
        raise PolyaxonException("Component {} is not recognized".format(component))