[docker/dashboard] Fix ray dashboard (#12899)

This commit is contained in:
Ian Rodney 2021-01-15 10:03:01 -08:00 committed by GitHub
parent dac8b3d58a
commit 0ec9ddabc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 1 deletions

View file

@ -598,7 +598,8 @@ class DockerCommandRunner(CommandRunnerInterface):
shutdown_after_run=False,
):
if run_env == "auto":
run_env = "host" if cmd.find("docker") == 0 else "docker"
run_env = "host" if (not bool(cmd)
or cmd.find("docker") == 0) else "docker"
if environment_variables:
cmd = _with_environment_variables(cmd, environment_variables)

View file

@ -319,6 +319,30 @@ def test_ray_attach(configure_lang, configure_aws, _unlink_test_ssh_key):
_check_output_via_pattern("test_ray_attach.txt", result)
@pytest.mark.skipif(
sys.platform == "darwin" and "travis" in os.environ.get("USER", ""),
reason=("Mac builds don't provide proper locale support"))
@mock_ec2
@mock_iam
def test_ray_dashboard(configure_lang, configure_aws, _unlink_test_ssh_key):
def commands_mock(command, stdin):
# TODO(maximsmol): this is a hack since stdout=sys.stdout
# doesn't work with the mock for some reason
print("ubuntu@ip-.+:~$ exit")
return PopenBehaviour(stdout="ubuntu@ip-.+:~$ exit")
with _setup_popen_mock(commands_mock):
runner = CliRunner()
result = runner.invoke(scripts.up, [
DEFAULT_TEST_CONFIG_PATH, "--no-config-cache", "-y",
"--log-style=pretty", "--log-color", "False"
])
_die_on_error(result)
result = runner.invoke(scripts.dashboard, [DEFAULT_TEST_CONFIG_PATH])
_check_output_via_pattern("test_ray_dashboard.txt", result)
@pytest.mark.skipif(
sys.platform == "darwin" and "travis" in os.environ.get("USER", ""),
reason=("Mac builds don't provide proper locale support"))

View file

@ -0,0 +1,7 @@
Attempting to establish dashboard locally at localhost:8265 connected to remote port 8265
Loaded cached provider configuration
If you experience issues with the cloud provider, try re-running the command with --no-config-cache.
Fetched IP: .+
Forwarding ports
ubuntu@ip-.+:~\$ exit
Successfully established connection.