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
100 changes: 0 additions & 100 deletions 02_virtualization_and_containers/containers_slides.md

This file was deleted.

62 changes: 25 additions & 37 deletions 02_virtualization_and_containers/docker_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,50 @@ slideOptions:
}
</style>

# Docker
# Containers with Docker

<img src="https://upload.wikimedia.org/wikipedia/en/thumb/f/f4/Docker_logo.svg/2560px-Docker_logo.svg.png" width=40%; style="margin-left:auto; margin-right:auto; padding-top: 25px; padding-bottom: 25px">
<img src="https://upload.wikimedia.org/wikipedia/commons/7/79/Docker_%28container_engine%29_logo.png" width=40%; style="margin-left:auto; margin-right:auto; padding-top: 25px; padding-bottom: 25px">

<small>Image by https://www.docker.com/, Fair use, https://en.wikipedia.org/w/index.php?curid=70663056</small>

---

## What is Docker? 1/3
## What is a Container?

- Docker Inc.
- Docker Desktop
<img src="https://raw.githubusercontent.com/Simulation-Software-Engineering/Lecture-Material/main/02_virtualization_and_containers/figs/container-sketch.png" width=30%; style="margin-left:auto; margin-right:auto; padding-top: 25px; padding-bottom: 25px">

> Developer productivity tools and a local Kubernetes environment.

- Docker Engine

> an open source containerization technology for building and containerizing your applications.
- Container operates in "fenced off" part of the operating system (`namespaces`)
- Lower overhead than a virtual machine
- Runs on kernel (and libraries) of the host OS
- Cheap to start and stop a container
- Available features depend on Host (Linux, Windows)
- Container can be isolated.

---

## What is Docker? 2/3

- Docker Hub

> Cloud-based application registry and development team collaboration services.
## Common Use-Cases

- Docker Compose

> a tool for defining and running multi-container Docker applications.
- Microservices
- Reproducible environments for developing and testing (DevOps)
- More and more in science
- High-performance computing, "Bring Your Own Environment"
- Reproducible research

---

## What is Docker? 3/3
## Container Solutions

