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

[Build] Build ARM64 for deb and rpm #1285

Merged
merged 2 commits into from
Mar 2, 2022

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Feb 25, 2022

Description

Build ARM64 for deb with the following commands:
yarn build --deb-arm --skip-archives
yarn build --deb-arm --skip-archives --release

Build ARM64 for rpm with the following commands:
yarn build --rpm-arm --skip-archives
yarn build --rpm-arm --skip-archives --release

Signed-off-by: Kawika Avilla kavilla414@gmail.com

Issues Resolved

#1259

Check List

  • New functionality includes testing.
    • All tests pass
      • yarn test:jest
      • yarn test:jest_integration
      • yarn test:ftr
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

@kavilla kavilla requested a review from a team as a code owner February 25, 2022 08:39
@kavilla kavilla added the build Build related additions or modifications label Feb 25, 2022
@kavilla kavilla linked an issue Feb 25, 2022 that may be closed by this pull request
tmarkley
tmarkley previously approved these changes Feb 28, 2022
Copy link
Contributor

@tmarkley tmarkley left a comment

Choose a reason for hiding this comment

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

This is great, thanks Rocky!

Build ARM64 for deb with the following commands:
yarn build --deb-arm --skip-archives
yarn build --deb-arm --skip-archives --release

Build ARM64 for rpm with the following commands:
yarn build --rpm-arm --skip-archives
yarn build --rpm-arm --skip-archives --release

Issue partially resolved:
opensearch-project#1259

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@tmarkley
Copy link
Contributor

I tried running this on an ARM instance and saw failures for both --deb-arm and --rpm-arm:

$ yarn build --rpm-arm --skip-archives --release
yarn run v1.22.17
$ node scripts/build --all-platforms --rpm-arm --skip-archives --release
 info [  global  ] Verifying environment meets requirements
   │ succ Node.js version verified
   │ succ ✓ 0 sec

 info [  global  ] Cleaning artifacts from previous builds
   │ debg Deleting patterns: [
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/.node_binaries'
   │      ]
   │ debg Deleted 3 files/directories
   │ succ ✓ 4 sec

 info [  global  ] Downloading node.js builds for all platforms
   │ debg Downloading shasum values for node version 14.18.2 from https://nodejs.org/dist/v14.18.2/SHASUMS256.txt
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz 83fa18a0e3642235446b66653eb27c169224ae9c1a15a32d6c3d9ddefb154ed4
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz e78e18e01a08b2459d738fc5fec6bd79f2b3dccf85e5122cd646b3385964bc1e
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz fe6159a973e044e4dfd47a5de86fd34e837279bd424e61af69106c12986a8737
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/win-x64/node.exe 95ee8cad4f9d12816cc95a4eb487619c7d230640c4a8d24db4612031200eb1c0
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/win-x64/node.exe and verified checksum
   │ succ ✓ 1 sec

 info [  global  ] Extracting node.js builds for all platforms
   │ succ ✓ 8 sec

 info [  opensearch-dashboards  ] Copying source into platform-generic build directory
   │ succ ✓ 5 sec

 info [  opensearch-dashboards  ] Copying bin scripts into platform-generic build directory
   │ succ ✓ 0 sec

 info [  opensearch-dashboards  ] Creating some empty directories and files to prevent file-permission issues
   │ succ ✓ 0 sec

 info [  opensearch-dashboards  ] Creating README.md file
   │ succ ✓ 0 sec

 info [  opensearch-dashboards  ] Building distributable versions of packages
 info Preparing production build for [@elastic/safer-lodash-set, @osd/ace, @osd/analytics, @osd/apm-config-loader, @osd/config, @osd/config-schema, @osd/i18n, @osd/interpreter, @osd/logging, @osd/monaco, @osd/std, @osd/ui-framework, @osd/ui-shared-deps, @osd/utils]
 info Running script [build] in [@osd/ace]:
$ node ./scripts/build.js
 info Deleting old output
 info [tsc   ] > tsc 
 info [tsc   ] exited with 0 after a few seconds
 succ Copying worker file to target.
 succ Complete
 info Running script [build] in [@osd/analytics]:
$ node scripts/build
 info Deleting old output
 info Starting babel and typescript
 info [babel:web ] > babel src --config-file /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/babel.config.js --out-dir /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/target/web --extensions .ts,.js,.tsx --quiet
 info [babel:node] > babel src --config-file /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/babel.config.js --out-dir /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/target/node --extensions .ts,.js,.tsx --quiet
 info [tsc       ] > tsc 
 info [babel:node] exited with 0 after a few seconds
 info [babel:web ] exited with 0 after a few seconds
 info [tsc       ] exited with 0 after a few seconds
 succ Complete
 info Running script [build] in [@osd/config-schema]:
$ tsc
 info Running script [build] in [@osd/i18n]:
...
 info [  opensearch-dashboards  ] Creating rpm-arm package
   │ debg calling fpm with args: [
   │        '--force',
   │        '-t',
   │        'rpm',
   │        '--package',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.rpm',
   │        '-s',
   │        'dir',
   │        '--name',
   │        'opensearch-dashboards',
   │        '--description',
   │        'Explore and visualize your OpenSearch data',
   │        '--version',
   │        '2.0.0',
   │        '--url',
   │        'https://opensearch.org',
   │        '--vendor',
   │        'OpenSearch',
   │        '--maintainer',
   │        'OpenSearch Dashboards Team <opensearch@amazon.com>',
   │        '--license',
   │        'ASL 2.0',
   │        '--conflicts',
   │        'opensearch-dashboards',
   │        '--after-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh',
   │        '--before-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh',
   │        '--before-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh',
   │        '--after-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh',
   │        '--config-files',
   │        '/etc/opensearch-dashboards/opensearch_dashboards.yml',
   │        '--template-value',
   │        'user=opensearch-dashboards',
   │        '--template-value',
   │        'group=opensearch-dashboards',
   │        '--template-value',
   │        'optimizeDir=/usr/share/opensearch-dashboards/optimize',
   │        '--template-value',
   │        'configDir=/etc/opensearch-dashboards',
   │        '--template-value',
   │        'pluginsDir=/usr/share/opensearch-dashboards/plugins',
   │        '--template-value',
   │        'dataDir=/var/lib/opensearch-dashboards',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/config',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/data',
   │        '--architecture',
   │        'arm64',
   │        '--rpm-os',
   │        'linux',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/'
   │      ]
   │ info $ fpm --force -t rpm --package /home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.rpm -s dir --name opensearch-dashboards --description Explore and visualize your OpenSearch data --version 2.0.0 --url https://opensearch.org --vendor OpenSearch --maintainer OpenSearch Dashboards Team <opensearch@amazon.com> --license ASL 2.0 --conflicts opensearch-dashboards --after-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh --before-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh --before-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh --after-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh --config-files /etc/opensearch-dashboards/opensearch_dashboards.yml --template-value user=opensearch-dashboards --template-value group=opensearch-dashboards --template-value optimizeDir=/usr/share/opensearch-dashboards/optimize --template-value configDir=/etc/opensearch-dashboards --template-value pluginsDir=/usr/share/opensearch-dashboards/plugins --template-value dataDir=/var/lib/opensearch-dashboards --exclude usr/share/opensearch-dashboards/config --exclude usr/share/opensearch-dashboards/data --architecture arm64 --rpm-os linux /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/
   │ERROR failure 0 sec
   │ERROR Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
   │          at new NodeError (internal/errors.js:322:7)
   │          at Socket.onclose (internal/streams/end-of-stream.js:117:38)
   │          at Socket.emit (events.js:412:35)
   │          at Pipe.<anonymous> (net.js:686:12)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
20:04:42 ubuntu /home/ubuntu/ws/OpenSearch-Dashboards avillk/deb-rpm-arm64
$ yarn build --deb-arm --skip-archives --release
yarn run v1.22.17
$ node scripts/build --all-platforms --deb-arm --skip-archives --release
 info [  global  ] Verifying environment meets requirements
   │ succ Node.js version verified
   │ succ ✓ 0 sec

 info [  global  ] Cleaning artifacts from previous builds
   │ debg Deleting patterns: [
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/.node_binaries'
   │      ]
   │ debg Deleted 3 files/directories
   │ succ ✓ 4 sec

 info [  global  ] Downloading node.js builds for all platforms
   │ debg Downloading shasum values for node version 14.18.2 from https://nodejs.org/dist/v14.18.2/SHASUMS256.txt
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz 83fa18a0e3642235446b66653eb27c169224ae9c1a15a32d6c3d9ddefb154ed4
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz fe6159a973e044e4dfd47a5de86fd34e837279bd424e61af69106c12986a8737
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/win-x64/node.exe 95ee8cad4f9d12816cc95a4eb487619c7d230640c4a8d24db4612031200eb1c0
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz e78e18e01a08b2459d738fc5fec6bd79f2b3dccf85e5122cd646b3385964bc1e
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/win-x64/node.exe and verified checksum
   │ succ ✓ 1 sec

 info [  global  ] Extracting node.js builds for all platforms
   │ succ ✓ 8 sec
...
 info [  opensearch-dashboards  ] Creating deb-arm package
   │ debg calling fpm with args: [
   │        '--force',
   │        '-t',
   │        'deb',
   │        '--package',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.deb',
   │        '-s',
   │        'dir',
   │        '--name',
   │        'opensearch-dashboards',
   │        '--description',
   │        'Explore and visualize your OpenSearch data',
   │        '--version',
   │        '2.0.0',
   │        '--url',
   │        'https://opensearch.org',
   │        '--vendor',
   │        'OpenSearch',
   │        '--maintainer',
   │        'OpenSearch Dashboards Team <opensearch@amazon.com>',
   │        '--license',
   │        'ASL-2.0',
   │        '--conflicts',
   │        'opensearch-dashboards',
   │        '--after-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh',
   │        '--before-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh',
   │        '--before-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh',
   │        '--after-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh',
   │        '--config-files',
   │        '/etc/opensearch-dashboards/opensearch_dashboards.yml',
   │        '--template-value',
   │        'user=opensearch-dashboards',
   │        '--template-value',
   │        'group=opensearch-dashboards',
   │        '--template-value',
   │        'optimizeDir=/usr/share/opensearch-dashboards/optimize',
   │        '--template-value',
   │        'configDir=/etc/opensearch-dashboards',
   │        '--template-value',
   │        'pluginsDir=/usr/share/opensearch-dashboards/plugins',
   │        '--template-value',
   │        'dataDir=/var/lib/opensearch-dashboards',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/config',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/data',
   │        '--architecture',
   │        'arm64',
   │        '--deb-priority',
   │        'optional',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/'
   │      ]
   │ info $ fpm --force -t deb --package /home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.deb -s dir --name opensearch-dashboards --description Explore and visualize your OpenSearch data --version 2.0.0 --url https://opensearch.org --vendor OpenSearch --maintainer OpenSearch Dashboards Team <opensearch@amazon.com> --license ASL-2.0 --conflicts opensearch-dashboards --after-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh --before-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh --before-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh --after-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh --config-files /etc/opensearch-dashboards/opensearch_dashboards.yml --template-value user=opensearch-dashboards --template-value group=opensearch-dashboards --template-value optimizeDir=/usr/share/opensearch-dashboards/optimize --template-value configDir=/etc/opensearch-dashboards --template-value pluginsDir=/usr/share/opensearch-dashboards/plugins --template-value dataDir=/var/lib/opensearch-dashboards --exclude usr/share/opensearch-dashboards/config --exclude usr/share/opensearch-dashboards/data --architecture arm64 --deb-priority optional /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/
   │ERROR failure 0 sec
   │ERROR Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
   │          at new NodeError (internal/errors.js:322:7)
   │          at Socket.onclose (internal/streams/end-of-stream.js:117:38)
   │          at Socket.emit (events.js:412:35)
   │          at Pipe.<anonymous> (net.js:686:12)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@kavilla
Copy link
Member Author

kavilla commented Mar 1, 2022

I tried running this on an ARM instance and saw failures for both --deb-arm and --rpm-arm:

