34 Commits

Author SHA1 Message Date
Bobby R. Bruce
b2d13ee63a util: Remove action runner add-apt-repo git-core/ppa (#856)
We were having some difficulty on a server running this
`apt-apt-repository` command due to suspected firewall issues. On
further inspection is appear to be superfluous as git can be obtained
easily through `apt-get` without adding this repository.
2024-02-08 12:13:12 -08:00
Bobby R. Bruce
b90cc7f3bc misc: Merge branch stable into release-staging-v23-1
Change-Id: I3903331ec4c9d7ba83656bbf579ac3c1cac8518f
2023-12-27 12:39:52 -08:00
Bobby R. Bruce
b6ce2d0db8 misc: Add GitHub Runner API rate limiting (#497)
This stops the 'action-run.sh' from exhausting the GitHub API by adding
sleeps.
2023-10-24 14:51:31 -07:00
Bobby R. Bruce
b670ed9fba util: Add 'sudo' to rm WORK_DIR command (#496)
Unfortunately Actions uses docker contaienrs to create files on the
system with root permissions. The 'vagrant' user which we login to run
the Actions Runner, can't remove these files. However, 'vagrant' is part
of the sudo group and can therefore use sudo to remove these files.

I don't like this, but it works.
2023-10-24 14:51:19 -07:00
Bobby R. Bruce
3783afff5d util: Enable KVM on VMs and ensure working in Runners
This patch:

1. Adds setup scripting to "provision_root.sh" to setup and enable KVM,
   for the 'vagrant' user, for VMs which are capable of this.
2. Runs a check on each VM to see if KVM can be run sucessfully within a
   docker container. If so, the GitHub Actions runner is given a 'kvm'
   label. It is unknown at this time if GitHub Runners can utlized KVM
   but it is open to their processes.

Change-Id: Idfcbb7bfa3e5b7cc47d29aea50fb1ebcafdb7acc
2023-10-16 21:21:31 -07:00
Bobby R. Bruce
d18087af96 util: Add halt-helper.sh
This script helps use safely halt vagrant VMs.

Change-Id: I2f2f36b93f82e07756d069334db178604a9915b3
2023-10-16 21:14:09 -07:00
Bobby R. Bruce
4b9c4e1e17 misc: Add --all to Runner docker system prune
Without `--all` `docker prune --force --volumes` will remove everything
exception non-dangling images. For an image to be considered dangling it
must be untagged and/or not used by a container at that time. As most of
the images we download are tagged (e.g., `:latest`) then most of our
images are never removed without the inclusion of `--all` which will
remove any image not currently used by a container.

Images were starting to accumulate on runners. This will ensure they do
not and are cleaned after each job run.

Change-Id: I6d8441a11d22fdcf827e9c44422dbcf02cf600e0
2023-10-16 13:33:30 -07:00
Bobby R. Bruce
5240c07d3c util: Fix runners to extent to max disk size (#460)
THe `lvextend` command extends the logical volume. However, the
`resize2fs` command is needed to extend the filesystem to fill the
logical volume.

Prior to this patch the filesystem ran out of space despite there being
enough room in the volume. This was just wasted free space.
2023-10-16 09:20:13 -07:00
Bobby R. Bruce
d5e454138a util: Remove 'run' and 'build' tags from runners
Change-Id: Ib7b2eba5f08a1d8a311dc20cb55f540a5cd7dc7b
2023-10-09 09:56:32 -07:00
Bobby R. Bruce
df3bcaf143 util: Make all runs "build" and "run"
Change-Id: If9ecf467efa5c7118d34166953630e6c436c55a4
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
53219bf827 util: Add Troubleshooting for "Vagrant failed..."
Change-Id: I01e637f09084acb6c5fbd7800b3e578a43487849
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
6571a54a65 util: Use a Multi-Machine Vagrantfile
This patch removed the bespoke "vm_manager.sh" script in favor of a
Multi-Machine Vagrantfile.

With this the users needs to only change the variables in Vagrantfile
then use the standard `vagrant` commands to launch the VMs/Runners.

Change-Id: Ida5d2701319fd844c6a5b6fa7baf0c48b67db975
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
0e5c6d9f50 util: Resize VM root partition max size to ~128GB
Prior to this change we were limited to a root partition with only 60GB
of space which caused issues when running larger simulations (see:
https://github.com/gem5/gem5/issues/165).

There are two factors in this issue which this patch resolves:

1. The root partition in the VM was capped at 60GB despite the virtual
machines size being capped at 128GB. This resulted in libvirt giving the
VM free space it couldn't use. To fix this `lvextend` was added to the
"provision_root.sh" script to resize the root partition to fill the
available space.
2. The virtual machine size can be set via the `machine_virtual_size`
parameter. The minimum and default value is 128GB. This wasn't exposed
previously. Now, if we required, we can increase the size of the VM/Root
partition if we require (though I believe 128GB is more than sufficient
for now).

Fixes: https://github.com/gem5/gem5/issues/165
Change-Id: I82dd500d8807ee0164f92d91515729d5fbd598e3
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
f36449be98 util: Add missing copyright notices
Change-Id: I243046c17264eb5c522285096ecf9c7e5e968322
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
8c2d414223 util: Cleanup the provision_root.sh
Change-Id: I58215dddc34476695c7aedc77b55d338e0304198
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
c0cb16ba89 util: Create HOSTNAME variable
Change-Id: Ia68f1bef2bb9e4e5e18476b6100be80f8cf1c799
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
529423f47a util: Remove note about ssh use
This is confusing and setting the ssh username and password is normal.

Change-Id: Ic925e92ade47f455c86a461a267b8cad7aa6d7ba
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
a924fa3bdc util: Add action-run.sh to run Action Runners
The "action-run.sh" action replaces inline scripting in the Vagrantfile.

The major improvement is this script runs an infinite loop and
configures the runners to be ephemeral. This means they cease to exist
after a job is complete. The script then cleans the VM workspace and the
loop restarts by configuring and setting up another runner. This means
our VMs no longer accumulate files that eventually lead to the VM
running out of space.

Change-Id: Iba6dc9a480f5805042602f120fc84bdc47a96d55
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
3e1c0b0714 util: Move runners from gem5 repository to gem5 org
There are two places self-hosted runners can exist on GitHub:

1. At the level of the repository: In this case the runners can only be
used by that repository and runners can only be distinguished from one
another by labels.
2. At the level of the organization: In this case the runners can be
used by any repository in the organization, thus increasing their
versatility. In addition to labels, runners in the level of the
organization can be organized into groups.

While we do not use our self-hosted runners on other repositories, there
may be future use for this, so we might as well enable it now.

Change-Id: Id5e113194314336221dcdc8c2858b352afcbaf6e
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
d1f9f98747 util: Make all runners the same type
Having two types of GitHub Action Runners has not yielded much benefit
and caused confusion and inefficiencies. This change simplifies things
to having just one runner with 8-cores and 16GB of memory. It is
sufficient to build gem5 and run most simulations.

Change-Id: Ic49ae5e98b02086f153f4ae2a4eedd8a535786c8
2023-10-06 15:53:57 -07:00
Bobby R. Bruce
7091a8b7a0 util: Revert "Add docker prune cron to GitHub..."
This reverts commit 0249d47acc,
https://github.com/gem5/gem5/pull/271.

This solution doesn't work. GitHub runners pull the images they need at
the start of job (i.e., all the images they may need for each step).
They then create the containers later, at the step they are needed.
This solution therefore breaks in the case a cleanup happens during the
running of a job. I.e., a `docker system prune` happens after setup,
therefore deleting all the images, then the job tries to use one of the
images during a step.

This crontab solution may work if we can only do it when the runner is
in an idle state. Whether this is possible is unknown.

Change-Id: I7cb5b2d98d596e9380ae1525c7d66ad97af1b59b
2023-09-10 20:32:49 -07:00
Bobby R. Bruce
0249d47acc util: Add docker prune cron to GitHub runners
Change-Id: Ic90ebc650b6a89606eaf9e8feafddfe15c44e578
Issue-on: https://github.com/gem5/gem5/issues/254
2023-09-06 15:09:32 -07:00
Bobby R. Bruce
84c4451ceb util: Add "Improving stability" sec to github-vagrant-runner (#87)
Change-Id: I9812a21523b5b29bd7f570df4f1e90dbeabea085
2023-07-19 02:05:46 -07:00
Bobby R. Bruce
428bd1c5b8 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 <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2023-07-18 20:55:49 -07:00
Bobby R. Bruce
cb12dbbad2 util: Add 'shutdown' argument option to vm_manager.sh
This allows for the VMs to be shutdown rather than destroyed. The can be
rebooted with `./vm_manager.sh` after shutdown.

Change-Id: I58329ec835af664bfb970b029e09ad16c5472015
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71500
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2023-07-18 20:55:40 -07:00
Bobby R. Bruce
52ef3c3315 util: '-eq' -> '-ge' for if in vm_manager.sh
A small nit-pick change that ensures that cases where the number of
arguments being >1 does not result in the argument checking being
skipped (NOTE: arguments after the first are never processed and are
ignored).

Change-Id: If7e9c16c2c3581ea95ed888586736618d1ae5f5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71499
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2023-07-18 20:55:23 -07:00
Bobby R. Bruce
ba63c13b5b util: Update GitHub Runners Vagrant to overcommit memory
SE mode tests were failing in some cases where the VM did not have
enough memory to satisfy the constraints of the simulated system. This
change ensures the VM allows overcommitting of memory.

Change-Id: I1800288e16146bdae612a401c2ff282d8664892d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71498
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2023-07-18 20:55:11 -07:00
Melissa Jost
a31d3416fe util: Add util for GitHub runner configuration
This adds files that can be used to configure Vagrant machines
that will be used to test running gem5 alongside Github Actions.

Change-Id: I52b0f39b6e6044c22481f02163d5fc01eab76788
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71098
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2023-07-18 20:44:10 -07:00
Bobby R. Bruce
6062214d87 util: Add "Improving stability" sec to github-vagrant-runner (#87)
Change-Id: I9812a21523b5b29bd7f570df4f1e90dbeabea085
2023-07-17 10:42:28 -07:00
Bobby R. Bruce
84b457c6aa 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 <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2023-07-07 02:31:50 +00:00
Bobby R. Bruce
c391fdfbb4 util: Add 'shutdown' argument option to vm_manager.sh
This allows for the VMs to be shutdown rather than destroyed. The can be
rebooted with `./vm_manager.sh` after shutdown.

Change-Id: I58329ec835af664bfb970b029e09ad16c5472015
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71500
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2023-07-07 02:31:50 +00:00
Bobby R. Bruce
1fd392e7bf util: '-eq' -> '-ge' for if in vm_manager.sh
A small nit-pick change that ensures that cases where the number of
arguments being >1 does not result in the argument checking being
skipped (NOTE: arguments after the first are never processed and are
ignored).

Change-Id: If7e9c16c2c3581ea95ed888586736618d1ae5f5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71499
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2023-07-07 02:31:50 +00:00
Bobby R. Bruce
34d984d147 util: Update GitHub Runners Vagrant to overcommit memory
SE mode tests were failing in some cases where the VM did not have
enough memory to satisfy the constraints of the simulated system. This
change ensures the VM allows overcommitting of memory.

Change-Id: I1800288e16146bdae612a401c2ff282d8664892d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71498
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2023-07-07 02:31:50 +00:00
Melissa Jost
f467cf79fd util: Add util for GitHub runner configuration
This adds files that can be used to configure Vagrant machines
that will be used to test running gem5 alongside Github Actions.

Change-Id: I52b0f39b6e6044c22481f02163d5fc01eab76788
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71098
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2023-06-09 00:33:32 +00:00