Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 02_virtualization_and_containers/docker_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ docker container attach tutorial
- Contains Dockerfile

```Dockerfile
FROM ubuntu:24.04
FROM ubuntu:26.04

RUN apt-get update -y && apt install -y neofetch
RUN apt-get update -y && apt install -y fastfetch
WORKDIR /app
COPY testfile .
CMD ["neofetch"]
CMD ["fastfetch"]
```

- `docker buildx build --tag testimage .`
Expand Down
19 changes: 14 additions & 5 deletions 02_virtualization_and_containers/docker_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ slideOptions:
## Container Solutions

- Plenty of different container formats
- [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/)...
- [lxc/lxd](https://linuxcontainers.org/), [Docker](https://www.docker.com/), [podman](https://podman.io/), [Apptainer](https://apptainer.org/), ...
- Different solutions with different strengths due to different use cases
- Working on the (Super-)Userspace
- Direct access to hardware vs. encapsulation
Expand Down Expand Up @@ -126,7 +126,7 @@ slideOptions:
- Option 2: Be member of group `docker` (=makes you root), expected by some applications (e.g. `act`)
- Alternatives:
- [Rootless mode](https://docs.docker.com/engine/security/rootless/)
- Run Docker in a VM for better isolation
- Run Docker in a VM for better isolation ([Docker Sandboxes](https://www.docker.com/products/docker-sandboxes/))
- Check [security notes](https://docs.docker.com/engine/security/)

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

```Dockerfile
FROM ubuntu:24.04
FROM ubuntu:26.04

RUN apt update -y && apt install -y neofetch
RUN apt update -y && apt install -y fastfetch
WORKDIR /app
COPY testfile .
CMD ["neofetch"]
CMD ["fastfetch"]
```

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

---

## Making Images Smaller

- Base image: `alpine` instead of `ubuntu`
- Remove APT cache: `rm -rf /var/lib/apt/lists/*`
- Remove intermediate build files (`*.o`)
- Nice disk usage utility: [ncdu](https://en.wikipedia.org/wiki/Ncdu)

---

## Advanced Topics

- User ID mapping
Expand Down
4 changes: 2 additions & 2 deletions 02_virtualization_and_containers/singularity_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- `apptainer shell precice_latest.sif`
- Run shell in container
- `whoami` will show same user as I am on the computer
- `apptainer exec precice_latest.sif precice-tools --version`
- `apptainer exec precice_latest.sif precice-version`
- Run command in container
- Show the mounted filesystems and hardware access.
- Show that we cannot run things as root.
Expand All @@ -30,7 +30,7 @@
export PATH=/usr/games:$PATH
%runscript
precice-tools --version | cowsay | lolcat
precice-version | cowsay | lolcat
```
- Show file `lolcow.def` content
Expand Down
5 changes: 2 additions & 3 deletions 02_virtualization_and_containers/singularity_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Details available in [`singularity_demo.md`](https://github.com/Simulation-Softw

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

---

Expand All @@ -176,4 +176,3 @@ Details available in [`singularity_demo.md`](https://github.com/Simulation-Softw
- [Apptainer user guide](https://apptainer.org/docs/user/latest/index.html)
- [Singularity User Guide](https://docs.sylabs.io/guides/main/user-guide/)
- [Singularity Cloud](https://cloud.sylabs.io/library)
- [Sarus](https://user.cscs.ch/tools/containers/sarus/)
8 changes: 4 additions & 4 deletions 02_virtualization_and_containers/vagrant_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Demo: Create VM based on a base Ubuntu box

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

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

config.vm.provider "virtualbox" do |vb|
Expand All @@ -42,15 +42,15 @@
!/usr/bin/env bash
apt-get update
apt-get install -y neofetch vim
apt-get install -y fastfetch vim
echo "export TEST_ENV_VAR=\"Hello SSE\"" >> .bashrc
```

- Installs software and sets `TEST_ENV_VAR`
- `vagrant up`: Create VM
- Image should be prebuilt
- `vagrant ssh`
- Call `neofetch`
- Call `fastfetch`
- `echo $TEST_ENV_VAR` to show that variable is actually set.
- `vagrant package --base "sse-first-step" --output sse-first-step.box`: Export VM
- `sse-first-steps.box` can be uploaded to [Vagrant Cloud](https://app.vagrantup.com)
Expand Down
14 changes: 8 additions & 6 deletions 02_virtualization_and_containers/vagrant_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ slideOptions:
- Creates `Vagrantfile` -> Text file (Git friendly)
- `vagrant up`
- Create VM and start it
- VM is stored in `${HOME}/.vagrant.d/boxes` (overruled by `VAGRANT_HOME`)
- VM is stored in `${HOME}/.vagrant.d/boxes`<br/> (overruled by `VAGRANT_HOME`)
- `vagrant ssh`
- Connect to VM via ssh
- Get an SSH configuration with `vagrant ssh-config`
- `vagrant destroy`
- Stops the virtual machine and removes its disk

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

```ruby
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-24.04"
config.vm.box_version = "202510.26.0"
config.vm.box = "bento/ubuntu-26.04"
config.vm.box_version = "202606.01.0"
end
```

- Alternative (creates the corresponding `Vagrantfile`):

```bash
vagrant init bento/ubuntu-24.04
vagrant init bento/ubuntu-26.04
```

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

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

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

## Demo: Own box

- `bento/ubuntu-24.04`:
- [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover/bento/ubuntu-24.04)
- `bento/ubuntu-26.04`:
- [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover/bento/ubuntu-26.04)
- [GitHub](https://github.com/chef/bento)
- `precice/precice-vm`:
- [HashiCorp Cloud](https://portal.cloud.hashicorp.com/vagrant/discover/precice/precice-vm)
Expand Down
8 changes: 4 additions & 4 deletions 02_virtualization_and_containers/virtualbox_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ slideOptions:

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

---

## Content of a VirtualBox Image Directory

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

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

```bash
sudo apt install virtualbox-guest-utils virtualbox-guest-x11
sudo apt install virtualbox-guest-utils
```

---
Expand Down
Loading
Loading