Running Quokka Components - chuckablack/quokka GitHub Wiki
Quokka is made up of two main applications:
- Quokka server: The quokka server is the "main" quokka application. It is running as a Flask application, and it includes things such as a REST API (used by the UI), a database (used to store device, host, and service information), and the "business logic", which is basically the code that "does stuff", such as responding to UI requests, and monitoring devices, hosts, and service. The quokka server is written entirely in Python.
- Quokka UI: The quokka UI is the functionality that makes the nifty user interface work. It is built on things that you don't have to understand now, such as react, material-UI, nodejs, and others. It is written in Javascript.
These applications comprise the bulk of quokka. In addition, however, there are also the remote workers, which perform functions such as packet capture, port scanning, and traceroute.
There are a number of ways to run these quokka applications, we will start at the top with the simplest, all-encompassing scripts:
Single script to run all of quokka
- run-all.sh
From the quokka directory, you can invoke this script as follows:
./run-all.sh
All quokka applications will run and send output to the same terminal. In order to stop all quokka applications, you can invoke the stop-all.sh script:
./stop-all.sh
Scripts for each of the major quokka components
- run-quokka.sh (to run the quokka server)
- run-ui.sh (to run the quokka ui)
- run-workers.sh (to run the quokka workers
You can invoke these as follows, from the quokka directory:
./run-quokka.sh
./run-ui.sh
./run-workers.sh
Stopping these components is possible as follows:
- quokka: From the terminal running quokka, hit ctrl-C twice
- quokka-ui: From the terminal running the quokka UI, hit ctrl-C
- workers: The easiest way is to run the stop-workers.sh script:
./stop-workers.sh
For those interested, the actual commands that cause quokka components to run, which you can see if you examine these scripts, are as follows:
- quokka: To run quokka, we invoke flask from the quokka directory with the command
flask run --host=0.0.0.0
- quokka-ui: To run the quokka UI, we run something called 'npm', with the command
npm start
- workers: To run the workers, we call python directly, e.g.
sudo python3 quokka/workers/quokka_worker.py
with a bunch of parameters
More detail on these can be found in the Implementation section of this documentation, via training videos, etc. For starting out, it is easiest just to execute the run-all.sh script