From 84b457c6aa64f0abaa9e1fd524ed6ee9f13cc16d Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 13 Jun 2023 20:19:55 -0700 Subject: [PATCH] util: Add 'swapspace' daemon to runner VM. As these VMs, particularly the runners, don't have much memory, the 'swapspace' daemon allows for dynamic swap spaces to be created for when more memory is required. Change-Id: Ie8e734a8fde54e122df33dda187c6c4aafdcd006 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71680 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Bobby Bruce --- util/github-runners-vagrant/Vagrantfile-builder | 3 +++ util/github-runners-vagrant/Vagrantfile-runner | 3 +++ 2 files changed, 6 insertions(+) diff --git a/util/github-runners-vagrant/Vagrantfile-builder b/util/github-runners-vagrant/Vagrantfile-builder index cd36e7894c..c0c2380b95 100644 --- a/util/github-runners-vagrant/Vagrantfile-builder +++ b/util/github-runners-vagrant/Vagrantfile-builder @@ -20,6 +20,9 @@ Vagrant.configure("2") do |config| # sets up vm config.vm.provision :shell, path: "provision_root.sh" config.vm.provision :shell, privileged: false, path: "provision_nonroot.sh" + # To ensure we don't run out of memory, we enable dynamic Swap Space. This is + # done via the "swapspace" daemon: https://pqxx.org/development/swapspace/ + config.vm.provision :shell, inline: "sudo apt install swapspace -y" # The provision_root.sh adds the vagrant user to the docker group, so we need to reload the VM. config.vm.provision :reload config.vm.provision :shell, run: 'always', inline: <<-SHELL diff --git a/util/github-runners-vagrant/Vagrantfile-runner b/util/github-runners-vagrant/Vagrantfile-runner index 854e5f58b1..eb4054ed16 100644 --- a/util/github-runners-vagrant/Vagrantfile-runner +++ b/util/github-runners-vagrant/Vagrantfile-runner @@ -20,6 +20,9 @@ Vagrant.configure("2") do |config| # sets up vm config.vm.provision :shell, path: "provision_root.sh" config.vm.provision :shell, privileged: false, path: "provision_nonroot.sh" + # To ensure we don't run out of memory, we enable dynamic Swap Space. This is + # done via the "swapspace" daemon: https://pqxx.org/development/swapspace/ + config.vm.provision :shell, inline: "sudo apt install swapspace -y" # The provision_root.sh adds the vagrant user to the docker group, so we need to reload the VM. config.vm.provision :reload config.vm.provision :shell, run: 'always', inline: <<-SHELL