Exemplo n.º 1
0
 def __init__(self, **kwargs):
     super().__init__()
     self.name = None
     self.command = None
     self.address = None
     self.cluster = None
     self.gpu_instance = None
     self.bootstrap = None
     self.docker_image = "daskdev/dask:latest"
     self.set_env = 'env DASK_INTERNAL_INHERIT_CONFIG="{}"'.format(
         serialize_for_cli(dask.config.global_config))
     self.kwargs = kwargs
Exemplo n.º 2
0
def get_docker_cmd(image, global_config):
    """Returns a docker command which accepts additional arguments as the
    command to run within the image.
    """
    return [
        'docker',
        'run',
        '--net=host',
        '--rm',
        '-i',
        '--env',
        'DASK_INTERNAL_INHERIT_CONFIG="%s"' % serialize_for_cli(global_config),
        image,
    ]
Exemplo n.º 3
0
def test_cli_serialization():
    # Use context manager without changing the value to ensure test side effects are restored
    with dask.config.set(
        {
            "distributed.comm.default-scheme": dask.config.get(
                "distributed.comm.default-scheme"
            )
        }
    ):
        config = deserialize_for_cli(
            serialize_for_cli({"distributed": {"comm": {"default-scheme": "tls"}}})
        )  # Take a round trip through the serialization
        dask.config.update(dask.config.global_config, config)
        assert dask.config.get("distributed.comm.default-scheme") == "tls"