Commit f53ff9a8 authored by Jerico Moeyersons 's avatar Jerico Moeyersons 🏘
Browse files

Added readme

parent d6f04862
# Mandelbrot-creator
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
* Python 3.9 (for using the command line interface).
## 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.
The cli can either be installed in your local Python environment or a virtual environment. I advise
to install it in a virtual environment. You can create them with `venv`, `virtualenv` or Anaconda
depending on your preferences. With `conda` you can do this as follows:
Creating the new virtual environment:
`conda create -n myenv`
Activating the virtual environment:
`conda activate myenv`
After activating the environment it should appear in front
of your prompt, e.g. :
`(myenv) User at device in ~/bla/bla/bla`
Deactivating the virtual environment:
`conda deactivate`
(`myenv` is the name of your new virtual environment.)
Once you've created and activated this virtual environment (make sure
the Python version is 3.9 or higher), you can install the cli as follows
(make sure you are in the `cli` folder):
`pip install --editable .`
To test if the installation was successful, execute the following command:
This command should give you a list of possible commands:
Usage: mandelbrot-creator [OPTIONS] COMMAND [ARGS]...
If you see this appearing, the cli was successfully installed!
**Note: Anacode is currently not available in Python version 3.9**
### 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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment