Skip to content

Commit 6694301

Browse files
committed
Update virtualization and containers for WT2627
1 parent 41871dd commit 6694301

8 files changed

Lines changed: 59 additions & 340 deletions

File tree

‎02_virtualization_and_containers/docker_demo.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ docker container attach tutorial
6060
- Contains Dockerfile
6161

6262
```Dockerfile
63-
FROM ubuntu:24.04
63+
FROM ubuntu:26.04
6464

65-
RUN apt-get update -y && apt install -y neofetch
65+
RUN apt-get update -y && apt install -y fastfetch
6666
WORKDIR /app
6767
COPY testfile .
68-
CMD ["neofetch"]
68+
CMD ["fastfetch"]
6969
```
7070

7171
- `docker buildx build --tag testimage .`

‎02_virtualization_and_containers/docker_slides.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ slideOptions:
5757
## Container Solutions
5858

5959
- Plenty of different container formats
60-
- [lxc/lxd](https://linuxcontainers.org/), [Docker](https://www.docker.com/), [podman](https://podman.io/), [Apptainer](https://apptainer.org/), [Sarus](https://user.cscs.ch/tools/containers/sarus/)...
60+
- [lxc/lxd](https://linuxcontainers.org/), [Docker](https://www.docker.com/), [podman](https://podman.io/), [Apptainer](https://apptainer.org/), ...
6161
- Different solutions with different strengths due to different use cases
6262
- Working on the (Super-)Userspace
6363
- Direct access to hardware vs. encapsulation
@@ -126,7 +126,7 @@ slideOptions:
126126
- Option 2: Be member of group `docker` (=makes you root), expected by some applications (e.g. `act`)
127127
- Alternatives:
128128
- [Rootless mode](https://docs.docker.com/engine/security/rootless/)
129-
- Run Docker in a VM for better isolation
129+
- Run Docker in a VM for better isolation ([Docker Sandboxes](https://www.docker.com/products/docker-sandboxes/))
130130
- Check [security notes](https://docs.docker.com/engine/security/)
131131

132132
---
@@ -211,12 +211,12 @@ Details available in [`docker_demo.md`](https://github.com/Simulation-Software-E
211211
## Dockerfile Example
212212

213213
```Dockerfile
214-
FROM ubuntu:24.04
214+
FROM ubuntu:26.04
215215

216-
RUN apt update -y && apt install -y neofetch
216+
RUN apt update -y && apt install -y fastfetch
217217
WORKDIR /app
218218
COPY testfile .
219-
CMD ["neofetch"]
219+
CMD ["fastfetch"]
220220
```
221221

222222
---
@@ -238,6 +238,15 @@ Details available in [`docker_demo.md`](https://github.com/Simulation-Software-E
238238

239239
---
240240

241+
## Making Images Smaller
242+
243+
- Base image: `alpine` instead of `ubuntu`
244+
- Remove APT cache: `rm -rf /var/lib/apt/lists/*`
245+
- Remove intermediate build files (`*.o`)
246+
- Nice disk usage utility: [ncdu](https://en.wikipedia.org/wiki/Ncdu)
247+
248+
---
249+
241250
## Advanced Topics
242251

243252
- User ID mapping

‎02_virtualization_and_containers/singularity_demo.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- `apptainer shell precice_latest.sif`
88
- Run shell in container
99
- `whoami` will show same user as I am on the computer
10-
- `apptainer exec precice_latest.sif precice-tools --version`
10+
- `apptainer exec precice_latest.sif precice-version`
1111
- Run command in container
1212
- Show the mounted filesystems and hardware access.
1313
- Show that we cannot run things as root.
@@ -30,7 +30,7 @@
3030
export PATH=/usr/games:$PATH
3131
3232
%runscript
33-
precice-tools --version | cowsay | lolcat
33+
precice-version | cowsay | lolcat
3434
```
3535
3636
- Show file `lolcow.def` content

‎02_virtualization_and_containers/singularity_slides.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Details available in [`singularity_demo.md`](https://github.com/Simulation-Softw
125125

126126
```Singularity
127127
BootStrap: docker
128-
From: ubuntu:22.04
128+
From: ubuntu:26.04
129129
130130
%post
131131
apt-get -y update
@@ -167,7 +167,7 @@ Details available in [`singularity_demo.md`](https://github.com/Simulation-Softw
167167
- Special container format for scientific computing
168168
- Immutable containers in a single file
169169
- Prefers integration over isolation
170-
- Other solutions: [Sarus](https://user.cscs.ch/tools/containers/sarus/), [Charliecloud](https://charliecloud.io/latest/index.html)
170+
- Other solutions: [Sarus](https://sarus.readthedocs.io/), [Charliecloud](https://charliecloud.io/)
171171

172172
---
173173

@@ -176,4 +176,3 @@ Details available in [`singularity_demo.md`](https://github.com/Simulation-Softw
176176
- [Apptainer user guide](https://apptainer.org/docs/user/latest/index.html)
177177
- [Singularity User Guide](https://docs.sylabs.io/guides/main/user-guide/)
178178
- [Singularity Cloud](https://cloud.sylabs.io/library)
179-
- [Sarus](https://user.cscs.ch/tools/containers/sarus/)

‎02_virtualization_and_containers/vagrant_demo.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Demo: Create VM based on a base Ubuntu box
44

55
- Create a working directory and enter it.
6-
- `vagrant init bento/ubuntu-24.04` creates a base `Vagrantfile`.
6+
- `vagrant init bento/ubuntu-26.04` creates a base `Vagrantfile`.
77
- `vagrant up` Creates `Vagrantfile`. This file can be put in version control.
88
- Download and set up VM.
99
- Will also start VM
@@ -27,7 +27,7 @@
2727

2828
```ruby
2929
Vagrant.configure("2") do |config|
30-
config.vm.box = "bento/ubuntu-24.04"
30+
config.vm.box = "bento/ubuntu-26.04"
3131
config.vm.provision :shell, path: "bootstrap.sh"
3232

3333
config.vm.provider "virtualbox" do |vb|
@@ -42,15 +42,15 @@
4242
!/usr/bin/env bash
4343
4444
apt-get update
45-
apt-get install -y neofetch vim
45+
apt-get install -y fastfetch vim
4646
echo "export TEST_ENV_VAR=\"Hello SSE\"" >> .bashrc
4747
```
4848

4949
- Installs software and sets `TEST_ENV_VAR`
5050
- `vagrant up`: Create VM
5151
- Image should be prebuilt
5252
- `vagrant ssh`
53-
- Call `neofetch`
53+
- Call `fastfetch`
5454
- `echo $TEST_ENV_VAR` to show that variable is actually set.
5555
- `vagrant package --base "sse-first-step" --output sse-first-step.box`: Export VM
5656
- `sse-first-steps.box` can be uploaded to [Vagrant Cloud](https://app.vagrantup.com)

‎02_virtualization_and_containers/vagrant_slides.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ slideOptions:
8080
- Creates `Vagrantfile` -> Text file (Git friendly)
8181
- `vagrant up`
8282
- Create VM and start it
83-
- VM is stored in `${HOME}/.vagrant.d/boxes` (overruled by `VAGRANT_HOME`)
83+
- VM is stored in `${HOME}/.vagrant.d/boxes`<br/> (overruled by `VAGRANT_HOME`)
8484
- `vagrant ssh`
8585
- Connect to VM via ssh
86+
- Get an SSH configuration with `vagrant ssh-config`
8687
- `vagrant destroy`
8788
- Stops the virtual machine and removes its disk
8889

@@ -126,15 +127,15 @@ Details available in [`vagrant_demo.md`](https://github.com/Simulation-Software-
126127

127128
```ruby
128129
Vagrant.configure("2") do |config|
129-
config.vm.box = "bento/ubuntu-24.04"
130-
config.vm.box_version = "202510.26.0"
130+
config.vm.box = "bento/ubuntu-26.04"
131+
config.vm.box_version = "202606.01.0"
131132
end
132133
```
133134

134135
- Alternative (creates the corresponding `Vagrantfile`):
135136

136137
```bash
137-
vagrant init bento/ubuntu-24.04
138+
vagrant init bento/ubuntu-26.04
138139
```
139140

140141
- Start VM with `vagrant up`
@@ -160,6 +161,7 @@ Details available in [`vagrant_demo.md`](https://github.com/Simulation-Software-
160161
## Vagrant Cloud
161162

162163
- Repository of premade boxes: [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover)
164+
- **However:** This is now deprecated -> community hosting
163165
- Package a box:
164166

165167
```bash
@@ -174,8 +176,8 @@ Details available in [`vagrant_demo.md`](https://github.com/Simulation-Software-
174176

175177
## Demo: Own box
176178

177-
- `bento/ubuntu-24.04`:
178-
- [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover/bento/ubuntu-24.04)
179+
- `bento/ubuntu-26.04`:
180+
- [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover/bento/ubuntu-26.04)
179181
- [GitHub](https://github.com/chef/bento)
180182
- `precice/precice-vm`:
181183
- [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover/precice/precice-vm)

‎02_virtualization_and_containers/virtualbox_slides.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ slideOptions:
8686

8787
- VirtualBox runs both on x86 and ARM
8888
- ARM hosts need ARM VMs (no emulation)
89-
- Linux support limited/recent (e.g., Ubuntu 25.10)
89+
- Linux support limited/recent (e.g., Ubuntu 26.04)
9090
- Emulation alternative (very slow): [UTM](https://mac.getutm.app/)
9191

9292
---
9393

9494
## Content of a VirtualBox Image Directory
9595

96-
- `VM.vdi`: The virtual hard drive containing the Guest OS
96+
- `VM.vdi` / `VM.vmdk`: The virtual hard drive containing the Guest OS
9797
- `VM.vbox`: XML containing metadata and configuration information (RAM, network devices...)
9898
- `VM.vbox-prev`: Backup of previous settings
9999
- `Logs/`: Directory containing log files
@@ -105,10 +105,10 @@ slideOptions:
105105

106106
- Software and drivers to improves Guest's performance
107107
- Better video support, shared clipboard, ...
108-
- Might need additional packages. On Ubuntu 24.04 (guest):
108+
- Might need additional packages. On Ubuntu 26.04 (guest):
109109

110110
```bash
111-
sudo apt install virtualbox-guest-utils virtualbox-guest-x11
111+
sudo apt install virtualbox-guest-utils
112112
```
113113

114114
---

0 commit comments

Comments
 (0)