opensearch-project/ml-commons-dashboards

Node.js v18 Compatibility Test for [ml-commons-dashboards]

Closed this issue · 11 comments

ananzh commented

Introduction

As part of our continued efforts to improve OpenSearch Dashboards, we are planning to upgrade the underlying Node.js version from v14 to v18. This change will enhance performance, add new features, and bolster security. However, such major version changes might also affect the compatibility of existing plugins. Here is more introduction: opensearch-project/OpenSearch-Dashboards#3601.

Therefore, we kindly request assistance in testing this plugin the compatibility of with this new version of Node.js. We've prepared a branch with the Node.js v18 upgrade, which you can find here:
https://github.com/AMoo-Miki/OpenSearch-Dashboards/tree/node-18-webpack-4

Steps to Proceed

  • If you think your plugin won't be affected by OpenSearch Dashboards Node.js upgrade. Pls ignore the rest steps and close the issue directly.
  • Pull the provided branch that includes the Node.js v18 upgrade and OpenSearch 3.0.0.
  • Hook up your plugin with the updated OpenSearch Dashboards.
  • Run your existing test suites and perform manual testing as necessary.
  • If no issues are encountered, feel free to close this issue.
  • If there are any problems, report them in this issue thread and also link them in the overall OpenSearch Dashboards Node.js upgrade issue thread opensearch-project/OpenSearch-Dashboards#4058
    The purpose of linking any questions or issues back to the main issue is to maintain visibility and transparency among all plugin owners. A problem encountered by one plugin might also affect others. This shared knowledge base will foster collaborative problem-solving and prevent duplication of effort.

We appreciate your support and cooperation in ensuring a smooth transition to Node.js v18 for the entire OpenSearch Dashboards community.

Hi @ananzh , we will test the compatibility according above steps. Will paste the testing result here after finished.

Hi @ananzh , I've tested the ml-commons-dashboards plugin based updated OSD branch, ml-commons main branch and ml-commons-dashboards main branch.
The plugin was work fine in my chrome browser
image

But when I test in cypress, I got an error like this:
image
The plugin can't be open in the cypress environment. It's work with 2.x branch. Is there any suggestions about that issue?

ananzh commented

The official Node.js 18 PR raised in OSD: opensearch-project/OpenSearch-Dashboards#4071

ananzh commented

@wanglam Cypress should work with Node.js 18.x and above. Is this in functional test repo or in ml? Could you give me some reproduce steps?

ananzh commented

@wanglam I used a plain OpenSearch and opensearch-project/OpenSearch-Dashboards#4071 to run the cypress test from the functional test repo. I picked one example from vis-builder, and it works well:

Screenshot 2023-05-22 at 10 52 15

Then I tried to use ml-commons-dashboards. I first git download ml-common in the plain OpenSearch. But got this error when run ./gradlew run:

ubuntu@ip-172-31-55-237:~/work/OpenSearch$ ./gradlew run

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/home/ubuntu/work/OpenSearch/plugins/ml-commons/build.gradle' line: 55

* What went wrong:
A problem occurred evaluating project ':plugins:ml-commons'.
> Could not read script '/home/ubuntu/work/OpenSearch/build-tools/repositories.gradle' as it does not exist.

Could you help me on that? Meanwhile from vis-builder test, seems no issue with loading. You could clean cache or re-start your laptop to re-try it.

ananzh commented

opensearch-project/OpenSearch-Dashboards#4071 support node 14, 16 and 18. Pls test on node 18.

nvm install 18.16.0
nvm use 18.16.0
ananzh commented

Since I am not able to run ml-common success, to check the loading issue, I picked another plugin anomaly-detection and just verify the loading on the functional test repo and it seems work well

Screenshot 2023-05-22 at 16 30 50

Would like some reproducing step to help.

Hi @ananzh , Thanks for helping me investigate this issue.
It seems the issue only occurs in my local environment. I've tested the plugin in the remote ubuntu.
image
The results show all test cases was passed. I think we can close this issue.

ananzh commented

@wanglam I also figure it out my issue. I didn't put ml_commons_dashboards.enabled: true in opensearch_dashboards.yml file so ml is not running. I didn't find this config in the DEVELOPER.md but then see it from opensearch.org doc. Here is the cypress test result:

Screenshot 2023-05-23 at 11 59 42
ananzh commented

@wanglam just want to double check that have you use 18.16.0? Cuz @AMoo-Miki 's PR supports node 14 to 18. So you need to specifically use Node.js 18 (v18.16.0) .

I will close the issue. If you r not using Node.js 18 and find issues with that, just re-open it.

@ananzh I've double check in the remote ubuntu, I am running in 18.16.0. There is no issue about the cypress and unit tests in the current main branch.