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

Support building and testing NodeJS on RHEL10 host #471

Merged
merged 4 commits into from
Jan 29, 2025

Conversation

phracek
Copy link
Member

@phracek phracek commented Jan 22, 2025

This pull request supports building and testing nodejs-container on RHEL10 host.

It is separated into two commits:

  • the first adds Dockerfile.rhel10 files
  • second commit updates README.md files

Copy link

github-actions bot commented Jan 22, 2025

Pull Request validation

Failed

🔴 Failed or pending statuses - Testing Farm - CentOS Stream 10 - 22[error],Testing Farm - CentOS Stream 9 - 20[error],Testing Farm - RHEL10 - 22[error]

Success

🟢 Review - Reviewed by a member
🟢 Approval - Changes were approved

@phracek
Copy link
Member Author

phracek commented Jan 22, 2025

Difference between C10S and RHEL10 is:

$  diff -u 22/Dockerfile.c10s 22/Dockerfile.rhel10
--- 22/Dockerfile.c10s  2024-10-17 10:54:46
+++ 22/Dockerfile.rhel10        2025-01-22 12:43:12
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-core-c10s:c10s
+FROM ubi10/s2i-core:latest

 # This image provides a Node.JS environment you can use to run your Node.JS
 # applications.
@@ -46,12 +46,12 @@
       com.redhat.deployments-dir="${APP_ROOT}/src" \
       com.redhat.dev-mode.port="DEBUG_PORT:5858" \
       com.redhat.component="${NAME}-${NODEJS_VERSION}-container" \
-      name="sclorg/$NAME-$NODEJS_VERSION-c10s" \
+      name="ubi10/$NAME-$NODEJS_VERSION" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <[email protected]>" \
       help="For more information visit https://github.com/sclorg/s2i-nodejs-container" \
-      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/$NAME-$NODEJS_VERSION-c10s:latest <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> ubi10/$NAME-$NODEJS_VERSION <APP-NAME>"

 # Package libatomic_ops was removed
 RUN INSTALL_PKGS="make gcc gcc-c++ git openssl-devel nodejs nodejs-nodemon nodejs-npm nss_wrapper-libs which" && \

Difference between RHEL9 and RHEL10 is:

$ diff -u 22/Dockerfile.rhel9 22/Dockerfile.rhel10
--- 22/Dockerfile.rhel9 2024-10-15 09:42:51
+++ 22/Dockerfile.rhel10        2025-01-22 12:43:12
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-core:1
+FROM ubi10/s2i-core:latest

 # This image provides a Node.JS environment you can use to run your Node.JS
 # applications.
@@ -21,7 +21,7 @@
     NAME=nodejs \
     NPM_CONFIG_PREFIX=$HOME/.npm-global \
     PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \
-    CNB_STACK_ID=com.redhat.stacks.ubi9-nodejs-20 \
+    CNB_STACK_ID=com.redhat.stacks.c10s-nodejs-22 \
     CNB_USER_ID=1001 \
     CNB_GROUP_ID=0

@@ -41,24 +41,25 @@
       io.openshift.tags="builder,$NAME,${NAME}${NODEJS_VERSION}" \
       io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
       io.s2i.scripts-url="image:///usr/libexec/s2i" \
-      io.buildpacks.stack.id="com.redhat.stacks.ubi9-nodejs-20" \
+      io.buildpacks.stack.id="com.redhat.stacks.c10s-nodejs-22" \
       com.redhat.dev-mode="DEV_MODE:false" \
       com.redhat.deployments-dir="${APP_ROOT}/src" \
       com.redhat.dev-mode.port="DEBUG_PORT:5858" \
       com.redhat.component="${NAME}-${NODEJS_VERSION}-container" \
-      name="ubi9/$NAME-$NODEJS_VERSION" \
+      name="ubi10/$NAME-$NODEJS_VERSION" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <[email protected]>" \
       help="For more information visit https://github.com/sclorg/s2i-nodejs-container" \
-      usage="s2i build <SOURCE-REPOSITORY> ubi9/$NAME-$NODEJS_VERSION:latest <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> ubi10/$NAME-$NODEJS_VERSION <APP-NAME>"

-RUN dnf -y module enable nodejs:$NODEJS_VERSION && \
-    MODULE_DEPS="make gcc gcc-c++ git openssl-devel" && \
-    INSTALL_PKGS="$MODULE_DEPS nodejs npm nodejs-nodemon nss_wrapper-libs which" && \
-    ln -s /usr/lib/node_modules/nodemon/bin/nodemon.js /usr/bin/nodemon && \
+# Package libatomic_ops was removed
+RUN INSTALL_PKGS="make gcc gcc-c++ git openssl-devel nodejs nodejs-nodemon nodejs-npm nss_wrapper-libs which" && \
     dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
+    rm /usr/bin/node && ln -s /usr/bin/node-$NODEJS_VERSION /usr/bin/node && \
+    rm /usr/bin/npm && ln -s /usr/bin/npm-$NODEJS_VERSION /usr/bin/npm && \
+    rm /usr/bin/npx && ln -s /usr/bin/npx-$NODEJS_VERSION /usr/bin/npx && \
     node -v | grep -qe "^v$NODEJS_VERSION\." && echo "Found VERSION $NODEJS_VERSION" && \
     dnf -y clean all --enablerepo='*'


@phracek
Copy link
Member Author

phracek commented Jan 22, 2025

[test]

@phracek
Copy link
Member Author

phracek commented Jan 22, 2025

Difference between C10S and RHEL10 is:

$ diff -u 22-minimal/Dockerfile.c10s 22-minimal/Dockerfile.rhel10
--- 22-minimal/Dockerfile.c10s  2024-10-15 09:42:51
+++ 22-minimal/Dockerfile.rhel10        2025-01-22 12:49:40
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-core-c10s
+FROM ubi10/ubi-minimal

 EXPOSE 8080

@@ -43,16 +43,19 @@
       com.redhat.deployments-dir="${APP_ROOT}/src" \
       com.redhat.dev-mode.port="DEBUG_PORT:5858" \
       com.redhat.component="${NAME}-${NODEJS_VERSION}-minimal-container" \
-      name="sclorg/$NAME-$NODEJS_VERSION-minimal-c10s" \
+      name="ubi9/$NAME-$NODEJS_VERSION-minimal" \
       version="1" \
+      com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <[email protected]>" \
       help="For more information visit https://github.com/sclorg/s2i-nodejs-container"

 # nodejs-full-i18n is included for error strings
-RUN INSTALL_PKGS="nodejs$NODEJS_VERSION nodejs-nodemon nodejs$NODEJS_VERSION-full-i18n npm findutils tar which" && \
-    dnf -y --nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \
-    node-22 -v | grep -qe "^v$NODEJS_VERSION\." && echo "Found VERSION $NODEJS_VERSION" && \
-    dnf clean all && \
+RUN INSTALL_PKGS="nodejs nodejs-nodemon nodejs-full-i18n npm findutils tar which" && \
+    microdnf -y module disable nodejs && \
+    microdnf -y module enable nodejs:$NODEJS_VERSION && \
+    microdnf -y --nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \
+    node -v | grep -qe "^v$NODEJS_VERSION\." && echo "Found VERSION $NODEJS_VERSION" && \
+    microdnf clean all && \
     rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.*

 COPY ./s2i/bin/ /usr/libexec/s2i

Difference between 22-minimal RHEL9 and RHEL10 is:

$  diff -u 22-minimal/Dockerfile.rhel9 22-minimal/Dockerfile.rhel10
--- 22-minimal/Dockerfile.rhel9 2024-10-15 09:42:51
+++ 22-minimal/Dockerfile.rhel10        2025-01-22 12:49:40
@@ -1,4 +1,4 @@
-FROM ubi9/ubi-minimal
+FROM ubi10/ubi-minimal

 EXPOSE 8080

@@ -16,7 +16,7 @@
     # The $HOME is not set by default, but some applications need this variable
     HOME=/opt/app-root/src \
     NPM_RUN=start \
-    PLATFORM="el9" \
+    PLATFORM="el10" \
     NODEJS_VERSION=22 \
     NPM_RUN=start \
     NAME=nodejs

Copy link