$ yarn build --rpm-arm --skip-archives --release
yarn run v1.22.17
$ node scripts/build --all-platforms --rpm-arm --skip-archives --release
 info [  global  ] Verifying environment meets requirements
   │ succ Node.js version verified
   │ succ ✓ 0 sec

 info [  global  ] Cleaning artifacts from previous builds
   │ debg Deleting patterns: [
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/.node_binaries'
   │      ]
   │ debg Deleted 3 files/directories
   │ succ ✓ 4 sec

 info [  global  ] Downloading node.js builds for all platforms
   │ debg Downloading shasum values for node version 14.18.2 from https://nodejs.org/dist/v14.18.2/SHASUMS256.txt
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz 83fa18a0e3642235446b66653eb27c169224ae9c1a15a32d6c3d9ddefb154ed4
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz e78e18e01a08b2459d738fc5fec6bd79f2b3dccf85e5122cd646b3385964bc1e
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz fe6159a973e044e4dfd47a5de86fd34e837279bd424e61af69106c12986a8737
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/win-x64/node.exe 95ee8cad4f9d12816cc95a4eb487619c7d230640c4a8d24db4612031200eb1c0
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/win-x64/node.exe and verified checksum
   │ succ ✓ 1 sec

 info [  global  ] Extracting node.js builds for all platforms
   │ succ ✓ 8 sec

 info [  opensearch-dashboards  ] Copying source into platform-generic build directory
   │ succ ✓ 5 sec

 info [  opensearch-dashboards  ] Copying bin scripts into platform-generic build directory
   │ succ ✓ 0 sec

 info [  opensearch-dashboards  ] Creating some empty directories and files to prevent file-permission issues
   │ succ ✓ 0 sec

 info [  opensearch-dashboards  ] Creating README.md file
   │ succ ✓ 0 sec

 info [  opensearch-dashboards  ] Building distributable versions of packages
 info Preparing production build for [@elastic/safer-lodash-set, @osd/ace, @osd/analytics, @osd/apm-config-loader, @osd/config, @osd/config-schema, @osd/i18n, @osd/interpreter, @osd/logging, @osd/monaco, @osd/std, @osd/ui-framework, @osd/ui-shared-deps, @osd/utils]
 info Running script [build] in [@osd/ace]:
$ node ./scripts/build.js
 info Deleting old output
 info [tsc   ] > tsc 
 info [tsc   ] exited with 0 after a few seconds
 succ Copying worker file to target.
 succ Complete
 info Running script [build] in [@osd/analytics]:
$ node scripts/build
 info Deleting old output
 info Starting babel and typescript
 info [babel:web ] > babel src --config-file /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/babel.config.js --out-dir /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/target/web --extensions .ts,.js,.tsx --quiet
 info [babel:node] > babel src --config-file /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/babel.config.js --out-dir /home/ubuntu/ws/OpenSearch-Dashboards/packages/osd-analytics/target/node --extensions .ts,.js,.tsx --quiet
 info [tsc       ] > tsc 
 info [babel:node] exited with 0 after a few seconds
 info [babel:web ] exited with 0 after a few seconds
 info [tsc       ] exited with 0 after a few seconds
 succ Complete
 info Running script [build] in [@osd/config-schema]:
$ tsc
 info Running script [build] in [@osd/i18n]:
...
 info [  opensearch-dashboards  ] Creating rpm-arm package
   │ debg calling fpm with args: [
   │        '--force',
   │        '-t',
   │        'rpm',
   │        '--package',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.rpm',
   │        '-s',
   │        'dir',
   │        '--name',
   │        'opensearch-dashboards',
   │        '--description',
   │        'Explore and visualize your OpenSearch data',
   │        '--version',
   │        '2.0.0',
   │        '--url',
   │        'https://opensearch.org',
   │        '--vendor',
   │        'OpenSearch',
   │        '--maintainer',
   │        'OpenSearch Dashboards Team <opensearch@amazon.com>',
   │        '--license',
   │        'ASL 2.0',
   │        '--conflicts',
   │        'opensearch-dashboards',
   │        '--after-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh',
   │        '--before-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh',
   │        '--before-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh',
   │        '--after-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh',
   │        '--config-files',
   │        '/etc/opensearch-dashboards/opensearch_dashboards.yml',
   │        '--template-value',
   │        'user=opensearch-dashboards',
   │        '--template-value',
   │        'group=opensearch-dashboards',
   │        '--template-value',
   │        'optimizeDir=/usr/share/opensearch-dashboards/optimize',
   │        '--template-value',
   │        'configDir=/etc/opensearch-dashboards',
   │        '--template-value',
   │        'pluginsDir=/usr/share/opensearch-dashboards/plugins',
   │        '--template-value',
   │        'dataDir=/var/lib/opensearch-dashboards',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/config',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/data',
   │        '--architecture',
   │        'arm64',
   │        '--rpm-os',
   │        'linux',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/'
   │      ]
   │ info $ fpm --force -t rpm --package /home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.rpm -s dir --name opensearch-dashboards --description Explore and visualize your OpenSearch data --version 2.0.0 --url https://opensearch.org --vendor OpenSearch --maintainer OpenSearch Dashboards Team <opensearch@amazon.com> --license ASL 2.0 --conflicts opensearch-dashboards --after-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh --before-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh --before-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh --after-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh --config-files /etc/opensearch-dashboards/opensearch_dashboards.yml --template-value user=opensearch-dashboards --template-value group=opensearch-dashboards --template-value optimizeDir=/usr/share/opensearch-dashboards/optimize --template-value configDir=/etc/opensearch-dashboards --template-value pluginsDir=/usr/share/opensearch-dashboards/plugins --template-value dataDir=/var/lib/opensearch-dashboards --exclude usr/share/opensearch-dashboards/config --exclude usr/share/opensearch-dashboards/data --architecture arm64 --rpm-os linux /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/
   │ERROR failure 0 sec
   │ERROR Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
   │          at new NodeError (internal/errors.js:322:7)
   │          at Socket.onclose (internal/streams/end-of-stream.js:117:38)
   │          at Socket.emit (events.js:412:35)
   │          at Pipe.<anonymous> (net.js:686:12)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
