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

chore: add distutils to build phase of Dockerfile #6845

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN cd packages/cli && GIT_COMMIT=${COMMIT} yarn write-git-data
# Note: This step is redundant for the host arch
FROM node:22-alpine as build_deps
WORKDIR /usr/app
RUN apk update && apk add --no-cache g++ make python3 && rm -rf /var/cache/apk/*
RUN apk update && apk add --no-cache g++ make python3 py3-setuptools && rm -rf /var/cache/apk/*
Copy link
Member

@nflaig nflaig Jun 3, 2024

Choose a reason for hiding this comment

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

but is also necessary for build phase

docker build works fine on unstable, what are the requirements for adding this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Was throwing an error for missing distutils when I built locally for debugging the performance regression. Not sure why it didnt work but it didnt...

70.95 (node:97) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
70.95 (Use `node --trace-deprecation ...` to show where the warning was created)
70.95 gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
70.95 gyp http GET https://nodejs.org/download/release/v22.2.0/node-v22.2.0-headers.tar.gz
70.95 gyp http 200 https://nodejs.org/download/release/v22.2.0/node-v22.2.0-headers.tar.gz
70.95 gyp http GET https://nodejs.org/download/release/v22.2.0/SHASUMS256.txt
70.95 gyp http 200 https://nodejs.org/download/release/v22.2.0/SHASUMS256.txt
70.95 gyp info spawn /usr/bin/python3
70.95 gyp info spawn args [
70.95 gyp info spawn args   '/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/gyp_main.py',
70.95 gyp info spawn args   'binding.gyp',
70.95 gyp info spawn args   '-f',
70.95 gyp info spawn args   'make',
70.95 gyp info spawn args   '-I',
70.95 gyp info spawn args   '/usr/app/node_modules/bcrypto/build/config.gypi',
70.95 gyp info spawn args   '-I',
70.95 gyp info spawn args   '/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/addon.gypi',
70.95 gyp info spawn args   '-I',
70.95 gyp info spawn args   '/root/.cache/node-gyp/22.2.0/include/node/common.gypi',
70.95 gyp info spawn args   '-Dlibrary=shared_library',
70.95 gyp info spawn args   '-Dvisibility=default',
70.95 gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/22.2.0',
70.95 gyp info spawn args   '-Dnode_gyp_dir=/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp',
70.95 gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/22.2.0/<(target_arch)/node.lib',
70.95 gyp info spawn args   '-Dmodule_root_dir=/usr/app/node_modules/bcrypto',
70.95 gyp info spawn args   '-Dnode_engine=v8',
70.95 gyp info spawn args   '--depth=.',
70.95 gyp info spawn args   '--no-parallel',
70.95 gyp info spawn args   '--generator-output',
70.95 gyp info spawn args   'build',
70.95 gyp info spawn args   '-Goutput_dir=.'
70.95 gyp info spawn args ]
70.95 Traceback (most recent call last):
70.95   File "/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
70.95     import gyp  # noqa: E402
70.95     ^^^^^^^^^^
70.95   File "/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
70.95     import gyp.input
70.95   File "/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
70.95     from distutils.version import StrictVersion
70.95 ModuleNotFoundError: No module named 'distutils'
70.95 gyp ERR! configure error 
70.95 gyp ERR! stack Error: `gyp` failed with exit code: 1
70.95 gyp ERR! stack     at ChildProcess.onCpExit (/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/lib/configure.js:259:16)
70.95 gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
70.95 gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
70.95 gyp ERR! System Linux 6.3.13-linuxkit
70.95 gyp ERR! command "/usr/local/bin/node" "/usr/app/node_modules/.bin/node-gyp" "rebuild"
70.95 gyp ERR! cwd /usr/app/node_modules/bcrypto
70.95 gyp ERR! node -v v22.2.0
70.95 gyp ERR! node-gyp -v v8.4.1
70.95 gyp ERR! not ok
70.95 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
71.21 info This module is OPTIONAL, you can safely ignore this error
71.21 warning Error running install script for optional dependency: "/usr/app/node_modules/cpu-features: Command failed.
71.21 Exit code: 1
71.21 Command: node buildcheck.js > buildcheck.gypi && node-gyp rebuild
71.21 Arguments: 
71.21 Directory: /usr/app/node_modules/cpu-features
71.21 Output:
71.21 gyp info it worked if it ends with ok
71.21 gyp info using node-gyp@8.4.1
71.21 gyp info using node@22.2.0 | linux | arm64
71.21 (node:126) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
71.21 (Use `node --trace-deprecation ...` to show where the warning was created)
71.21 gyp info find Python using Python version 3.12.3 found at \"/usr/bin/python3\"
71.21 gyp http GET https://nodejs.org/download/release/v22.2.0/node-v22.2.0-headers.tar.gz
71.21 gyp http 200 https://nodejs.org/download/release/v22.2.0/node-v22.2.0-headers.tar.gz
71.21 gyp http GET https://nodejs.org/download/release/v22.2.0/SHASUMS256.txt
71.21 gyp http 200 https://nodejs.org/download/release/v22.2.0/SHASUMS256.txt
71.21 gyp info spawn /usr/bin/python3
71.21 gyp info spawn args [
71.21 gyp info spawn args   '/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/gyp_main.py',
71.21 gyp info spawn args   'binding.gyp',
71.21 gyp info spawn args   '-f',
71.21 gyp info spawn args   'make',
71.21 gyp info spawn args   '-I',
71.21 gyp info spawn args   '/usr/app/node_modules/cpu-features/build/config.gypi',
71.21 gyp info spawn args   '-I',
71.21 gyp info spawn args   '/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/addon.gypi',
71.21 gyp info spawn args   '-I',
71.21 gyp info spawn args   '/root/.cache/node-gyp/22.2.0/include/node/common.gypi',
71.21 gyp info spawn args   '-Dlibrary=shared_library',
71.21 gyp info spawn args   '-Dvisibility=default',
71.21 gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/22.2.0',
71.21 gyp info spawn args   '-Dnode_gyp_dir=/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp',
71.21 gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/22.2.0/<(target_arch)/node.lib',
71.21 gyp info spawn args   '-Dmodule_root_dir=/usr/app/node_modules/cpu-features',
71.21 gyp info spawn args   '-Dnode_engine=v8',
71.21 gyp info spawn args   '--depth=.',
71.21 gyp info spawn args   '--no-parallel',
71.21 gyp info spawn args   '--generator-output',
71.21 gyp info spawn args   'build',
71.21 gyp info spawn args   '-Goutput_dir=.'
71.21 gyp info spawn args ]
71.21 Traceback (most recent call last):
71.21   File \"/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/gyp_main.py\", line 42, in <module>
71.21     import gyp  # noqa: E402
71.21     ^^^^^^^^^^
71.21   File \"/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/pylib/gyp/__init__.py\", line 9, in <module>
71.21     import gyp.input
71.21   File \"/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/gyp/pylib/gyp/input.py\", line 19, in <module>
71.21     from distutils.version import StrictVersion
71.21 ModuleNotFoundError: No module named 'distutils'
71.21 gyp ERR! configure error 
71.21 gyp ERR! stack Error: `gyp` failed with exit code: 1
71.21 gyp ERR! stack     at ChildProcess.onCpExit (/usr/app/node_modules/@chainsafe/blst/node_modules/node-gyp/lib/configure.js:259:16)
71.21 gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
71.21 gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
71.21 gyp ERR! System Linux 6.3.13-linuxkit
71.21 gyp ERR! command \"/usr/local/bin/node\" \"/usr/app/node_modules/.bin/node-gyp\" \"rebuild\"
71.21 gyp ERR! cwd /usr/app/node_modules/cpu-features
71.21 gyp ERR! node -v v22.2.0
71.21 gyp ERR! node-gyp -v v8.4.1
71.21 gyp ERR! not ok"
------
Dockerfile:32
--------------------
  30 |     # Do yarn --force to trigger a rebuild of the native packages
  31 |     # Emmulates `yarn rebuild` which is not available in v1 https://yarnpkg.com/cli/rebuild 
  32 | >>> RUN yarn install --non-interactive --frozen-lockfile --production --force
  33 |     # Rebuild leveldb bindings (required for arm64 build)
  34 |     RUN cd node_modules/classic-level && yarn rebuild
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn install --non-interactive --frozen-lockfile --production --force" did not complete successfully: exit code: 1


COPY --from=build_src /usr/app .

Expand Down
Loading