There are three important tasks in the Master- Slave Architecture to be used for PyTI
- Slave Registration
- Commanding the slave
- Reporting the master
- Status reporting
The following protocols is what I propose to be used for the master – slave architecture . I am just concentrating on a simple implementation for now and adding on to it when need arises.
1) Slave Registration :
A new slave wants to register with the master . It sends a request to the master.
The master processes the request and sends and acknowledgement back.
To keep the prototype simple , i didnt include any authentication
mechanism for the slave . The slave simply registers itself with the master by sending a message providing details
Some of the details which the slave needs to send :
- The platform/architecture of the slave machine
- The operating system of vm it configures
- Name and email address of the maintainer
The master acknowledges the slave with either ok or with an error message.
2) Commanding the slave :
When the master detects a new distribution uploaded in PyPI , it wants to command the slave for the distribution to be downloaded and tested.
So the master initiates a test request to the slave .
The slave replies back the master with an acknowledgement.
The slave performs the request as specified by the master(i.e first downloads the distribution to be tested along with the dependencies and then tests the distributions)
3) Reporting the master :
Reporting the master the following processes when they happen
- Distributions downloaded as asked
- VM started (i.e testing is in progress)
- Tests completed
The master will notified of what a particular slave is currently doing .If the slave has problems with the distributions or during testing, it sends an error message to the master at the appropriate stage notifying of failure.
Now the slave has performed the tests and it needs to send the raw data ( got from the tests output) to the master . Status reporting might require a completely new blog . And will post it once the implementation of the above three protocols are done.