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 Vagrant support for Ubuntu Noble (24.04) #26985

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 26 additions & 6 deletions Tools/environment_install/install-prereqs-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ elif [ ${RELEASE_CODENAME} == 'mantic' ]; then
SITLCFML_VERSION="2.5"
PYTHON_V="python3"
PIP=pip3
elif [ ${RELEASE_CODENAME} == 'noble' ]; then
SITLFML_VERSION="2.6"
SITLCFML_VERSION="2.6"
PYTHON_V="python3"
PIP=pip3
elif [ ${RELEASE_CODENAME} == 'groovy' ] ||
[ ${RELEASE_CODENAME} == 'bullseye' ]; then
SITLFML_VERSION="2.5"
Expand Down Expand Up @@ -169,7 +174,8 @@ ARM_LINUX_PKGS="g++-arm-linux-gnueabihf $INSTALL_PKG_CONFIG"

if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
[ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
# on Lunar (and presumably later releases), we install in venv, below
PYTHON_PKGS+=" numpy pyparsing psutil"
SITL_PKGS="python3-dev"
Expand All @@ -181,7 +187,8 @@ fi
if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
[ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
PYTHON_PKGS+=" matplotlib scipy opencv-python pyyaml"
SITL_PKGS+=" xterm libcsfml-dev libcsfml-audio${SITLCFML_VERSION} libcsfml-dev libcsfml-graphics${SITLCFML_VERSION} libcsfml-network${SITLCFML_VERSION} libcsfml-system${SITLCFML_VERSION} libcsfml-window${SITLCFML_VERSION} libsfml-audio${SITLFML_VERSION} libsfml-dev libsfml-graphics${SITLFML_VERSION} libsfml-network${SITLFML_VERSION} libsfml-system${SITLFML_VERSION} libsfml-window${SITLFML_VERSION}"
else
Expand Down Expand Up @@ -274,7 +281,8 @@ elif [ ${RELEASE_CODENAME} == 'lunar' ]; then
SITL_PKGS+=" libpython3-stdlib" # for argparse
elif [ ${RELEASE_CODENAME} == 'buster' ]; then
SITL_PKGS+=" libpython3-stdlib" # for argparse
elif [ ${RELEASE_CODENAME} != 'mantic' ]; then
elif [ ${RELEASE_CODENAME} != 'mantic' ] &&
[ ${RELEASE_CODENAME} != 'noble' ]; then
SITL_PKGS+=" python-argparse"
fi

Expand All @@ -293,6 +301,9 @@ if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
elif [ ${RELEASE_CODENAME} == 'mantic' ]; then
SITL_PKGS+=" libgtk-3-dev libwxgtk3.2-dev "
# see below
elif [ ${RELEASE_CODENAME} == 'noble' ]; then
SITL_PKGS+=" libgtk-3-dev libwxgtk3.2-dev "
# see below
elif apt-cache search python-wxgtk3.0 | grep wx; then
SITL_PKGS+=" python-wxgtk3.0"
elif apt-cache search python3-wxgtk4.0 | grep wx; then
Expand All @@ -312,7 +323,8 @@ if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
PYTHON_PKGS+=" wxpython opencv-python"
SITL_PKGS+=" python3-wxgtk4.0"
SITL_PKGS+=" fonts-freefont-ttf libfreetype6-dev libpng16-16 libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev" # for pygame
elif [ ${RELEASE_CODENAME} == 'mantic' ]; then
elif [ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
PYTHON_PKGS+=" wxpython opencv-python"
SITL_PKGS+=" python3-wxgtk4.0"
SITL_PKGS+=" fonts-freefont-ttf libfreetype6-dev libpng16-16 libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev" # for pygame
Expand Down Expand Up @@ -360,10 +372,17 @@ fi
PIP_USER_ARGUMENT="--user"

# create a Python venv on more recent releases:
PYTHON_VENV_PACKAGE=""
if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
$APT_GET install python3.11-venv
PYTHON_VENV_PACKAGE=python3.11-venv
elif [ ${RELEASE_CODENAME} == 'noble' ]; then
PYTHON_VENV_PACKAGE=python3.12-venv
fi

if [ -n "$PYTHON_VENV_PACKAGE" ]; then
$APT_GET install $PYTHON_VENV_PACKAGE
python3 -m venv $HOME/venv-ardupilot

# activate it:
Expand All @@ -389,7 +408,8 @@ fi

if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
[ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
# must do this ahead of wxPython pip3 run :-/
$PIP install $PIP_USER_ARGUMENT -U attrdict3
fi
Expand Down
10 changes: 8 additions & 2 deletions Tools/vagrant/initvagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ echo USING VAGRANT_USER:$VAGRANT_USER

cd /home/$VAGRANT_USER

IS_BENTO=0
if [ -e /etc/update-motd.d/99-bento ]; then
IS_BENTO=1
fi

# artful rootfs is 2GB without resize:
sudo resize2fs /dev/sda1
# artful rootfs is 2GB without resize. Do not resize if using Bento:
if [ ! $IS_BENTO ]; then
sudo resize2fs /dev/sda1
fi

echo "calling pre-reqs script..."
sudo -H -u $VAGRANT_USER /vagrant/Tools/environment_install/install-prereqs-ubuntu.sh -y
Expand Down
21 changes: 21 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,25 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end
mantic.vm.boot_timeout = 1200
end

# 24.04 end of standard support Jun 2029
# note the use of "bento" here; Ubuntu stopped providing Vagrant
# images due to Hashicorp adopting the "Business Source License".
config.vm.define "noble", autostart: false do |noble|
noble.vm.box = "bento/ubuntu-24.04"
noble.vm.provision :shell, path: "Tools/vagrant/initvagrant.sh"
noble.vm.provider "virtualbox" do |vb|
vb.name = "ArduPilot (noble)"
end
noble.vm.boot_timeout = 1200
end
config.vm.define "noble-desktop", autostart: false do |noble|
noble.vm.box = "bento/ubuntu-24.04"
noble.vm.provision :shell, path: "Tools/vagrant/initvagrant-desktop.sh"
noble.vm.provider "virtualbox" do |vb|
vb.name = "ArduPilot (noble-desktop)"
vb.gui = true
end
noble.vm.boot_timeout = 1200
end
end