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

Add Windows Support #191

Closed
2 tasks done
dblock opened this issue Oct 27, 2021 · 32 comments
Closed
2 tasks done

Add Windows Support #191

dblock opened this issue Oct 27, 2021 · 32 comments
Labels

Comments

@dblock
Copy link
Member

dblock commented Oct 27, 2021

Coming from opensearch-project/opensearch-plugins#95, add Windows support.

  • Passing CI on Windows
  • Documentation
@peterzhuamazon
Copy link
Member

Hi Team.

Please look into adding Windows x64/arm64 Chromium Binary for this reports plugin.

As we are starting the process of Windows support.

Thanks.

@anirudha
Copy link
Collaborator

anirudha commented Jul 8, 2022

In the queue... We need to research windows arm.

@joshuali925
Copy link
Member

@setiah or @peterzhuamazon is it confirmed that we will be supporting windows arm64? if so, windows server never released arm64 version (ref), will this be targeting windows 10/11 arm64?

additionally we might be able to run the full chromium in headless mode, but it increases reporting artifact size about 200mb, would it be acceptable or is there a hard limit on artifact size?

@peterzhuamazon
Copy link
Member

Adding @bbarani in the conversation of this.

@setiah
Copy link

setiah commented Jul 13, 2022

@setiah or @peterzhuamazon is it confirmed that we will be supporting windows arm64? if so, windows server never released arm64 version (ref), will this be targeting windows 10/11 arm64?

This is relatively new https://www.zdnet.com/article/microsoft-brings-arm-support-to-azure-virtual-machines/
and I think it should be okay to skip. Elasticsearch doesn't support it and I doubt if it was ever supported for ODFE. The FAQs on opensearch-project/opensearch-build#2312 mention arm64 still in research -

Q4: What CPU architecture do you support in the Windows distribution?
A4: We are aiming to release x64 architecture support 1st, arm64 architecture for Windows is still in research.

@peterzhuamazon
Copy link
Member

Hi @anirudha @joshuali925 what is the progress on chromium support on this?
Would love to see some updates! Thanks. 😄

cc: @setiah

@anirudha
Copy link
Collaborator

researching this further, we will post an update soon on this

@derek-ho
Copy link
Collaborator

Blocked on windows chromium binary incompatibility with pupeteer. Doing some investigation to see whether newer version of chromium will fix this issue. If so then we may need to create a new windows headless chromium binary CC @rupal-bq @joshuali925

@rupal-bq
Copy link
Contributor

Tried building locally on windows but build failed with following error.

ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\Administrator\AppData\Roaming\nvm\v14.20.0\node_modules\yarn\bin\yarn.js run osd:bootstrap
      'rm' is not recognized as an internal or external command,
      operable program or batch file.
      error Command failed with exit code 1.
      $ rm -rf target && tsc
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
          at makeError (C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:25150:11)
          at handlePromise (C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:24085:26)
          at processTicksAndRejections (internal/process/task_queues.js:95:5)
          at async C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:9051:9
          at async scheduleItem (C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:10938:9)
error Command failed with exit code 1.

Blocked on dashboards support

@rupal-bq
Copy link
Contributor

Tried building locally on windows but build failed with following error.

ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\Administrator\AppData\Roaming\nvm\v14.20.0\node_modules\yarn\bin\yarn.js run osd:bootstrap
      'rm' is not recognized as an internal or external command,
      operable program or batch file.
      error Command failed with exit code 1.
      $ rm -rf target && tsc
      info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
          at makeError (C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:25150:11)
          at handlePromise (C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:24085:26)
          at processTicksAndRejections (internal/process/task_queues.js:95:5)
          at async C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:9051:9
          at async scheduleItem (C:\Users\Administrator\Opensearch-Dashboards\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:10938:9)
error Command failed with exit code 1.

Blocked on dashboards support

Switching to git bash fixed this error

@rupal-bq
Copy link
Contributor

