Skip to content

haysberg/baleine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Baleine 🐋

Check out the docs !

Orchestrate Docker containers over the R2Lab platform from a single CLI. This allows you to manipulate the software run on the different nodes quickly and with ease. Using the four subcommands of this tool, you can deploy Docker containers on top of the 37 test nodes available in R2Lab.

Baleine simple demo

What are the benefits ?

  • By using a local repository, we can cache the image downloaded from external sources, allowing for much faster deployment.
  • The code is fully multi-threaded, allowing for good scalability.
  • The project is completely open-source and all the libraries are contained within the binary, which makes it extremely portable.
  • Using Docker containers, we can save, deploy and destroy an instance in mere seconds.
  • Thanks to the nature of Docker containers, our experiments can be easily reproduced without having to fiddle with config files.

Usage

Using the four subcommands of this tool, you can deploy Docker containers on top of the 37 test nodes available in R2Lab.

  • deploy to automatically deploy containers on the specified nodes with the Docker options you want
  • destroy to remove the containers
  • save to save a running container as a new image on the local R2Lab repository
  • list to get a list of all the images on the repository
  • build to build an image from either a local Dockerfile or from a URL, and save it to the R2Lab repo

To see the full list of available options, please check the docs

📥 Installation

Right now, we do not offer a binary that you can download and install. You will need to clone the github repository and compile the code yourself. Once you have Rust installed on your machine, you can use the provided scripts to install the binary.

Use the same procedure to update Baleine.

Gateway

git clone https://github.com/haysberg/baleine
cd baleine
./setup_files/build_and_install.sh

# Check if baleine is installed correctly
which baleine

Docker registry & DockerHub proxy

Please note : you can deploy it in the gateway or anywhere else as long as it is reachable by your gateway and nodes.

You will need Docker and docker-compose to run the file.

wget https://raw.githubusercontent.com/haysberg/baleine/main/setup_files/gateway/docker-compose.yml

# -d detaches the output from the terminal
docker compose up -d

Worker node

This script is made to run on Ubuntu-based systems. It should work on Debian systems as well, but it is untested so far.

sudo sh -c "$(wget https://raw.githubusercontent.com/haysberg/baleine/main/setup_files/nodes/setup_node.sh -O -)"

Export the OS to a Rhubarbe image for latter use.

Current workflow on the faraday gateway

Faraday infra

🧰 Configuration

Gateway

The CLI configuration can be found under /etc/baleine/baleine.conf. Here is the default contents :

#URL that will be called when listing available images
REGISTRY_URL = "faraday"
#URL that will be transmitted to the slave nodes to save images
SAVE_URL = "faraday.repo"
REGISTRY_PROTOCOL = "http://"
DEFAULT_BOOTSTRAP_IMAGE="baleine"
SAVE_PORT = 80
DNS_ADDR = "192.168.3.100"

Slave node

On the slave node, faraday and faraday.repo point to the data node from the /etc/hosts file.

# Snippet from /etc/hosts
192.168.2.100	faraday.repo

The Docker daemon is configured through /etc/docker/daemon.json. We add the following lines in the config file :

{
  "insecure-registries" : ["faraday.repo"],
  "registry-mirrors": ["http://faraday.repo:81"]
}

insecure-registries is the hostname of repositories where using HTTP is authorized to push images and interact with the repo. registry-mirrors is the list of repositories configured as proxies.

Please note that the repository is listening on port 80, and the proxy on port 81. You can get a better understanding of the configuration if you look at the docker-compose.yml file that describes the registries configuration in detail.

The default user is added to the docker UNIX group so that you don't need to be root on the machine to use Docker.

Users can login directly into the container by connecting as root@fitxx on port 2222 instead of logging in on port 22.

Need help ?

Please refer to the docs to get an exhaustive list of example commands.

📨 Please open an issue or send me an email in case of bugs : teo.hays@inria.fr