Skip to content

Commit 8d1fd2d

Browse files
committed
📚 Docs: update build-vagrant.md for Ubuntu 24.04 and current workflow
Update the `build-vagrant.md` documentation to reflect the current build system and fix outdated or incorrect information. Split VM creation and Ansible provisioning into two explicit steps, clarify that `vagrant-vbguest` is optional troubleshooting tool, remove redundant commands now handled automatically by `tox`, and add a simply not on the time required.
1 parent 8198c4d commit 8d1fd2d

File tree

3 files changed

+67
-73
lines changed

3 files changed

+67
-73
lines changed

docs/developers/build-vagrant.md

Lines changed: 61 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,26 @@
22

33
In the following, we explain how to build your own custom Quantum Mobile VirtualBox image from scratch.
44

5-
Calculate at around two hours for building the full VM:
5+
Note that building the full VM can take around 15 minutes.
66

7-
````{dropdown} Approximate Timings
8-
```
9-
marvel-nccr.bigdft : Compile bigdft executables ----------------------- 906.73s
10-
marvel-nccr.quantum_espresso : Make QE executables -------------------- 867.71s
11-
marvel-nccr.abinit : Make abinit executable (2 cpu) ------------------- 807.30s
12-
marvel-nccr.wannier90 : run Wannier90 default tests ------------------- 720.07s
13-
marvel-nccr.libxc : Compile libxc executable (2 cpu) ------------------ 678.97s
14-
marvel-nccr.ubuntu_desktop : Install ubuntu-desktop (apt) ------------- 532.78s
15-
marvel-nccr.yambo : Make Yambo executables ---------------------------- 406.67s
16-
marvel-nccr.fleur : run fleur tests ----------------------------------- 395.95s
17-
marvel-nccr.fleur : Make fleur executables ---------------------------- 345.77s
18-
marvel-nccr.abinit : run the tests (2 cpu) ---------------------------- 315.32s
19-
marvel-nccr.libxc : Run make check for libxc -------------------------- 313.18s
20-
marvel-nccr.siesta : Make siesta executable --------------------------- 308.16s
21-
marvel-nccr.aiida : Install aiida-core + plugins into venv ------------ 262.80s
22-
marvel-nccr.slurm : Install apt packages ------------------------------ 211.29s
23-
marvel-nccr.simulationbase : Install plotting tools, etc. ------------- 187.73s
24-
marvel-nccr.siesta : Make xmlf90 -------------------------------------- 179.07s
25-
marvel-nccr.bigdft : run test suite ----------------------------------- 143.86s
26-
marvel-nccr.aiidalab : install server-side (aiida) dependencies ------- 120.63s
27-
marvel-nccr.cp2k : download cp2k binary ------------------------------- 108.26s
28-
marvel-nccr.ansible_prerequisites : Install aptitude ------------------ 104.13s
29-
```
30-
:::{seealso}
31-
See the [continuous deployment (CD) workflow](https://github.com/marvel-nccr/quantum-mobile/actions?query=workflow%3ACD) for up-to-date timings
32-
:::
33-
````
347

358
## Prerequisites & Installation
369

37-
- Operating system: Building Quantum Mobile has been tested on MacOS, Ubuntu and Windows.
38-
- [Vagrant](https://www.vagrantup.com/downloads.html) >= 2.0.1
39-
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads) >= 6.1.6
40-
- [Python](https://www.python.org/) >= 3.6
10+
Building Quantum Mobile requires and has been tested on:
11+
12+
- Operating system: MacOS Sequoia 15.5 and Ubuntu 24.04.
13+
- [Vagrant](https://www.vagrantup.com/downloads.html) 2.4.9
14+
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads) 7.2.6
15+
- [Python](https://www.python.org/) 3.13
16+
17+
But may also work for more recent versions.
4118

4219
````{dropdown} Building on Windows
20+
21+
:::{warning}
22+
This has not been tested in some time, here be dragons. 🐉
23+
:::
24+
4325
- Install [Windows Subsystem for Linux](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)
4426
- Install VirtualBox under *Windows*
4527
- Add the following lines to your `.bashrc` in WSL:
@@ -59,59 +41,46 @@ git clone https://github.com/marvel-nccr/quantum-mobile.git
5941
cd quantum-mobile
6042
```
6143

62-
Install [tox](https://tox.readthedocs.io/) and the `vagrant-vbguest` plugin:
44+
Install [tox](https://tox.readthedocs.io/):
6345

6446
```bash
6547
pip install tox
66-
# improves interface
67-
vagrant plugin install vagrant-vbguest
6848
```
69-
:::{tip}
70-
For those using [Conda](https://docs.conda.io/), it is recommended to also install [tox-conda](https://github.com/tox-dev/tox-conda):
71-
72-
```bash
73-
pip install tox-conda
74-
```
75-
76-
:::
7749

7850
## Create the Virtual Machine
7951

80-
:::{seealso}
81-
If you would like to [customise](customize.md) any aspects of the VM, now would be a good time to do so.
82-
:::
83-
84-
85-
Use [tox](https://tox.readthedocs.io/) to set up the Python environment and run the build steps.
52+
We use [tox](https://tox.readthedocs.io/) to set up the Python environment and run the build steps.
8653

8754
```bash
88-
tox -a -v # shows available automations
89-
tox -e vagrant
55+
tox -e vagrant # create and start the VM
56+
tox -e ansible # provision the VM with Ansible
9057
```
91-
This will call `vagrant up`, to initialise the VM, which then calls `ansible-playbook playbook-build.yml`, to configure the VM and build the required software on it.
9258

93-
:::{tip}
94-
If you get an error during the installation of the VirtualBox Guest Additions, you may need to perform additional steps (see [issue #60](https://github.com/marvel-nccr/quantum-mobile/issues/60)).
95-
:::
96-
:::{tip}
97-
Building the Desktop Edition is tested on GitHub Actions on every commit to the repository.
98-
For the tested steps see the `.github/workflows/build.yml` file.
99-
:::
59+
This will:
60+
1. `tox -e vagrant`: Call `vagrant up` to create and start the VM
61+
2. `tox -e ansible`: Generate the SSH configuration file (`vagrant-ssh`) and call `ansible-playbook playbook-build.yml` to provision the VM and build the required software on it
62+
63+
You can see all available `tox` environments with:
10064

65+
```bash
66+
tox -a -v # shows available automations
67+
```
10168

10269
### Continuing a failed build
10370

10471
If the build fails or is interrupted at any step (for example a failed download, due to a bad connection),
10572
you can continue the build with:
10673

10774
```bash
108-
# output the vagrant box connection details
109-
vagrant ssh-config > vagrant-ssh
11075
tox -e ansible
11176
```
11277

11378
The ansible automation steps are generally idempotent, meaning that if they have been previously run successfully, then they will be skipped in any subsequent runs.
11479

80+
:::{note}
81+
You don't need to manually run `vagrant ssh-config > vagrant-ssh` - `tox -e ansible` does this automatically.
82+
:::
83+
11584
### Running only selected steps
11685

11786
All steps of the ansible build process are "tagged", which allows you to select to run only certain steps, or skip others.
@@ -124,19 +93,13 @@ tox -e ansible -- --list-tags
12493

12594
or look at `playbook-build.yml`.
12695

127-
To run only certain tags, use either:
128-
129-
```bash
130-
ANSIBLE_ARGS="--tags tag1,tag2 --skip-tags tag3" tox -e vagrant
131-
```
132-
133-
or
96+
To run only certain tags, use:
13497

13598
```bash
13699
tox -e ansible -- --tags tag1,tag2 --skip-tags tag3
137100
```
138101

139-
## Creating the image
102+
### Creating the image
140103

141104
First, clean unnecessary build files:
142105

@@ -156,10 +119,38 @@ This will compact the hard disk of the virtual machine and export the image and
156119
The `validate` tag checks that the repositories git tag is the same as the `vm_version` specified in `inventory.yml`, and is only needed for new releases by Quantum Mobile maintainers.
157120
:::
158121

159-
## Other Useful commands
122+
### Other Useful commands
160123

161124
- `vagrant reload`: restart machine
162125
- `vagrant halt`: stop machine
163126

164127
Vagrant keeps information on how to connect in a folder called `.vagrant`.
165128
If you would like to create a new machine, `vagrant destroy` will remove the `.vagrant` folder and allow you to create a new VM (note: you may want to keep a copy in case you want to reconnect later).
129+
130+
## Troubleshooting
131+
132+
### VirtualBox Guest Additions Issues
133+
134+
If you experience issues with shared folders, clipboard sharing, or graphics performance, you may need to manage VirtualBox Guest Additions manually.
135+
Install the `vagrant-vbguest` plugin:
136+
137+
```bash
138+
vagrant plugin install vagrant-vbguest
139+
```
140+
141+
Then you can:
142+
143+
```bash
144+
# Check Guest Additions status
145+
vagrant vbguest --status
146+
147+
# Manually install/update Guest Additions
148+
vagrant vbguest --do install
149+
150+
# Rebuild Guest Additions
151+
vagrant vbguest --do rebuild
152+
```
153+
154+
:::{note}
155+
VirtualBox Guest Additions are tools that run inside the VM to provide features like shared folders, seamless mouse integration, and better graphics. The base Ubuntu box comes with Guest Additions pre-installed, but version mismatches can occur when you upgrade VirtualBox, potentially causing shared folder or clipboard issues. This plugin helps resolve such mismatches.
156+
:::

docs/maintainers/develop.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ pre-commit run --all
1515
pip install tox
1616
# to build from scratch
1717
tox -e docs-clean
18+
# to update the build (faster, doesn't remove existing build)
19+
tox -e docs-update
1820
# to start a live server (reloads automatically on changes to documentation)
1921
tox -e docs-live
2022
```
2123

2224
## Testing a build on GH Actions
2325

24-
Pushing a commit to master or a PR on GitHub will trigger a pre-commit and initial build (only for `init` tagged tasks) tests on GH Actions.
26+
Pushing a commit to main or a PR on GitHub will trigger a pre-commit test and a Docker-based build test on GitHub Actions.
27+
The build test runs Ansible provisioning in Docker containers on both ARM64 (`ubuntu-24.04-arm`) and AMD64 (`ubuntu-latest`) architectures.
2528

2629
You can also trigger a full build test of either the vagrant or docker builds, by pushing a git tag prefixed `vagrant-` or `docker-`.
2730

docs/maintainers/release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* [Vagrant](https://www.vagrantup.com/downloads.html)
66
* Vagrant [vbguest plugin](https://github.com/dotless-de/vagrant-vbguest) (`vagrant plugin update`)
7-
* [bento/ubuntu-18.04](https://app.vagrantup.com/bento/boxes/ubuntu-18.04) Vagrant image (`vagrant box update`)
7+
* [bento/ubuntu-24.04](https://app.vagrantup.com/bento/boxes/ubuntu-24.04) Vagrant image (`vagrant box update`)
88
* [Virtual Box](https://www.virtualbox.org/wiki/Downloads)
99
* QM codes
1010
* [Quantum Espresso](https://gitlab.com/QEF/q-e/tags)
@@ -66,7 +66,7 @@ Follow the [cloud build instructions](../developers/build-cloud.md).
6666

6767
* For the server to build the VM, choose e.g. 2 CPUs with 4GB of RAM, with at least 16GB of storage.
6868
* Your configuration may also be the standard configuration shown to users creating a VM using your image
69-
* Currently Ubuntu Server 20.04 LTS
69+
* Currently Ubuntu Server 24.04 LTS
7070
* Expose ports as listed in instructions
7171
* You won't need it for long, so price for CPU/RAM is of no concern
7272
* Exemplary metadata:

0 commit comments

Comments
 (0)