From 01b2dbb4f6ed66e1202dd4ffec77e25893ce23d3 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 20 Sep 2024 15:54:59 +0100 Subject: [PATCH 1/2] lisa: Remove support for Vagrant BREAKING CHANGE Vagrant is not supported anymore by Ubuntu, making it unsuitable for us. --- .gitignore | 1 - Vagrantfile | 71 ------------------------ doc/lisa_shell/man/man.rst | 5 -- doc/man1/lisa.1 | 8 --- doc/sections/changes/release_process.rst | 5 +- doc/setup.rst | 35 ------------ install_base.sh | 20 +------ shell/lisa_shell | 22 +------- vagrant_requirements.txt | 6 -- 9 files changed, 7 insertions(+), 166 deletions(-) delete mode 100644 Vagrantfile delete mode 100644 vagrant_requirements.txt diff --git a/.gitignore b/.gitignore index 7185698e2..f11e60687 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ __pycache__ /tools/android-sdk-linux *.pid server.url -/vagrant /tools/wa_user_directory/dependencies /src/buildroot custom_requirements.txt diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 7184037a8..000000000 --- a/Vagrantfile +++ /dev/null @@ -1,71 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - - -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/kinetic64" - - # Allow using tools like kernelshark - config.ssh.forward_x11 = true - - # Compiling pandas requires 1Gb of memory - config.vm.provider "virtualbox" do |v| - v.memory = 2048 - end - - # Forward ipython notebook's port to the host - config.vm.network "forwarded_port", guest: 8888, host: 8888 - - config.vm.provision "shell", inline: <<-SHELL - set -e - - if [ ! -e /home/vagrant/lisa ]; then - ln -s /vagrant /home/vagrant/lisa - fi - - cd /home/vagrant/lisa - # Install required packages - ./install_base.sh --install-all - - chown -R vagrant.vagrant /home/vagrant/lisa - - # Let' use a venv local to vagrant so that we don't pollute the host one. - # This allows to use LISA both from the host and the VM. - export LISA_VENV_PATH=/home/vagrant/venv - - # Jupyterlab config - mkdir -p /home/vagrant/.jupyter/ - # Listen on all addresses so that we can connect from outside the VM - echo 'c.NotebookApp.ip = "0.0.0.0"' >> /home/vagrant/.jupyter/jupyter_notebook_config.py - - # .bashrc setup - echo "cd /home/vagrant/lisa" >> /home/vagrant/.bashrc - for LC in $(locale | cut -d= -f1); - do - echo unset $LC >> /home/vagrant/.bashrc - done - echo "export LISA_VENV_PATH=$LISA_VENV_PATH" >> /home/vagrant/.bashrc - echo 'source init_env' >> /home/vagrant/.bashrc - - # Trigger the creation of a venv and check that everything works well - if ! su vagrant bash -c 'tools/tests.sh'; then - echo "Self tests FAILED !" - else - echo "Virtual Machine Installation completed successfully! " - fi - - echo "You can now access and use the virtual machine by running: " - echo " " - echo " $ vagrant ssh " - echo " " - echo "NOTE: if you exit, the virtual machine is still running. To shut it " - echo " down, please run: " - echo " " - echo " $ vagrant suspend " - echo " " - echo " To destroy it, use: " - echo " " - echo " $ vagrant destroy " - echo " " - SHELL -end diff --git a/doc/lisa_shell/man/man.rst b/doc/lisa_shell/man/man.rst index ed0845f11..d245c54dd 100644 --- a/doc/lisa_shell/man/man.rst +++ b/doc/lisa_shell/man/man.rst @@ -21,11 +21,6 @@ In order to use the shell, source the script: source init_env -.. note:: - - This is done automatically by vagrant, so you don't have to issue this - command after doing a ``vagrant ssh`` - .. tip:: Run ``man lisa`` to see an overview of the provided LISA commands. diff --git a/doc/man1/lisa.1 b/doc/man1/lisa.1 index f5fd59c22..de568cf03 100644 --- a/doc/man1/lisa.1 +++ b/doc/man1/lisa.1 @@ -51,14 +51,6 @@ source init_env .UNINDENT .UNINDENT .sp -\fBNOTE:\fP -.INDENT 0.0 -.INDENT 3.5 -This is done automatically by vagrant, so you don\(aqt have to issue this -command after doing a \fBvagrant ssh\fP -.UNINDENT -.UNINDENT -.sp \fBTIP:\fP .INDENT 0.0 .INDENT 3.5 diff --git a/doc/sections/changes/release_process.rst b/doc/sections/changes/release_process.rst index 9a4a3740f..fb4a251b2 100644 --- a/doc/sections/changes/release_process.rst +++ b/doc/sections/changes/release_process.rst @@ -21,9 +21,8 @@ Making a new release involves the following steps: 5. Make the Python wheel. See ``tools/make-release.sh`` for some indications on that part. -6. Install that wheel in a _fresh_ :ref:`Vagrant VM`. Ensure - that the VM is reinstalled from scratch and that the vagrant box in use is - up to date. +6. Install that wheel in a _fresh_ environment. Ensure that the VM is + reinstalled from scratch. 7. Run ``tools/tests.sh`` in the VM and ensure no deprecated item scheduled for removal in the new version is still present in the sources (should diff --git a/doc/setup.rst b/doc/setup.rst index 8e762deab..25765c459 100644 --- a/doc/setup.rst +++ b/doc/setup.rst @@ -127,41 +127,6 @@ practices, which includes a ``setup.py`` script, and a editable mode (including those that are not developped in that repository, but still included for convenience). -Virtual machine installation ----------------------------- -.. _setup-vagrant: - -LISA provides a Vagrant recipe which automates the generation of a -VirtualBox based virtual machine pre-configured to run LISA. To generate and -use such a virtual machine you need: - -- `VirtualBox `__ -- `Vagrant `__ - -Once these two components are available on your machine, issue these commands: - -.. code:: shell - - git clone https://gitlab.arm.com/tooling/lisa - cd lisa - vagrant up - -This last command builds and executes the VM according to the description provided -by the Vagrant file available in the root folder of the LISA source tree. - -Once the VM installation is complete, you can access that VM with: - -.. code:: shell - - vagrant ssh - -.. important:: In order to work around a - `Vagrant bug `_, all the - dependencies of LISA are installed in non-editable mode inside the VM. This - means that using `git pull` must be followed by a `lisa-install` if any of the - dependencies in `external/` are updated. - - Target installation +++++++++++++++++++ diff --git a/install_base.sh b/install_base.sh index a743b9a3d..28fd7b47e 100755 --- a/install_base.sh +++ b/install_base.sh @@ -19,7 +19,7 @@ # Script to install the depenencies for LISA on an Ubuntu-like system. # This is intended to be used for setting up containers and virtual machines to -# run LISA (e.g. for CI infrastructure or for Vagrant installation). +# run LISA (e.g. for CI infrastructure or for docker installation). # This can also work for a fresh LISA install on a workstation. # Read standard /etc/os-release file and extract the needed field lsb_release @@ -186,7 +186,7 @@ usage() { echo "Usage: $0 [--help] [--cleanup-android-sdk] [--install-android-tools] [--install-android-platform-tools] [--install-doc-extras] [--install-tests-extra] [--install-bisector-dbus] [--install-toolchains] - [--install-vagrant] [--install-all]" + [--install-all]" cat << EOF Install distribution packages and other bits that don't fit in the Python @@ -253,22 +253,6 @@ for arg in "${args[@]}"; do handled=1 ;;& - "--install-vagrant" | "--install-all") - # Only install the package if we are not already inside the VM to save - # some install time - vm=$(systemd-detect-virt 2>/dev/null) || true - if [[ $vm == 'oracle' ]] ; then - echo "VirtualBox detected, not installing virtualbox apt packages" >&2 - elif [[ $HOST_ARCH == 'aarch64' ]]; then - echo "VirtualBox not supported on $HOST_ARCH" >&2 - else - apt_packages+=(vagrant virtualbox) - pacman_packages+=(vagrant virtualbox virtualbox-host-dkms) - fi - - handled=1 - ;;& - "--install-kernel-build-dependencies" | "--install-all") apt_packages+=(build-essential gcc bc bison flex libssl-dev libncurses5-dev libelf-dev) handled=1 diff --git a/shell/lisa_shell b/shell/lisa_shell index f57065d41..56bc7c724 100755 --- a/shell/lisa_shell +++ b/shell/lisa_shell @@ -240,14 +240,7 @@ function lisa-install { # installation source of any package local requirements=(custom_requirements.txt) - if [[ $(whoami) == "vagrant" ]]; then - # Special set of requirements to workaround vagrant issue: - # https://github.com/hashicorp/vagrant/issues/12057 - requirements+=( - vagrant_requirements.txt - devmode_extra_requirements.txt - ) - elif [[ "$LISA_DEVMODE" == 1 ]]; then + if [[ "$LISA_DEVMODE" == 1 ]]; then # This set of requirements will install all the shipped dependencies # in editable mode requirements+=( @@ -395,7 +388,7 @@ function _lisa-jupyter-start { return 1 fi - # Check required port is available (e.g. Vagrant could using the same port) + # Check required port is available if netstat -nlt | grep $PORT &>/dev/null; then echo echo "ERROR: required port [$PORT] already in use" @@ -431,16 +424,7 @@ function _lisa-jupyter-stop { function lisa-jupyter { CMD=${1:-start} - - if [[ -z "$2" && $USER == vagrant && -e /vagrant/shell/lisa_shell ]]; then - # NETIF not set and we are in a vagrant environment. Default to - # the ethernet interface as loopback won't let you connect from your - # host machine. - NETIF=$(ip route | awk '/default/ { print $5 }') - else - NETIF=${2:-lo} - fi - + NETIF=${2:-lo} PORT=${3:-8888} echo case "$CMD" in diff --git a/vagrant_requirements.txt b/vagrant_requirements.txt deleted file mode 100644 index f92ef0d8b..000000000 --- a/vagrant_requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ --e ./tools/exekall -./external/devlib/ -./external/workload-automation/ --e ./[all] --e ./tools/bisector --e ./tools/lisa-combine-gitlab-mr -- GitLab From 149b8792cf926034a713383880b506a51d275f78 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Fri, 20 Sep 2024 17:48:40 +0100 Subject: [PATCH 2/2] doc/conf.py: Disable version switcher for local builds. FIX Version switcher is not functional on local builds as JS code cannot load the JSON file, so do not add the switcher in the first place. --- doc/conf.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index e811b5116..1a9f1278a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -30,6 +30,7 @@ from operator import attrgetter import pickle import shutil import shlex +from urllib.parse import urlparse from sphinx.domains.python import PythonDomain @@ -195,17 +196,20 @@ def prepare(home, enable_plots, outdir): def update_theme_options(existing): existing = existing or {} - return { - **existing, - 'switcher': { - # TODO: If base_url is a file:/// URL, the browser will forbid - # the JS code access to the local file, so the switcher will be - # empty. Instead, this can be used: - # python -m http.server -d doc/_build/html/ - 'json_url': f'{base_url}/{versions_filename}', - 'version_match': doc_version, + # TODO: If base_url is a file:/// URL, the browser will forbid + # the JS code access to the local file, so the switcher will be + # empty. Instead, this can be used: + # python -m http.server -d doc/_build/html/ + if urlparse(base_url).scheme == 'file': + return existing + else: + return { + **existing, + 'switcher': { + 'json_url': f'{base_url}/{versions_filename}', + 'version_match': doc_version, + } } - } configs['html_theme_options'] = update_theme_options configs['html_title'] = lambda _: f'LISA {doc_version} documentation' -- GitLab