In the phpMyAdmin example, students were using the most basic part of SlapOS – how to install and deploy a simple software.
But the most important part of the SlapOS system is the slap.request method.
This tutorial provides a theorical introduction to the slap.request method.
The slap.request method connects to the SlapOS master in order to request instantiation.
The SlapOS master is the central point of the SlapOS cluster. It gathers requests and selects their destination.
It also manages software installation and deployment across the cluster
Let's say that there are two computers with some partitions connected to the same master.
On one computer a PHP application is being deployed.
The recipe for this application is configured to request a MySQL database.
So the partition connects to the SlapOS master and asks for such a software instance.
As the request is done asynchronously, the first call is answered with “Please wait, I am processing.
Now the SlapOS master is querying its own database about Computers and Partitions.
It looks for a free Computer Partition on a Computer, which has the proper software installed.
It asks this computer to deploy a new MySQL database, and fetches connection information.
The originating partition, as the first request did not succeed, asks again for a MySQL database.
As the database is instantiated correctly, the SlapOS master provides it.
And this is where the template mechanism are used. Connection dictionary is sent by the SlapOS master to the PHP partition.
Thanks to this, the recipe responsible for PHP instantiation is able to configure the application.
Here is the actual view of the two requested instances: how they are connected, and what the running processes are.