> Docker is an open platform for developing, shipping, and running applications.
- 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/)...
- Different solutions with different strengths due to different use cases
- Working on the (Super-)Userspace
- Direct access to hardware vs. encapsulation
- Generic or with integration in software ecosystem (e.g. job schedulers)
- Common standard: [Open Container Initiative (OCI)](https://opencontainers.org/)

---

## Introduction
## Docker

- 2010: Docker Inc. founded
- 2013: First Docker release
Expand All @@ -73,16 +77,6 @@ slideOptions:

---

## Typical Docker Applications

- Applications as Microservices
- Containers for consistent development environment
- Containers for consistent testing environment
- Portable format for sharing applications
- Avoid tedious installation procedures by providing Docker container ([FEniCS](https://fenicsproject.org/download/), [OpenFOAM](https://www.openfoam.com/download/openfoam-installation-on-windows-docker), [GitLab](https://docs.gitlab.com/ee/install/docker.html), etc.)

---

## Building Blocks 1/2

- Docker objects
Expand Down Expand Up @@ -244,12 +238,6 @@ Details available in [`docker_demo.md`](https://github.com/Simulation-Software-E

---

## Demo: Run FEniCS Container

Details available in [`docker_demo.md`](https://github.com/Simulation-Software-Engineering/Lecture-Material/blob/main/02_virtualization_and_containers/docker_demo.md)

---

## 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 @@ -19,7 +19,7 @@

```Singularity
BootStrap: docker
From: ubuntu:22.04
From: precice/precice

%post
apt-get -y update
Expand All @@ -30,7 +30,7 @@
export PATH=/usr/games:$PATH

%runscript
date | cowsay | lolcat
precice-tools --version | cowsay | lolcat
```

- Show file `lolcow.def` content
Expand Down
2 changes: 1 addition & 1 deletion 02_virtualization_and_containers/singularity_slides.md
Original file line number Diff line number Diff line change
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://hpc.github.io/charliecloud/)
- Other solutions: [Sarus](https://user.cscs.ch/tools/containers/sarus/), [Charliecloud](https://charliecloud.io/latest/index.html)

---

Expand Down
16 changes: 5 additions & 11 deletions 02_virtualization_and_containers/vagrant_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,8 @@ slideOptions:
## What for?

- Developing software
- Set up consistent development environment
- Share environment with others
- Set up / share consistent development environment
- Testing software, workflows...
- Disposable environments
- Consistent workflows
- More general
- Simple way to setup virtual machine
- Reproducible environment

---
Expand All @@ -70,12 +65,11 @@ slideOptions:

- Strong focus on workflow consistency
- (Re)use existing images
- Automatize VM creation and configuration
- Automate VM creation and configuration
- Easier than with VirtualBox CLI and shell scripts
- Store in Git-friendly format
- For us:
- Management of VirtualBox VMs (testing, developing...)
- Sharing of VMs (debugging, workshops...)

> "If you can't git diff a file format, it's broken."

---

Expand Down Expand Up @@ -133,7 +127,7 @@ 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 = "202407.23.0"
config.vm.box_version = "202510.26.0"
end
```

Expand Down
65 changes: 42 additions & 23 deletions 02_virtualization_and_containers/virtualbox_slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,49 @@ slideOptions:
}
</style>

# VirtualBox
# Virtual machines with VirtualBox

<img src="https://upload.wikimedia.org/wikipedia/commons/f/ff/VirtualBox_2024_Logo.svg" width=20%; style="margin-left:auto; margin-right:auto; padding-top: 25px; padding-bottom: 25px">

---

## Introduction
## What is a Virtual Machine?

<img src="https://raw.githubusercontent.com/Simulation-Software-Engineering/Lecture-Material/main/02_virtualization_and_containers/figs/virtualmachine-sketch.png" width=40%; style="margin-left:auto; margin-right:auto; padding-top: 25px; padding-bottom: 25px">

- A computer inside your computer, with its own OS and resources
- Virtual Machines are portable and flexible

---

## (Some) Features of Virtual Machines

- Exclusive access to some of your resources
- Behaves like a native installation
- Isolation from host operating system
- Popular for
- Safety critical tasks
- Development and testing
- Wherever one wants a portable solution

---

## Types of Hypervisors

- **Type 1**
- Runs directly on bare-metal hardware, like the host OS
- Examples: [Microsoft Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/), [VMware ESXi](https://www.vmware.com/products/esxi-and-esx.html), [Xen](https://xenproject.org/), [KVM](https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine), ...
- **Type 2**
- Negotiates resources shared with a host OS
- Examples: [VirtualBox](https://www.virtualbox.org/), [VMWare Workstation Player](https://www.vmware.com/products/workstation-player.html), [Parallels](https://www.parallels.com/eu/products/desktop/)...

---

## VirtualBox

- Hosted hypervisor created by Innotek GmbH (Weinstadt, Germany)
- Obtained by Sun Microsystems in 2008. Since 2010, owned by Oracle
- Open source (GPLv3)
- Free software (GPLv3)

---

Expand All @@ -50,14 +82,12 @@ slideOptions:

---

## Virtual Hard Drive Formats
## Note on CPU architectures

- Virtual hard drive as a file
- Multiple formats, for example:
- **VDI**: "Virtual Disk Image", VirtualBox' native format
- **VHD**: Format used by Microsoft
- **VMDK**: VMWare's virtual disk format
- Support for dynamic allocation
- VirtualBox runs both on x86 and ARM
- ARM hosts need ARM VMs (no emulation)
- Linux support limited/recent (e.g., Ubuntu 25.10)
- Emulation alternative (very slow): [UTM](https://mac.getutm.app/)

---

Expand Down Expand Up @@ -89,21 +119,10 @@ Details available in [`virtualbox_demo.md`](https://github.com/Simulation-Softwa

---

## Summary and Outlook

- VirtualBox is an open-source system for virtual machines
- Simple to set up and run
- Manual setup, but command-line interface exists
- Next step: Infrastructure as code
- Consistency of the environment?
- How to share a VM image with others?

> "If you can't git diff a file format, it's broken."

---

## Further Reading

- [VirtualBox Manual](https://www.virtualbox.org/manual/UserManual.html)
- [VirtualBox Manual: 1. First Steps](https://www.virtualbox.org/manual/ch01.html)
- [VirtualBox Manual: 4. Guest Additions](https://www.virtualbox.org/manual/ch04.html)
- [VirtualBox Manual: 13. Security Guide](https://www.virtualbox.org/manual/ch13.html)
- [Overview of different disk formats](https://www.parallels.com/blogs/ras/vdi-vs-vhd-vs-vmdk/)
Loading