From 6c4ddd1707a152d42f33cc9356f31f0ac20aae78 Mon Sep 17 00:00:00 2001 From: Roberto Montero <108007532+robertomonteromiguel@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:15:18 +0100 Subject: [PATCH] OnBoarding fix nodejs installation (#3502) --- utils/_context/_scenarios/auto_injection.py | 2 +- .../auto-inject_init_vm_config.yml | 21 +++++++++++++------ .../nodejs/provision_test-app-nodejs.yml | 4 +--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/utils/_context/_scenarios/auto_injection.py b/utils/_context/_scenarios/auto_injection.py index 87f79295b3..e3c74ac0f5 100644 --- a/utils/_context/_scenarios/auto_injection.py +++ b/utils/_context/_scenarios/auto_injection.py @@ -388,7 +388,7 @@ def __init__( include_ubuntu_22_arm64=True, include_ubuntu_23_04_amd64=True, include_ubuntu_23_04_arm64=True, - include_ubuntu_23_10_amd64=True, + include_ubuntu_23_10_amd64=False, include_ubuntu_23_10_arm64=True, include_ubuntu_24_amd64=True, include_ubuntu_24_arm64=True, diff --git a/utils/build/virtual_machine/provisions/auto-inject/auto-inject_init_vm_config.yml b/utils/build/virtual_machine/provisions/auto-inject/auto-inject_init_vm_config.yml index dee4860c03..facdd6c239 100644 --- a/utils/build/virtual_machine/provisions/auto-inject/auto-inject_init_vm_config.yml +++ b/utils/build/virtual_machine/provisions/auto-inject/auto-inject_init_vm_config.yml @@ -25,17 +25,26 @@ echo "After stop updates. System service apt-daily.service status" sudo systemctl list-units --all apt-daily.service || true + #There are some old machines that need to change the repositories because there are not available anymore lsb_release=/etc/lsb-release + must_update_repositories="false" if [ -e "$lsb_release" ]; then if grep -q 'Ubuntu 21.04' "$lsb_release"; then - echo "Configuring ubuntu 21.04 repositories" - sudo sed -i -r 's/ports.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list - sudo sed -i -r 's/ubuntu-ports/ubuntu/g' /etc/apt/sources.list - sudo sed -i -r 's/us-east-1.ec2.//g' /etc/apt/sources.list - echo 'apt_preserve_sources_list: true' | sudo tee -a /etc/cloud/cloud.cfg - sudo apt-get update + must_update_repositories="true" + elif grep -q 'Ubuntu 23.10' "$lsb_release"; then + #Why this works for arm machine but not for amd64? + must_update_repositories="true" fi fi + if [ "$must_update_repositories" == "true" ]; then + echo "Configuring archive ubuntu repositories" + sudo sed -i -r 's/ports.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list + sudo sed -i -r 's/ubuntu-ports/ubuntu/g' /etc/apt/sources.list + sudo sed -i -r 's/us-east-1.ec2.//g' /etc/apt/sources.list + echo 'apt_preserve_sources_list: true' | sudo tee -a /etc/cloud/cloud.cfg + sudo apt-get update + fi + sudo apt-get -y update #Install some basic tools (microvm doesn't have them by default) diff --git a/utils/build/virtual_machine/weblogs/nodejs/provision_test-app-nodejs.yml b/utils/build/virtual_machine/weblogs/nodejs/provision_test-app-nodejs.yml index b619a2e3a4..3e58935fb7 100644 --- a/utils/build/virtual_machine/weblogs/nodejs/provision_test-app-nodejs.yml +++ b/utils/build/virtual_machine/weblogs/nodejs/provision_test-app-nodejs.yml @@ -5,7 +5,7 @@ lang_variant: install: - os_type: linux os_distro: deb - remote-command: sudo apt-get install -y nodejs + remote-command: sudo apt-get update && sudo apt-get install -y nodejs - os_type: linux os_distro: rpm @@ -47,9 +47,7 @@ weblog: #centos 7: node 16 #rhel_7_amd64: I can't isntall in a standard way #amazon_linux2: Using the amazon-linux-extras - Error: Package: 1:nodejs-16.20.2-1.el7.x86_64 (epel) - #ubuntu 23.04 arm. nodejs package not found excluded_os_branches: [ubuntu22_amd64, ubuntu22_arm64, ubuntu21, ubuntu20_arm64, ubuntu20_amd64, centos_7_amd64, rhel_7_amd64, amazon_linux2] - excluded_os_names: [Ubuntu_23_04_arm64] install: - os_type: linux