Was able to download report on windows with dev server

download_dashboards_report_windows.mov

@derek-ho
Copy link
Collaborator

@rupal-bq and I were able to get this to work with a newer version of chromium. CI is also passing on PR. Will connect with @joshuali925 about generating a newer version of headless chromium binary for windows.

@derek-ho
Copy link
Collaborator

Merged the PR

@derek-ho
Copy link
Collaborator

@joshuali925 @rupal-bq can one of you folks close this issue? I don't have access....

@joshuali925
Copy link
Member

closed by #504

@peterzhuamazon
Copy link
Member

Reopen as the code is only in main.
@derek-ho @joshuali925 could you please add it to 2.x branch backport?

Thanks.

@joshuali925
Copy link
Member

backported

@peterzhuamazon
Copy link
Member

Not able to build on windows:

+ yarn plugin_helpers build --opensearch-dashboards-version=2.4.0
yarn run v1.22.19
$ node ../../scripts/plugin_helpers build --opensearch-dashboards-version=2.4.0
ERROR Plugin located at [C:\Users\Administrator\AppData\Local\Temp\2\tmp8knjp6j1\OpenSearch-Dashboards\plugins\dashboards-reports] must be moved to the plugins directory at the root of the OpenSearch Dashboards
error Command failed with exit code 1.

Despite the dir is in the plugins folder the build still not start.

@joshuali925
Copy link
Member

@peterzhuamazon not able to reproduce, need more information

here is a successful build: https://github.com/opensearch-project/dashboards-reports/actions/runs/3292567970/jobs/5428079881

@anirudha
Copy link
Collaborator

closing this as per the comment

@bbarani
Copy link
Member

bbarani commented Oct 25, 2022

@anirudha Can we please keep this issue open until you hear back from @peterzhuamazon

@bbarani bbarani reopened this Oct 25, 2022
@peterzhuamazon
Copy link
Member

peterzhuamazon commented Oct 25, 2022

Verifying the issue right now will post my findings soon.

Thanks.

@peterzhuamazon
Copy link
Member

I have confirmed that the folder is the correct folder in the correct location, yet it is still not able to build reports dash.

+ pwd
/tmp/tmpzgwnkv7a/OpenSearch-Dashboards/plugins/dashboards-reports
+ ls -l
total 611
-rw-r--r-- 1 Administrator 197121   2791 Oct 25 20:12 DEVELOPER_GUIDE.md
-rw-r--r-- 1 Administrator 197121   2171 Oct 25 20:12 README.md
-rw-r--r-- 1 Administrator 197121  11323 Oct 25 20:12 THIRD-PARTY
-rw-r--r-- 1 Administrator 197121    579 Oct 25 20:12 babel.config.js
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 builds
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 common
-rw-r--r-- 1 Administrator 197121    517 Oct 25 20:12 cypress.json
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:13 node_modules
-rw-r--r-- 1 Administrator 197121    288 Oct 25 20:12 opensearch_dashboards.json
-rw-r--r-- 1 Administrator 197121   2567 Oct 25 20:12 package.json
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 public
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 rendering-engine
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 server
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 test
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:12 translations
-rw-r--r-- 1 Administrator 197121    829 Oct 25 20:12 tsconfig.json
-rw-r--r-- 1 Administrator 197121 317485 Oct 25 20:12 yarn.lock
+ yarn plugin_helpers build --opensearch-dashboards-version=2.4.0
yarn run v1.22.19
$ node ../../scripts/plugin_helpers build --opensearch-dashboards-version=2.4.0
ERROR Plugin located at [C:\Users\Administrator\AppData\Local\Temp\2\tmpzgwnkv7a\OpenSearch-Dashboards\plugins\dashboards-reports] must be moved to the plugins directory at the root of the OpenSearch Dashboards repo
error Command failed with exit code 1.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Oct 25, 2022

@joshuali925
Copy link
Member

could you give steps to reproduce?

Administrator@ MINGW64 ~/Downloads/opensearch-dashboards/plugins/dashboards-reports (2.x)
$ ls -l
total 611
-rw-r--r-- 1 Administrator 197121   2791 Oct 13 17:13 DEVELOPER_GUIDE.md
-rw-r--r-- 1 Administrator 197121   2171 Oct 13 17:13 README.md
-rw-r--r-- 1 Administrator 197121  11323 Oct 13 17:13 THIRD-PARTY
-rw-r--r-- 1 Administrator 197121    579 Oct 13 17:13 babel.config.js
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:28 build
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:24 common
-rw-r--r-- 1 Administrator 197121    517 Oct 13 17:13 cypress.json
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:26 node_modules
-rw-r--r-- 1 Administrator 197121    288 Oct 25 20:23 opensearch_dashboards.json
-rw-r--r-- 1 Administrator 197121   2567 Oct 25 20:23 package.json
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:24 public
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:24 rendering-engine
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:24 server
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:24 test
drwxr-xr-x 1 Administrator 197121      0 Oct 25 20:24 translations
-rw-r--r-- 1 Administrator 197121    829 Oct 13 17:13 tsconfig.json
-rw-r--r-- 1 Administrator 197121 317485 Oct 25 20:23 yarn.lock

Administrator@ MINGW64 ~/Downloads/opensearch-dashboards/plugins/dashboards-reports (2.x)
$ yarn plugin_helpers build --opensearch-dashboards-version=2.4.0
yarn run v1.22.19
$ node ../../scripts/plugin_helpers build --opensearch-dashboards-version=2.4.0
 info Loaded config file from [C:\Users\Administrator\Downloads\opensearch-dashboards\plugins\dashboards-reports\.opensearch_dashboards-plugin-helpers.json]
 info deleting the build and target directories
 info running @osd/optimizer
 │ info initialized, 0 bundles cached
 │ info starting worker [1 bundle]
 │ succ 1 bundles compiled successfully after 13.7 sec
 info copying assets from `public/assets` to build
 info copying server source into the build and converting with babel
 info running yarn to install dependencies
 info compressing plugin into [reportsDashboards-2.4.0.zip]
Done in 40.88s.

@anirudha
Copy link
Collaborator

I am going to close this issue, unless we need to do more work in reporting plugin

@peterzhuamazon
Copy link
Member

Re-open the issue as we are able to reproduce this specifically on jenkins windows agent.
Debugging with @joshuali925.

Thanks.

@peterzhuamazon
Copy link
Member

The issue seems related to dashboards core code returning two different paths literally, but for windows they are the same path:

https://github.com/opensearch-project/OpenSearch-Dashboards/blob/d7004dc5b0392477fdd54ac66b29d231975a173b/packages/osd-plugin-helpers/src/load_opensearch_dashboards_platform_plugin.ts#L47

  const isRootPlugin = parentDir === Path.resolve(REPO_ROOT, 'plugins');
C:\Users\Administrator\AppData\Local\Temp\2\tmpndbrtuhg\OpenSearch-Dashboards\plugins
C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpndbrtuhg\OpenSearch-Dashboards\plugins

In Windows Administrator dir and ADMINI~1 dir is being treated as the same but in typescript === comparison they are not the same, thus fail build.

@peterzhuamazon
Copy link
Member

peterzhuamazon commented Oct 25, 2022

@dblock
Copy link
Member Author

dblock commented Nov 3, 2022

I don't believe integration tests are running, and integration tests are very much part of CI. Reopening. Please close when this and any other gaps between Linux/Windows CI/CD are covered.

@dblock dblock reopened this Nov 3, 2022
@peterzhuamazon
Copy link
Member

Hi, just want to make sure this issue is closed, if all the tasks are completed.

Thanks.

@rupal-bq
Copy link
Contributor

Added integration tests in CI #624. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants