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

Update react-scripts dependency for dashboard #19489

Merged
merged 6 commits into from
Oct 21, 2021

Conversation

pcmoritz
Copy link
Contributor

@pcmoritz pcmoritz commented Oct 18, 2021

Why are these changes needed?

This is needed to build the Ray dashboard on windows.

Without it, I'm getting the following error:

C:/Users/ray/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx
  Line 110:48:  Parsing error: Unexpected token, expected ";"

  108 |         // Construct the value from actor.
  109 |         // Please refer to worker.py::show_in_webui for schema.
> 110 |         const valueEncoded = actor.webuiDisplay![key];
      |                                                ^
  111 |         const valueParsed = JSON.parse(valueEncoded);
  112 |         let valueRendered = valueParsed["message"];
  113 |         if (valueParsed["dtype"] === "html") {


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ray-dashboard-client@1.0.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ray-dashboard-client@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ray\AppData\Roaming\npm-cache\_logs\2021-10-18T21_26_55_218Z-debug.log

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@mattip
Copy link
Contributor

mattip commented Oct 19, 2021

I am not a node expert but I think there are some differences between the different versions of packages in the different containers used to build the dashboard, leading to different demands on the lock file, leading to build failures.

The need for dialog when installing nodejs is also a little troubling in the setting-up-gpu-bootstrap-env-docker-tv build, I think it points to a conflict within the packages in the image. Is there a missing sudo apt upgrade somewhere?

++ sudo apt-get install -y nodejs
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
 nodejs
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
Need to get 25.1 MB of archives.
After this operation, 122 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_14.x bionic/main amd64 nodejs amd64 14.18.1-1nodesource1 [25.1 MB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
Fetched 25.1 MB in 1s (40.4 MB/s)
Selecting previously unselected package nodejs.
(Reading database ... 48282 files and directories currently installed.)
Preparing to unpack .../nodejs_14.18.1-1nodesource1_amd64.deb ...
Unpacking nodejs (14.18.1-1nodesource1) ...
Setting up nodejs (14.18.1-1nodesource1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

@mattip
Copy link
Contributor

mattip commented Oct 19, 2021

Doesn't CI need to install node on windows?

install_node() {
if [ "${OSTYPE}" = msys ] ; then
{ echo "WARNING: Skipping running Node.js due to incompatibilities with Windows"; } 2> /dev/null
return
fi

@mattip
Copy link
Contributor

mattip commented Oct 20, 2021

ping @simon-mo

@pcmoritz
Copy link
Contributor Author

I tried to fix the linting, do you want to check it @simon-mo ? My TypeScript is a bit non-existent/rusty :P

If you know which type to put instead of any that would also be helpful!

@pcmoritz
Copy link
Contributor Author

@mattip We also need to compile the dashboard in Windows, but this fix at least makes it compile (and the dashboard work!) on my local windows machine, which is a good first step.

@simon-mo
Copy link
Contributor

@pcmoritz for your local windows machine, how did you get nodejs, npm, and typescript installed?

I wonder whether we should just try the latest version because these are newer syntax.

@pcmoritz
Copy link
Contributor Author

This is how I'm doing it locally: #19480 (comment)

If you know where to put the node install for windows I can add that to this PR.

@pcmoritz
Copy link
Contributor Author

pcmoritz commented Oct 20, 2021

The code changes are just to make the linter happy after the version upgrade of react-scripts. The only change needed to make the compilation/the dashboard work on Windows was to bump the react-scripts package. The error without that was in the PR description.

If you have a better idea to fix this stuff please let me know, I'm not at all married to this fix :)

@simon-mo
Copy link
Contributor

sounds good, can you merge master so we know the code changes work in macOS and linux as well?

@simon-mo simon-mo merged commit 45f1ff0 into ray-project:master Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants