Building application with 3 services: A, B and C.
A: Generates M square matrices of order N of random numbers. The matrices should be generated at a rate of F matrices per second. Sends the results to B.
B: Inverts the input matrix and calculates determinant. Sends the results to C.
C: Receives the value of the determinant and shows on the screen.
Each service must run in a different container.
First of all you need to install docker. Go to Oficial page for more details about installation.
Once you have docker installed, you can get the image of this aplication from my repository on Docker Hub.
docker pull luizcarloscf/servers-socket
Or you can build the image.
docker build --tag=servers-socket .
Create our user-definied network.
docker network create my-net
Run the container that shows the results.
docker run --network=my-net --name=result servers-socket python3 result.py port=80
Run the container that calculate the determinant and forward the messages.
docker run -d --network=my-net --name=forward-det servers-socket python3 forward-det.py port_on=80 port_to=80
Run the container that generate the matrix.
docker run --network=my-net --name=generate-matrix servers-socket python3 generate-matrix.py port=80 m=1 n=10 f=2