Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Turn on new dashboard by default pt 2 #11510

Merged
merged 28 commits into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
284f7ac
fix wheel?
Oct 19, 2020
30195ce
fix osx wheel
Oct 20, 2020
5bbe42e
another attempt at building a wheel that includes the built dashboard
Oct 20, 2020
0d21203
issue not excluding the dashboard/client dir in the git clean cmd bui…
Oct 20, 2020
64b9639
Remove some other instances I found of new_dashboard
Oct 20, 2020
fc0e2ea
revert change that made setup.py include all dash dependencies
Oct 20, 2020
7c5f875
when modules get imported in a wheel they break because the conftest …
Oct 20, 2020
6dd6b20
move pytest import back out of main block
Oct 20, 2020
cacadf9
oops
Oct 20, 2020
98056a8
lint
Oct 20, 2020
54595a4
take the conftest imports out of the main blocks and instead add a fi…
Oct 20, 2020
8df7d9e
try putting dash module tests into their own folder
Oct 20, 2020
85f4e3d
Revert "Revert "[Dashboard] Turn on New Dashboard by Default (#11321)…
mfitton Oct 20, 2020
4bc2dad
Merge branch 'dash-wheels' into turn-on-new-dashboard-take2
Oct 20, 2020
e7e70d5
Change dashboard log and temp directories to be required arguments to…
Oct 20, 2020
404da76
Add a test_dashboard script back to the wheel tests
Oct 20, 2020
55e3b51
oops left test broken
Oct 20, 2020
bf2bf86
Try to fix failing linux wheel builds by adding keep_alive before the…
Oct 21, 2020
19f96e7
Remove the suppress_output on docker command to get more insight into…
Oct 21, 2020
f928f95
Merge branch 'master' into turn-on-new-dashboard-take2
Oct 21, 2020
ea465fd
lint
Oct 21, 2020
73c8058
remove exception that prevented test_webui in Windows because the bac…
Oct 21, 2020
1a4a077
Make some calls verbose and add echo statements to aid in debugging t…
Oct 21, 2020
5db656b
Pin version 14 of node, 15 breaks the dashboard build rn
Oct 21, 2020
95f04e9
Revert change to suppressing output of docker build.
mfitton Oct 21, 2020
5a922ee
Merge branch 'fix-failing-wheels' into turn-on-new-dashboard-take2
mfitton Oct 21, 2020
c935c79
lint front end
mfitton Oct 22, 2020
82541c3
switch os.uname -> platform.uname for windows support
mfitton Oct 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# The build output should clearly not be checked in
*test-output.xml
/bazel-*
/python/ray/core
/python/ray/pickle5_files/
Expand All @@ -11,7 +12,7 @@
/thirdparty/pkg/
/build/java
.jar

/dashboard/client/build
# Files generated by flatc should be ignored
/src/ray/gcs/format/*_generated.h
/src/ray/object_manager/format/*_generated.h
Expand Down
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,6 @@ script:
# ray serve tests
- if [ $RAY_CI_SERVE_AFFECTED == "1" ]; then ./ci/keep_alive bazel test --config=ci $(./scripts/bazel_export_options) --test_tag_filters=-jenkins_only python/ray/serve/...; fi

# ray dashboard tests
- if [ "$RAY_CI_DASHBOARD_AFFECTED" == "1" ]; then ./ci/keep_alive bazel test python/ray/dashboard/...; fi

# ray new dashboard tests
- if [ "$RAY_CI_DASHBOARD_AFFECTED" == "1" ]; then ./ci/keep_alive bazel test python/ray/new_dashboard/...; fi

Expand Down
3 changes: 1 addition & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -1786,8 +1786,7 @@ filegroup(
"python/ray/core/generated/__init__.py",
"python/ray/core/generated/ray/__init__.py",
"python/ray/core/generated/ray/protocol/__init__.py",
"python/ray/dashboard/*.py",
"python/ray/dashboard/metrics_exporter/*.py",
"python/ray/new_dashboard/**/*.py",
"python/ray/experimental/*.py",
"python/ray/util/*.py",
"python/ray/internal/*.py",
Expand Down
5 changes: 2 additions & 3 deletions ci/travis/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ test_python() {
-python/ray/tests:test_resource_demand_scheduler
-python/ray/tests:test_stress # timeout
-python/ray/tests:test_stress_sharded # timeout
-python/ray/tests:test_webui
)
fi
if [ 0 -lt "${#args[@]}" ]; then # Any targets to test?
Expand Down Expand Up @@ -208,7 +207,7 @@ build_dashboard_front_end() {
{ echo "WARNING: Skipping dashboard due to NPM incompatibilities with Windows"; } 2> /dev/null
else
(
cd ray/dashboard/client
cd ray/new_dashboard/client
set +x # suppress set -x since it'll get very noisy here
. "${HOME}/.nvm/nvm.sh"
nvm use --silent node
Expand Down Expand Up @@ -334,7 +333,7 @@ lint_bazel() {

lint_web() {
(
cd "${WORKSPACE_DIR}"/python/ray/dashboard/client
cd "${WORKSPACE_DIR}"/python/ray/new_dashboard/client
set +x # suppress set -x since it'll get very noisy here
. "${HOME}/.nvm/nvm.sh"
install_npm_project
Expand Down
6 changes: 0 additions & 6 deletions ci/travis/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ check_command_exist yapf
check_command_exist flake8
check_command_exist mypy

ver=$(yapf --version)
if ! echo "$ver" | grep -q 0.23.0; then
echo "Wrong YAPF version installed: 0.23.0 is required, not $ver. $YAPF_DOWNLOAD_COMMAND_MSG"
exit 1
fi

# this stops git rev-parse from failing if we run this from the .git directory
builtin cd "$(dirname "${BASH_SOURCE:-$0}")"

Expand Down
13 changes: 3 additions & 10 deletions ci/travis/test-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ if [ -z "${BUILD_DIR}" ]; then
fi
TEST_DIR="${BUILD_DIR}/python/ray/tests"
TEST_SCRIPTS=("$TEST_DIR/test_microbenchmarks.py" "$TEST_DIR/test_basic.py")
UI_TEST_SCRIPT="${BUILD_DIR}/python/ray/tests/test_webui.py"
DASHBOARD_TEST_SCRIPT="${BUILD_DIR}/python/ray/tests/test_dashboard.py"


function retry {
local n=1
Expand Down Expand Up @@ -77,9 +78,7 @@ if [[ "$platform" == "linux" ]]; then
for SCRIPT in "${TEST_SCRIPTS[@]}"; do
retry "$PYTHON_EXE" "$SCRIPT"
done

# Run the UI test to make sure that the packaged UI works.
retry "$PYTHON_EXE" "$UI_TEST_SCRIPT"
retry "$PYTHON_EXE" "$DASHBOARD_TEST_SCRIPT"
done

# Check that the other wheels are present.
Expand Down Expand Up @@ -118,12 +117,6 @@ elif [[ "$platform" == "macosx" ]]; then
for SCRIPT in "${TEST_SCRIPTS[@]}"; do
retry "$PYTHON_EXE" "$SCRIPT"
done

if (( $(echo "$PY_MM >= 3.0" | bc) )); then
# Run the UI test to make sure that the packaged UI works.
retry "$PYTHON_EXE" "$UI_TEST_SCRIPT"
fi

done
elif [ "${platform}" = windows ]; then
echo "WARNING: Wheel testing not yet implemented for Windows."
Expand Down
36 changes: 17 additions & 19 deletions dashboard/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import logging.handlers
import os
import platform
import sys
import socket
import json
Expand Down Expand Up @@ -38,6 +39,7 @@
class DashboardAgent(object):
def __init__(self,
redis_address,
dashboard_agent_port,
redis_password=None,
temp_dir=None,
log_dir=None,
Expand All @@ -51,6 +53,7 @@ def __init__(self,
self.redis_password = redis_password
self.temp_dir = temp_dir
self.log_dir = log_dir
self.dashboard_agent_port = dashboard_agent_port
self.metrics_export_port = metrics_export_port
self.node_manager_port = node_manager_port
self.object_store_name = object_store_name
Expand All @@ -59,7 +62,8 @@ def __init__(self,
assert self.node_id, "Empty node id (RAY_NODE_ID)."
self.ip = ray._private.services.get_node_ip_address()
self.server = aiogrpc.server(options=(("grpc.so_reuseport", 0), ))
self.grpc_port = self.server.add_insecure_port("[::]:0")
self.grpc_port = self.server.add_insecure_port(
f"[::]:{self.dashboard_agent_port}")
logger.info("Dashboard agent grpc address: %s:%s", self.ip,
self.grpc_port)
self.aioredis_client = None
Expand Down Expand Up @@ -186,6 +190,11 @@ async def _check_parent():
required=True,
type=int,
help="The port to expose metrics through Prometheus.")
parser.add_argument(
"--dashboard-agent-port",
required=True,
type=int,
help="The port on which the dashboard agent will receive GRPCs.")
parser.add_argument(
"--node-manager-port",
required=True,
Expand Down Expand Up @@ -247,35 +256,23 @@ async def _check_parent():
format(dashboard_consts.LOGGING_ROTATE_BACKUP_COUNT))
parser.add_argument(
"--log-dir",
required=False,
required=True,
type=str,
default=None,
help="Specify the path of log directory.")
parser.add_argument(
"--temp-dir",
required=False,
required=True,
type=str,
default=None,
help="Specify the path of the temporary directory use by Ray process.")

args = parser.parse_args()
try:
if args.temp_dir:
temp_dir = "/" + args.temp_dir.strip("/")
else:
temp_dir = "/tmp/ray"
os.makedirs(temp_dir, exist_ok=True)

if args.log_dir:
log_dir = args.log_dir
else:
log_dir = os.path.join(temp_dir, "session_latest/logs")
os.makedirs(log_dir, exist_ok=True)

if args.logging_filename:
logging_handlers = [
logging.handlers.RotatingFileHandler(
os.path.join(log_dir, args.logging_filename),
os.path.join(args.log_dir, args.logging_filename),
maxBytes=args.logging_rotate_bytes,
backupCount=args.logging_rotate_backup_count)
]
Expand All @@ -288,9 +285,10 @@ async def _check_parent():

agent = DashboardAgent(
args.redis_address,
args.dashboard_agent_port,
redis_password=args.redis_password,
temp_dir=temp_dir,
log_dir=log_dir,
temp_dir=args.temp_dir,
log_dir=args.log_dir,
metrics_export_port=args.metrics_export_port,
node_manager_port=args.node_manager_port,
object_store_name=args.object_store_name,
Expand All @@ -304,7 +302,7 @@ async def _check_parent():
args.redis_address, password=args.redis_password)
traceback_str = ray.utils.format_error_message(traceback.format_exc())
message = ("The agent on node {} failed with the following "
"error:\n{}".format(os.uname()[1], traceback_str))
"error:\n{}".format(platform.uname()[1], traceback_str))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just use socket.gethostname here instead? I think that's what we use in other places in the code

ray.utils.push_error_to_driver_through_redis(
redis_client, ray_constants.DASHBOARD_AGENT_DIED_ERROR, message)
raise e
2 changes: 1 addition & 1 deletion dashboard/client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type ProcessStats = {
iowait: number;
};
cpuPercent: number;
}
};

export type Worker = {
pid: number;
Expand Down
4 changes: 1 addition & 3 deletions dashboard/client/src/pages/dashboard/logical-view/Actor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ const Actor: React.FC<ActorProps> = ({ actor }) => {
</span>
)}
</Typography>
<ActorDetailsPane
actor={actor}
/>
<ActorDetailsPane actor={actor} />
{isFullActorInfo(actor) && (
<React.Fragment>
{actorCustomDisplay.length > 0 && (
Expand Down
Loading