20:04:42 ubuntu /home/ubuntu/ws/OpenSearch-Dashboards avillk/deb-rpm-arm64
$ yarn build --deb-arm --skip-archives --release
yarn run v1.22.17
$ node scripts/build --all-platforms --deb-arm --skip-archives --release
 info [  global  ] Verifying environment meets requirements
   │ succ Node.js version verified
   │ succ ✓ 0 sec

 info [  global  ] Cleaning artifacts from previous builds
   │ debg Deleting patterns: [
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/.node_binaries'
   │      ]
   │ debg Deleted 3 files/directories
   │ succ ✓ 4 sec

 info [  global  ] Downloading node.js builds for all platforms
   │ debg Downloading shasum values for node version 14.18.2 from https://nodejs.org/dist/v14.18.2/SHASUMS256.txt
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz 83fa18a0e3642235446b66653eb27c169224ae9c1a15a32d6c3d9ddefb154ed4
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz fe6159a973e044e4dfd47a5de86fd34e837279bd424e61af69106c12986a8737
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/win-x64/node.exe 95ee8cad4f9d12816cc95a4eb487619c7d230640c4a8d24db4612031200eb1c0
   │ debg Attempting download of https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz e78e18e01a08b2459d738fc5fec6bd79f2b3dccf85e5122cd646b3385964bc1e
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-darwin-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-x64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/node-v14.18.2-linux-arm64.tar.gz and verified checksum
   │ debg Downloaded https://nodejs.org/dist/v14.18.2/win-x64/node.exe and verified checksum
   │ succ ✓ 1 sec

 info [  global  ] Extracting node.js builds for all platforms
   │ succ ✓ 8 sec
