devimur2021 / Sentiment-Based-Product-Recommendation-System

Sentiment based product recommendation system
0 stars 0 forks source link

Node20 actions don't work on CentOS 7 #2

Open snps-davidla opened 5 months ago

snps-davidla commented 5 months ago

https://github.com/actions/runner/issues/2906

$ ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node
./actions-runner-linux-x64-2.313.0/externals/node20/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node)
./actions-runner-linux-x64-2.313.0/externals/node20/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node)
./actions-runner-linux-x64-2.313.0/externals/node20/bin/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node)
./actions-runner-linux-x64-2.313.0/externals/node20/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node)
./actions-runner-linux-x64-2.313.0/externals/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node)
./actions-runner-linux-x64-2.313.0/externals/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by ./actions-runner-linux-x64-2.313.0/externals/node20/bin/node)
$
igorcosta commented 2 months ago

@snps-davidla if providing your own node20 is acceptable, I would opt for this instance. Mainly because if is not supported by our official images, is very unlikely that will add support in the short and long term.

I've got a straightforward solution for you that should sort out your current issues and set you up for the future.

Here is a step by step:

  1. Create a custom Node.js build for CentOS 7:

First up, we need to whip up a custom Node.js build that'll play nice with CentOS 7. Here's a script that'll do the job:

#!/bin/bash
set -e

# Update system and install dependencies
yum update -y
yum groupinstall -y "Development Tools"
yum install -y wget openssl-devel

# Download and extract Node.js source
NODE_VERSION="20.11.1"  # Adjust as needed
wget https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz
tar xzf node-v${NODE_VERSION}.tar.gz
cd node-v${NODE_VERSION}

# Configure and build Node.js
./configure --prefix=/opt/nodejs-${NODE_VERSION}
make -j$(nproc)
make install

# Create a tarball of the built Node.js
cd /opt
tar czf nodejs-${NODE_VERSION}-centos7.tar.gz nodejs-${NODE_VERSION}

echo "Custom Node.js build complete: /opt/nodejs-${NODE_VERSION}-centos7.tar.gz"
  1. Integrate the custom build into your GitHub Actions workflow:

Now, let's get this custom build working with your GitHub Actions. Here's how we'll modify the workflow:

name: CI with Custom Node.js

on: [push, pull_request]

jobs:
  build:
    runs-on: self-hosted
    steps:
    - uses: actions/checkout@v4

    - name: Set up custom Node.js
      run: |
        mkdir -p $HOME/.local
        tar xzf /path/to/nodejs-20.11.1-centos7.tar.gz -C $HOME/.local
        echo "$HOME/.local/nodejs-20.11.1/bin" >> $GITHUB_PATH

    - name: Use Node.js
      run: |
        node --version
        npm --version

    # Add your other build steps here
  1. Implementation steps:

a) Build the custom Node.js:

b) Update your GitHub Actions workflow:

c) Test and deploy:

  1. Long-term considerations:

This solution should sort out your immediate compatibility dramas while also setting you up with a process you can adapt for future Node.js versions. It lets you keep using CentOS 7 where you need to, but gives you control over the Node.js environment in your GitHub Actions workflows.

Let me know if you need more clarification.

igorcosta commented 1 month ago

Any progress on this?