- Prerequisites
- Summary of using xpn-docker
- Build the container image
- Some xpn-docker use cases:
- Multiple containers on multiple nodes
- Authors
- Windows:
- MacOS (docker desktop): https://docs.docker.com/desktop/setup/install/mac-install/
- Linux (docker): https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
: Add Docker's official GPG key: sudo apt update sudo apt install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc : Add the repository to Apt sources: sudo tee /etc/apt/sources.list.d/docker.sources <<EOF Types: deb URIs: https://download.docker.com/linux/ubuntu Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") Components: stable Signed-By: /etc/apt/keyrings/docker.asc EOF : Update repo and install docker sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
| Action | Command | |
|---|---|---|
| Container image | build image IF((First time OR dockerfile updated)) |
./xpn_docker.sh build
|
| Save image | ./xpn_docker.sh image-save
|
|
| Load image | ./xpn_docker.sh image-load
|
|
| Multiple nodes | Starting docker swarm |
./xpn-docker.sh swarm-create machinefile
|
| Stopping docker swarm |
./xpn-docker.sh swarm-destroy
|
|
| Work session | To spin up 3 containers | ./xpn_docker.sh start 3
|
| To get into container 1 | ./xpn_docker.sh bash 1
|
|
| To exit from container | exit |
|
| To spin down all containers | ./xpn_docker.sh stop
|
|
| Get information | To check running containers |
./xpn_docker.sh status
|
| To get the containers internal IP addresses |
./xpn_docker.sh network
|
|
- Please beware of:
- Any modification outside the "/work" directory will be discarded on container stopping.
- Please make a backup of your work "frequently" (just in case).
- You might need to use "sudo" before ./xpn_docker.sh if your user doesn't belong to the docker group
- It could be solved by using "sudo usermod -aG docker ${USER}"
The first time xpn-docker is deployed or when the docker/dockerfile is updated we need to build the container image.
-
To build the container image for a single node:
./xpn-docker.sh clean-build
-
To build and distribute the container image to multiple nodes:
- Build and save the image to the
xpn_docker.tgzfile by using:./xpn-docker.sh clean-build ./xpn-docker.sh image-save
- Copy
xpn_docker.tgzto other nodes, and load this file:scp xpn_docker.tgz node-x ssh node-x ./xpn-docker.sh image-load
- Build and save the image to the
| Expand (FUSE) | Expand (LD_PRELOAD) | Expand (native) |
: Step 1.
./xpn_docker.sh start 3
./xpn_docker.sh status
: Step 2.
./xpn_docker.sh bash 1
cd ./test
./xpn-mpi-fuse.sh
exit
: Step 3.
./xpn_docker.sh stop |
: Step 1.
./xpn_docker.sh start 3
./xpn_docker.sh status
: Step 2.
./xpn_docker.sh bash 1
cd ./test
./xpn-mpi-bypass.sh
exit
: Step 3.
./xpn_docker.sh stop |
: Step 1.
./xpn_docker.sh start 3
./xpn_docker.sh status
: Step 2.
./xpn_docker.sh bash 1
cd ./test
./xpn-mpi-native.sh
exit
: Step 3.
./xpn_docker.sh stop |
The general steps are:
- Starting 3 containers
- Then, do some work from container 1
- Bash on container 1
- Execute example with Expand native access or access by using FUSE or by using LD_PRELOAD
- Exit from container 1
- Stopping all containers
| MDtest | IOR |
: 1. To start 3 containers,
: 2. sleep 5 seconds,
: 3. work from container 1,
: 4. and stop all containers
./xpn_docker.sh \
start 3 \
sleep 5 \
exec 1 "./benchmark/xpn-mpi-mdtest.sh" \
stop |
: 1. To start 3 containers,
: 2. sleep 5 seconds,
: 3. work from container 1,
: 4. and stop all containers
./xpn_docker.sh \
start 3 \
sleep 5 \
exec 1 "./benchmark/xpn-mpi-ior.sh" \
stop |
| Word count |
: 1. To start 3 containers
./xpn_docker.sh start 3
./xpn_docker.sh sleep 5
: 2. Work from container 1
./xpn_docker.sh exec 1 ./spark/quixote-local.sh
./xpn_docker.sh exec 1 ./spark/quixote-xpn.sh
: 3. Stop all containers
./xpn_docker.sh stop |
An example using multiples nodes is:
: Step 1: Starting docker swarm
./xpn-docker.sh swarm-create machinefile
: Step 2: Starting containers
NC=$(wc machines | awk '{print $1}')
./xpn-docker.sh start $NC
: Step 3: Doing execution
./xpn_docker.sh bash 1
./benchmark/xpn-mpi-native.sh
exit
: Step 4: Stopping containers (undoing 2)
./xpn-docker.sh stop
: Step 5: Stopping docker swarm (undoing 1)
./xpn-docker.sh swarm-destroyThe general steps are:
- Starting docker swarm
- Starting containers
- Doing execution
- Stopping containers (undoing 2)
- Stopping docker swarm (undoing 1)
- 🧑💻 Félix García-Carballeira
- 🧑💻 Alejandro Calderón Mateos
- 🧑💻 Diego Camarmas Alonso
- 🧑💻 Dario Muñoz Muñoz
- 🧑💻 Elias del Pozo Puñal