...
 info [  opensearch-dashboards  ] Creating deb-arm package
   │ debg calling fpm with args: [
   │        '--force',
   │        '-t',
   │        'deb',
   │        '--package',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.deb',
   │        '-s',
   │        'dir',
   │        '--name',
   │        'opensearch-dashboards',
   │        '--description',
   │        'Explore and visualize your OpenSearch data',
   │        '--version',
   │        '2.0.0',
   │        '--url',
   │        'https://opensearch.org',
   │        '--vendor',
   │        'OpenSearch',
   │        '--maintainer',
   │        'OpenSearch Dashboards Team <opensearch@amazon.com>',
   │        '--license',
   │        'ASL-2.0',
   │        '--conflicts',
   │        'opensearch-dashboards',
   │        '--after-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh',
   │        '--before-install',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh',
   │        '--before-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh',
   │        '--after-remove',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh',
   │        '--config-files',
   │        '/etc/opensearch-dashboards/opensearch_dashboards.yml',
   │        '--template-value',
   │        'user=opensearch-dashboards',
   │        '--template-value',
   │        'group=opensearch-dashboards',
   │        '--template-value',
   │        'optimizeDir=/usr/share/opensearch-dashboards/optimize',
   │        '--template-value',
   │        'configDir=/etc/opensearch-dashboards',
   │        '--template-value',
   │        'pluginsDir=/usr/share/opensearch-dashboards/plugins',
   │        '--template-value',
   │        'dataDir=/var/lib/opensearch-dashboards',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/config',
   │        '--exclude',
   │        'usr/share/opensearch-dashboards/data',
   │        '--architecture',
   │        'arm64',
   │        '--deb-priority',
   │        'optional',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/',
   │        '/home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/'
   │      ]
   │ info $ fpm --force -t deb --package /home/ubuntu/ws/OpenSearch-Dashboards/target/NAME-2.0.0-arm64.deb -s dir --name opensearch-dashboards --description Explore and visualize your OpenSearch data --version 2.0.0 --url https://opensearch.org --vendor OpenSearch --maintainer OpenSearch Dashboards Team <opensearch@amazon.com> --license ASL-2.0 --conflicts opensearch-dashboards --after-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_install.sh --before-install /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_install.sh --before-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/pre_remove.sh --after-remove /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/package_scripts/post_remove.sh --config-files /etc/opensearch-dashboards/opensearch_dashboards.yml --template-value user=opensearch-dashboards --template-value group=opensearch-dashboards --template-value optimizeDir=/usr/share/opensearch-dashboards/optimize --template-value configDir=/etc/opensearch-dashboards --template-value pluginsDir=/usr/share/opensearch-dashboards/plugins --template-value dataDir=/var/lib/opensearch-dashboards --exclude usr/share/opensearch-dashboards/config --exclude usr/share/opensearch-dashboards/data --architecture arm64 --deb-priority optional /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/=/usr/share/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/config/=/etc/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/build/opensearch-dashboards-2.0.0-linux-arm64/data/=/var/lib/opensearch-dashboards/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/sysv/=/ /home/ubuntu/ws/OpenSearch-Dashboards/src/dev/build/tasks/os_packages/service_templates/systemd/=/
   │ERROR failure 0 sec
   │ERROR Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
   │          at new NodeError (internal/errors.js:322:7)
   │          at Socket.onclose (internal/streams/end-of-stream.js:117:38)
   │          at Socket.emit (events.js:412:35)
   │          at Pipe.<anonymous> (net.js:686:12)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Hey thanks for checking. I created an Ubuntu ARM64, instance and I believe that could be the issue. Was attempting to create an AL2 ARM64 but wasn't able to. But I was able to create an ARM64 deb package, and install it on my ARM64 Ubuntu instance and start OpenSearch Dashboards with:

sudo dpkg -i opensearch-dashboards-2.0.0-arm64.deb 
sudo ./etc/init.d/opensearch-dashboards start

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@kavilla kavilla merged commit 5941044 into opensearch-project:main Mar 2, 2022
@kavilla kavilla deleted the avillk/deb-rpm-arm64 branch March 2, 2022 07:00
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 2, 2022
* [Build] Build ARM64 for deb and rpm

Build ARM64 for deb with the following commands:
yarn build --deb-arm --skip-archives
yarn build --deb-arm --skip-archives --release

Build ARM64 for rpm with the following commands:
yarn build --rpm-arm --skip-archives
yarn build --rpm-arm --skip-archives --release

Issue partially resolved:
#1259

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 5941044)
kavilla added a commit that referenced this pull request Mar 3, 2022
* [Build] Build ARM64 for deb and rpm

Build ARM64 for deb with the following commands:
yarn build --deb-arm --skip-archives
yarn build --deb-arm --skip-archives --release

Build ARM64 for rpm with the following commands:
yarn build --rpm-arm --skip-archives
yarn build --rpm-arm --skip-archives --release

Issue partially resolved:
#1259

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
(cherry picked from commit 5941044)

Co-authored-by: Kawika Avilla <kavilla414@gmail.com>
@qinzehua
Copy link

qinzehua commented Mar 8, 2022

I got the same error when I ran yarn build --release --rpm. My current branch is at 1.2 and my running environment is centos 7.9

@kavilla
Copy link
Member Author

kavilla commented Mar 8, 2022

@qinzehua centos 7.9 arm?

@qinzehua
Copy link

qinzehua commented Mar 8, 2022

@qinzehua centos 7.9 arm?

centos 7.9 x86_64

@kavilla
Copy link
Member Author

kavilla commented Mar 8, 2022

Do you see the same when you pass --skip-archives, if so it might be failing for the same reason as most that a local library is missing. My gut feeling is that it's dealing with chromium since builds fail to build on ARM64. But will need to dive into more but will track it with this ticket until I have ensured it's not related to that. Thank you for checking and commenting, it really helps to have this insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build related additions or modifications v1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] --rpm does not actually build RPM artifact
4 participants