README.md 3.42 KB
Newer Older
Jerico Moeyersons's avatar
Jerico Moeyersons committed
1
2
# Mandelbrot-creator

Jerico Moeyersons's avatar
Jerico Moeyersons committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Mandelbrot-creator to enable high CPU loads on your computer.

---

## Repository layout
The repository is laid out as follows:
* `api`: The source code for the API component. This component will spawn and start workers.
* `cli`: The source code for the CLI. From here you will need to install this application
* `worker`: The source code for the worker component, calculating a mandelbrot

---

## Prerequisites
* Docker community edition Version 18.0 and up (for the core framework).
* Docker compose version 3.5
18
* Python 3.8 (for using the command line interface).
Jerico Moeyersons's avatar
Jerico Moeyersons committed
19
20
21
22
23
24
25
26
27
28
29

---

## Installing the command line interface.

The command line interface (cli) is built in Python and must be installed accordingly.

Navigate to the folder where you cloned the repository.

Navigate to the `cli` folder.

Jerico Moeyersons's avatar
Jerico Moeyersons committed
30
The cli can either be installed in your local Python environment or a virtual environment. 
Jerico Moeyersons's avatar
Jerico Moeyersons committed
31

Jerico Moeyersons's avatar
Jerico Moeyersons committed
32
Install the cli as follows (make sure you are in the `cli` folder):
Jerico Moeyersons's avatar
Jerico Moeyersons committed
33

Jerico Moeyersons's avatar
Jerico Moeyersons committed
34
`pip3 install --user --editable .`
Jerico Moeyersons's avatar
Jerico Moeyersons committed
35

Jerico Moeyersons's avatar
Jerico Moeyersons committed
36
> In some cases you must add the path to where the mandelbrot-creator is installed to your PATH. The pip3 installer will warn you about this.
Jerico Moeyersons's avatar
Jerico Moeyersons committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

To test if the installation was successful, execute the following command:

`mandelbrot-creator`

This command should give you a list of possible commands:
```
Usage: mandelbrot-creator [OPTIONS] COMMAND [ARGS]...

Options:
...
```

If you see this appearing, the cli was successfully installed!

### Starting the application for the first time.
The current version of the application needs to be build the first time it is used.
This is done automatically if you've installed the cli by starting the application. This can be done as follows.

Navigate to the root folder.

Execute the following command:
`mandelbrot-creator on`

This action will set Docker to work and build the images for all the components.
Make sure you have access to the Internet or this will fail. Once the components are
ready, the framework will start up and print the message `Mandelbrot-creator started!`.
You can check if the up and running framework as follows:

`docker ps`

You should see one active container: `api`.

## Using the application
So the application is installed, let's get to work! With the currently installed version, there isn't much we can do,
as there are no custom additions possible. 

First, you need to spawn a number of workers. You can do this with following command (x = the number of workers you want):

`mandelbrot-creator spawn-workers x`

Afterwards, you can start calculating mandelbrots on all your workers with following command:

`mandelbrot-creator start-workers x`

In this case, x marks the number of mandelbrots you want to calculate. The higher x, the longer it takes to calculate all the mandelbrots. 

Shut down the framework with: `mandelbrot-creator off`.

## Known issues
* No possibility to change the specifications of the calulcated mandelbrots
* A list of active workers cannot be displayed (you can check this with the docker ps command)

Please submit an issue in case of any bug or problem.

## Copyright

You can use and modify this application as part of your education, but you are not allowed to share this application, your modifications, and your solutions. Please contact the teaching staff if you want to use (part of) this application for teaching other courses.

Copyright © teaching staff of the course "Besturingssytemen III" (E765002) at the Faculty of Engineering and Architecture - Ghent University.