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

add older debian tests [APMON-1505] #3172

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
20 changes: 20 additions & 0 deletions utils/_context/_scenarios/auto_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
OracleLinux79amd64,
Debian12amd64,
Debian12arm64,
Debian11amd64,
Debian11arm64,
Debian10amd64,
Debian10arm64,
AlmaLinux8amd64,
AlmaLinux8arm64,
AlmaLinux9amd64,
Expand Down Expand Up @@ -79,6 +83,10 @@ def __init__(
include_oraclelinux_7_9_amd64=False,
include_debian_12_amd64=False,
include_debian_12_arm64=False,
include_debian_11_amd64=False,
include_debian_11_arm64=False,
include_debian_10_amd64=False,
include_debian_10_arm64=False,
include_almalinux_8_amd64=False,
include_almalinux_8_arm64=False,
include_almalinux_9_amd64=False,
Expand Down Expand Up @@ -156,6 +164,14 @@ def __init__(
self.required_vms.append(Debian12amd64())
if include_debian_12_arm64:
self.required_vms.append(Debian12arm64())
if include_debian_11_amd64:
self.required_vms.append(Debian11amd64())
if include_debian_11_arm64:
self.required_vms.append(Debian11arm64())
if include_debian_10_amd64:
self.required_vms.append(Debian10amd64())
if include_debian_10_arm64:
self.required_vms.append(Debian10arm64())
if include_almalinux_8_amd64:
self.required_vms.append(AlmaLinux8amd64())
if include_almalinux_8_arm64:
Expand Down Expand Up @@ -347,6 +363,10 @@ def __init__(
include_oraclelinux_7_9_amd64=True,
include_debian_12_amd64=True,
include_debian_12_arm64=True,
include_debian_11_amd64=True,
include_debian_11_arm64=True,
include_debian_10_amd64=True,
include_debian_10_arm64=True,
include_almalinux_8_amd64=True,
include_almalinux_8_arm64=True,
include_almalinux_9_amd64=True,
Expand Down
64 changes: 64 additions & 0 deletions utils/_context/virtual_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,70 @@ def __init__(self, **kwargs) -> None:
)


class Debian11amd64(_VirtualMachine):
def __init__(self, **kwargs) -> None:
super().__init__(
"Debian_11_amd64",
aws_config=_AWSConfig(ami_id="ami-0607e701db389efe7", ami_instance_type="t2.medium", user="admin"),
vagrant_config=None,
krunvm_config=None,
os_type="linux",
os_distro="deb",
os_branch="debian",
os_cpu="amd64",
default_vm=False,
**kwargs,
)


class Debian11arm64(_VirtualMachine):
def __init__(self, **kwargs) -> None:
super().__init__(
"Debian_11_arm64",
aws_config=_AWSConfig(ami_id="ami-00988b9ead6afb0b1", ami_instance_type="t4g.small", user="admin"),
vagrant_config=None,
krunvm_config=None,
os_type="linux",
os_distro="deb",
os_branch="debian",
os_cpu="arm64",
default_vm=False,
**kwargs,
)


class Debian10amd64(_VirtualMachine):
def __init__(self, **kwargs) -> None:
super().__init__(
"Debian_10_amd64",
aws_config=_AWSConfig(ami_id="ami-03898633fee508324", ami_instance_type="t2.medium", user="admin"),
vagrant_config=None,
krunvm_config=None,
os_type="linux",
os_distro="deb",
os_branch="debian",
os_cpu="amd64",
default_vm=False,
**kwargs,
)


class Debian10arm64(_VirtualMachine):
def __init__(self, **kwargs) -> None:
super().__init__(
"Debian_10_arm64",
aws_config=_AWSConfig(ami_id="ami-01055bb8b97dfc981", ami_instance_type="t4g.small", user="admin"),
vagrant_config=None,
krunvm_config=None,
os_type="linux",
os_distro="deb",
os_branch="debian",
os_cpu="arm64",
default_vm=False,
**kwargs,
)


# 8.10.20240820
# https://wiki.almalinux.org/cloud/AWS.html#community-amis
class AlmaLinux8amd64(_VirtualMachine):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#Add initial configuration that it must do after start the machine
#Add initial configuration that it must do after start the machine
- os_type: linux
os_distro: deb
remote-command: |

#Disable auto updates. It could raise problems if the update proccess is launched just when we are trying to install de software
#Disable auto updates. It could raise problems if the update proccess is launched just when we are trying to install de software
sudo sed -i 's/1/0/g' /etc/apt/apt.conf.d/20auto-upgrades
sudo sed -i 's/1/0/g' /etc/apt/apt.conf.d/10periodic || true

echo "On VM boot the Apt service status::::"
sudo ps -fea|grep apt
echo "On VM boot the System service apt-daily.service status"
Expand All @@ -29,13 +29,19 @@
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/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
fi
echo 'apt_preserve_sources_list: true' | sudo tee -a /etc/cloud/cloud.cfg
sudo apt-get update
fi
fi
fi
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo "Configuring debian 10 repositories"
sudo sed -i -r 's/cdn-aws.deb.debian.org/archive.debian.org/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)
Expand Down Expand Up @@ -65,11 +71,11 @@
- os_type: linux
os_distro: rpm
os_branch: centos_7_amd64 # CentOS override as the mirrors are not available anymore
remote-command: |
remote-command: |
sudo sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sudo sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sudo sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo

#Allow DD env variables from ssh
echo 'AcceptEnv DD_*' | sudo tee -a /etc/ssh/sshd_config
sudo id -u datadog &>/dev/null || sudo useradd -m datadog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
sudo apt-get update
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo apt-get -y install docker-buildx-plugin || true #Ubuntu 21.04 doesn't have this package
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/bin/docker-compose && sudo chmod +x /usr/bin/docker-compose && sudo docker-compose --version
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m) -o /usr/bin/docker-compose && sudo chmod +x /usr/bin/docker-compose && sudo docker-compose --version
echo "DOCKER INSTALLED!"
#To run Docker without root privileges
#sudo groupadd docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ lang_variant:
os_distro: deb
os_branch: debian
remote-command: |
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo 'deb http://archive.debian.org/debian buster main non-free contrib' | sudo tee -a /etc/apt/sources.list
else
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
fi
sudo apt update
sudo apt -y install openjdk-11-jdk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ lang_variant:
os_distro: deb
os_branch: debian
remote-command: |
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo 'deb http://archive.debian.org/debian buster main non-free contrib' | sudo tee -a /etc/apt/sources.list
else
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
fi
sudo apt update
sudo apt -y install openjdk-11-jdk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ lang_variant:
os_distro: deb
os_branch: debian
remote-command: |
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo 'deb http://archive.debian.org/debian buster main non-free contrib' | sudo tee -a /etc/apt/sources.list
else
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
fi
sudo apt update
sudo apt -y install openjdk-11-jdk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ lang_variant:
os_distro: deb
os_branch: debian
remote-command: |
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo 'deb http://archive.debian.org/debian buster main non-free contrib' | sudo tee -a /etc/apt/sources.list
else
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
fi
sudo apt update
sudo apt -y install openjdk-11-jdk

Expand Down Expand Up @@ -35,7 +39,7 @@ weblog:
- name: copy-docker-file
local_path: utils/build/virtual_machine/weblogs/java/test-app-java-container/Dockerfile.jdk15
remote_path: Dockerfile.template

- name: copy-java-app
local_path: lib-injection/build/docker/java/jetty-app

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ lang_variant:
os_distro: deb
os_branch: debian
remote-command: |
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo 'deb http://archive.debian.org/debian buster main non-free contrib' | sudo tee -a /etc/apt/sources.list
else
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
fi
sudo apt update
sudo apt -y install openjdk-11-jdk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ lang_variant:
os_distro: deb
os_branch: debian
remote-command: |
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
if [ "$(. /etc/os-release && echo "$VERSION_CODENAME")" = "buster" ]; then
echo 'deb http://archive.debian.org/debian buster main non-free contrib' | sudo tee -a /etc/apt/sources.list
else
echo 'deb http://deb.debian.org/debian unstable main non-free contrib' | sudo tee -a /etc/apt/sources.list
fi
sudo apt update
sudo apt -y install openjdk-11-jdk

- os_type: linux
os_distro: deb
remote-command: sudo apt-get -y update && sudo apt-get -y install openjdk-11-jdk-headless

- os_type: linux
os_distro: rpm
os_branch: amazon_linux2
Expand Down Expand Up @@ -45,4 +49,4 @@ weblog:
- name: copy-java-app
local_path: lib-injection/build/docker/java/jetty-app

remote-command: sh test-app-java_run.sh
remote-command: sh test-app-java_run.sh
Loading