opensearch-build: `yarn` version incompatibility issue blocks Dashboards plugins CI, docker-image, windows build
❗This issue may block release 2.6
issue description
Multiple Dashboards plugins CI failure reported during plugin bootstrap step, after this commit to Dashboards core merged recently. @opensearch-project/opensearch@2.1.0: The engine "yarn" is incompatible with this module. Expected version "^1.22.10". Got "1.21.1"
yarn run v1.21.1
$ node ../../scripts/osd bootstrap
info [opensearch-dashboards] running yarn
$ node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@~4.5.2".
[3/5] Fetching packages...
warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js").
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error @opensearch-project/opensearch@2.1.0: The engine "yarn" is incompatible with this module. Expected version "^1.22.10". Got "1.21.1"
error Found incompatible module.
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: /opt/hostedtoolcache/node/14.[20](https://github.com/opensearch-project/dashboards-maps/actions/runs/4206519945/jobs/7300112650#step:13:21).1/x64/lib/node_modules/yarn/bin/yarn.js install --non-interactive
at makeError (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:25150:11)
at handlePromise (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:24085:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async installInDir (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:238[21](https://github.com/opensearch-project/dashboards-maps/actions/runs/4206519945/jobs/7300112650#step:13:22):3)
at async Project.installDependencies (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:14780:5)
at async Object.run (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:9003:11)
at async runCommand (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:57870:5)
at async Module.run (/home/runner/work/dashboards-maps/dashboards-maps/OpenSearch-Dashboards/packages/osd-pm/dist/index.js:[26](https://github.com/opensearch-project/dashboards-maps/actions/runs/4206519945/jobs/7300112650#step:13:27)3:3)
error Command failed with exit code 1.
Root cause
The recent commit in OpenSearch Dashboards updates dependency @opensearch-project/opensearch from ^1.1.0to ^2.1.0, where openearch-js2.1.0 specifies yarn: ^1.22.1, in this commit.
Plugin CI workflow fetches yarn version from Openesarch-Dashbaords/package.json file, to set up yarn, and still found 1.21.1. This is causing the yarn version incompatibility, and bootstrap will fail.
Dashboards docker image, windows build scripts are using hardcoded yarn version, which will potentially be impacted, according to @peterzhuamazon
Impact
- All Opensearhc Dashboards Plugin CI & build
- Dashboards docker image build, windows build process, etc
Proposed solution
- step 1: To unblock dashboards plugins CI, Opensearch-Dashboards core repo needs to update
yarnversion inpackage.jsonto^1.22.1https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3443 - step 2: After step 1 is completed, to unblock docker image build, windows build, we could fetch the yarn version on demand from
Openesarch-Dashbaords/package.json, instead of hardcode.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 26 (26 by maintainers)
@AMoo-Miki We should have centralized solution for CI (Build and Test) It will be a surprise if we use two different yarn to build OSD and Plugin
@peterzhuamazon @bbarani @dblock @seanneumann
All the effected plugins were using a flawed logic to install Node.js and Yarn runtimes based on the information they were reading from OSD’s manifest. They all took the ranges OSD provided, manipulated it incorrectly and attempted to install Node and Yarn. I have gone through all the repos and raised PRs with the correct procedure on all of them.
There is also a possibility of some repos using strict versions for their own
engines.*which is a bad and wrong practice. While I did not see this in any repo, i caught one PR that attempted to do so and commented on it.There is also a repo that uses a file named
.node-versionthat we are investigating to remove in the future; I will reach out to them if we decide to remove the file so that they can use.nvmrcinstead.