diff --git a/README.md b/README.md index fb1fd3deccc0f314861d5cbbe78448acb28ac08d..b420fd4543524a8c5e4c1a3ea816a96b0390566f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,71 @@ <h3>DESD Group Project - ShallowSink </h3> <h2>Group Members</h2> -<p>Jack McDaid - 21023808<br> +<p> + +Jack McDaid - 21023808<br> Charlie Taylor - 21024059<br> Aaron Jones - 21035135<br> James Burt - 20016437<br> Michael Cook - <br> + +</p> +<h2>Setting it up</h2> +<p> + +To set the system up, you need to have a Python IDE and Docker Desktop. Download the Git code, and navigate the terminal to "ActualProjectCode/DjangoProject". Make sure Docker Desktop is open, and then run "docker compose build". This may take a while. After its finished, run these two commands in order: + +docker compose run --rm web sh -c "python manage.py makemigrations" +docker compose run --rm web sh -c "python manage.py migrate" + +This will make the docker container(s) run both makemigrations and migrate, in order to update the postgresql database in the Docker Desktop volume. + +To start the project, in the same terminal use this command: + +docker-compose up --build + +From here, it will boot up in the localhost, or your selected hosting service (AWS, Azure Cloud, etc...) + +</p> +<h2>Docker Basics</h2> +<p> + +In docker, there are two main screens you will use; Containers, and Volumes. + +In 'Containers', this will include the active and inactive containers of the project. +In 'Volumes', you can access the data stored in a postgresql database. + +If the system goes down, data will be cached as well as the libraries install for python, so it won't take as long as the first time. + +</p +<h2>Creating Superuser<h2> +<p> + +Upon startup, there will be no users or profiles. In the terminal of your Python IDE, use this command: + +docker compose run --rm web sh -c "python manage.py createsuperuser" + +This will create a superuser, which is needed to initialise the first admin. This is a flaw in our system, but after this, the Django admin screen will not be used. + +To initialise the admin, go to the host/admin screen, and login with the details used in the superuser. Head to 'Profiles' and change the role of a created user to 'Admin'. + +</p> +<h2>Adding New Models:</h2> +<p> + +To add new ML models, the AI engineer will need to check some things beforehand. +First of all, make sure that the target column and file_path variables in the new model contain both sys.argv[1] and sys.argv[2] respectively. + +After that, the AI engineer will need to ensure that the model outputs a txt, or csv file containing the data to be outputted to the system. After this, it will need to print the file_path of the new file you created. Using this piece of code, you can do this: + + input_path = file_path + input_dir = os.path.dirname(input_path) + input_filename = os.path.basename(input_path) + input_name = os.path.splitext(input_filename)[0] + output_path = os.path.join(input_dir, f"{input_name}_predictions.csv") + + result_df.to_csv(output_path, index=False) # This can be a txt, but for this example its a csv with a pandas dataframe. + print(output_path) + +When a model is created, it can be deleted by the AI Engineer. </p> \ No newline at end of file