github-actions bot commented Jan 22, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
CentOS Stream 9 - 20-minimalCentOS-Stream-9x86_64✅ passed27.01.2025 15:55:3710min 14stest pipeline
CentOS Stream 10 - 22-minimalCentOS-Stream-10x86_64✅ passed27.01.2025 15:55:599min 8stest pipeline
CentOS Stream 10 - 22CentOS-Stream-10x86_64❌ error28.01.2025 12:20:3110min 17stest pipeline
CentOS Stream 9 - 20CentOS-Stream-9x86_64❌ error28.01.2025 12:20:2813min 54stest pipeline
Fedora - 18-minimalFedora-latestx86_64✅ passed27.01.2025 15:55:3811min 57stest pipeline
Fedora - 20-minimalFedora-latestx86_64✅ passed27.01.2025 15:55:3811min 40stest pipeline
Fedora - 22-minimalFedora-latestx86_64✅ passed27.01.2025 13:51:3613min 15stest pipeline
Fedora - 20Fedora-latestx86_64✅ passed27.01.2025 15:55:4015min 34stest pipeline
Fedora - 18Fedora-latestx86_64✅ passed27.01.2025 15:55:3912min 58stest pipeline
RHEL9 - 18-minimalRHEL-9.4.0-Nightlyx86_64✅ passed27.01.2025 15:55:3717min 31stest pipeline
RHEL9 - 20-minimalRHEL-9.4.0-Nightlyx86_64✅ passed27.01.2025 15:55:4915min 52stest pipeline
Fedora - 22Fedora-latestx86_64✅ passed27.01.2025 15:55:5016min 3stest pipeline
RHEL9 - 18RHEL-9.4.0-Nightlyx86_64✅ passed27.01.2025 15:55:3616min 42stest pipeline
RHEL8 - 18-minimalRHEL-8.10.0-Nightlyx86_64✅ passed27.01.2025 15:55:3719min 23stest pipeline
RHEL10 - 22RHEL-10-Nightlyx86_64❌ error28.01.2025 12:20:2818min 36stest pipeline
RHEL8 - 18RHEL-8.10.0-Nightlyx86_64✅ passed27.01.2025 15:55:3719min 8stest pipeline
RHEL8 - 20-minimalRHEL-8.10.0-Nightlyx86_64✅ passed27.01.2025 13:43:2918min 5stest pipeline
RHEL9 - 20RHEL-9.4.0-Nightlyx86_64✅ passed27.01.2025 15:55:3719min 45stest pipeline
RHEL9 - 22RHEL-9.4.0-Nightlyx86_64✅ passed27.01.2025 15:55:5019min 16stest pipeline
RHEL8 - 20RHEL-8.10.0-Nightlyx86_64✅ passed27.01.2025 15:55:4922min 25stest pipeline
RHEL10 - 22-minimalRHEL-10-Nightlyx86_64✅ passed27.01.2025 16:09:0818min 20stest pipeline
RHEL9 - 22-minimalRHEL-9.4.0-Nightlyx86_64✅ passed27.01.2025 16:09:1215min 45stest pipeline

Instead of `ubi10/ubi-minimal` it is `ubi10-minimal`

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Jan 27, 2025

Let's re-test after fix base image for NodeJS 22-minimal

[test]

Pull image ubi10/nodejs-22 in case testing
container NodeJS-22 minimal

Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Jan 27, 2025

[test]

@phracek
Copy link
Member Author

phracek commented Jan 28, 2025

@lholmquist @pacostas Please take a look at it. Also, Dockerfile differences are present. It should be easy to review.

@phracek phracek requested a review from lholmquist January 28, 2025 12:25
@phracek
Copy link
Member Author

phracek commented Jan 28, 2025

RHEL10 22 failed here:

 [PASSED] for 'hw' test_node_cmd_development_init_wrapper_true (00:00:02)
 [PASSED] for 'hw' test_init_wrapper_false_development (00:00:01)
 [FAILED] for 'binary' test_run_binary_application (00:01:09)
 [PASSED] for 'binary' test_node_cmd_development_init_wrapper_true (00:00:02)

the log is

npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/opt/app-root/src/node_modules/node-rdkafka/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/lib/node_modules_22/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/opt/app-root/src/.cache/node-gyp/22.11.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/opt/app-root/src/.cache/node-gyp/22.11.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules_22/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/opt/app-root/src/.cache/node-gyp/22.11.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/opt/app-root/src/node_modules/node-rdkafka',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error rdkafka_admin.c: In function 'rd_kafka_UserScramCredentialUpsertion_new':
npm error rdkafka_admin.c:5986:21: error: implicit declaration of function 'RAND_priv_bytes' [-Wimplicit-function-declaration]
npm error  5986 |                 if (RAND_priv_bytes(random_salt, sizeof(random_salt)) == 1) {
npm error       |                     ^~~~~~~~~~~~~~~
npm error make[2]: *** [../mklove/Makefile.base:97: rdkafka_admin.o] Error 1
npm error make[1]: *** [Makefile:27: libs] Error 2
npm error make: *** [deps/librdkafka.target.mk:30: 11a9e3388a67e1ca5c31c1d8da49cb6d2714eb41.intermediate] Error 2
npm error gyp ERR! build error 
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules_22/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Linux 6.12.0-45.el10.x86_64
npm error gyp ERR! command "/usr/bin/node-22" "/usr/lib/node_modules_22/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /opt/app-root/src/node_modules/node-rdkafka
npm error gyp ERR! node -v v22.11.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /opt/app-root/src/.npm/_logs/2025-01-28T12_37_13_043Z-debug-0.log
Error: building at STEP "RUN /usr/libexec/s2i/assemble": while running runtime: exit status 1
  ERROR: Failed to to build /tmp/tmp.njYCfGu9Ek/Dockerfile.xXH3
Test for image 'ubi10/nodejs-22:1' FAILED (exit code: 1)
Resolved "ubi10/nodejs-22" as an alias (/etc/containers/registries.conf.d/004-tf-shortnames.conf)

Copy link
Member

@hhorak hhorak left a comment

Choose a reason for hiding this comment

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

I've went through the code changes and all look good to me.

@phracek phracek merged commit 00f5433 into master Jan 29, 2025
20 of 23 checks passed
@phracek phracek deleted the building_testing_rhel10 branch January 29, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants