blob: 2d0eae913eb3469041cb1648ff63efde84f003c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
---
description:
globs:
alwaysApply: true
---
bonsai is a python command line tool used to generate realistic network latency graphs using a yaml config.
The tool is called with
```
python -m main --net_config <network-config>.yaml --output_dir <output_dir>
```
The network config is a yaml file whose contents don't really matter and the output directory must exist and will be populated with two files `edges.csv` and `nodes.csv`.
The goal of this project, `bonsai-web` is to create a simple web interface for bonsai since it requires a specific version of python and quite a few dependencies.
You can assume that the bonsai source code is under the directory `/usr/src/bonsai` so you use subprocess in that directory to execute the command above.
The web page we are trying to create is simple and will contain the following components.
+ single html page using picocss
+ single javascript file for client side logic
+ simple flask backend
The html page should have a header with the name bonsai and an image logo. The logo will be present at `logo.png`. The page should have some description text at the top, followed by a text box for the user to provide a configuration and then a button to generate the output files. When the user clicks that button a POST request with the contents of the config should be made to `/` and the server should execute bonsai and return a json object where the keys are the names of the generated files and the values associated with those keys will be the contents of the files.
The page should then display, bellow the button, the list of files with a button to download and one to view. The javascript file should contain the code for all this logic.
There should also be a `Containerfile` that creates a container image for this project. Make sure to use python version 3.9 as the base image and leave some space for me to write the code required to setup the bonsai project, you just need to assume that it will be present at the above location.
|