-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to FIRELab wiki, From vegetation characterization to fire segmentation and progression, and much more, FIRELab helps environmental researchers, data scientists and engineers streamline their work. All this aligned with a responsive, easy-to-use, all-in-one platform.
This project was developed in the context of Project in Informatics curricular unit, part of the Informatics Engineering Degree of University of Aveiro.
- Welcome
- Table of Contents
- User guide
- Release Notes
- Installation Guide
- Final Notes
To learn about the project in more detail and to answer questions about implementation and usage, check the technical report, available in the project's repository
The summary of all releases can be found at the Github repository releases page
As a web platform, FIRELab is available on a variety of Linux distros, macOS and Windows through the usage of Docker and/or local installation of all the requirements. The guides in this section will use bash commands for linux terminal, but there are similar versions of them for both macOS and Windows as well as the Docker Desktop's GUI.
The easiest way to install the tool locally is through the docker-compose.yml
present in the repository's FIRELAB_website directory
- Either download a released version of the source code in the link provided in the Release notes section or clone the repository through the command
$ git clone https://github.com/itskikat/firelab.git
-
On the root folder, open the directory
FIRELab_website
where all the source code is:$ cd FIRELab_website
-
Build and run the tool with docker-compose:
$ docker-compose up -d --build
This might take some time due to the fact that images for both the database and the framework are being installed, as well as the project's dependencies. Note: for subsequent uses, and after the image has been built, to restart the docker containers you may simply run:
$ docker-compose up -d
-
Migrate the database schema inside the docker container to properly set up the PostgeSQL database:
$ docker exec -it firelab_website_web_1 bash python3 manage.py makemigration main python3 manage.py migrate exit
If everything runs smoothly, the database is ready for use.
-
Enter the localhost's port 8000 in a web-browser to see the web application running. Note: if localhost refuses to connect and the site can't be reached, try the following command:
$ docker exec -it firelab_website_web_1 bash python3 manage.py runserver 0.0.0.0:8000
After that use
Ctrl+p
followed byCtrl+q
to detach from the container while leaving the application running; Note that if you useCtrl+z
the application will stop running.
- When you are done working, you can shut down the web application by running:
Don't worry, all saved data in the database will be preserved if you do this.
$ docker-compose down
-
To completly uninstall the web application, first make sure you stopped the docker-compose:
$ docker-compose down
-
After that, remove the volume that stores the persistent data of the database
$ docker volume ls $ docker volume rm firelab_website_postgis-data
Note: if after running $ docker volume ls you dont't see listed under VOLUME NAME
firelab_website_postgis-data
, then the volume has already been erased -
Delete the project's docker images. You can list all images with:
$ docker images
Copy the IMAGE ID of the
firelab_website_web
REPOSITORY and run the following command, replacing $ID with the copied IMAGE ID:$ docker image rm $ID
Note: the project also makes use of the
kartoza/postgis
andpython
images, which can be deleted if no other project of yours does, so proceed with caution. -
Finally you can safely delete the source code and the repository root folder.
This section will guide you through how to manually install the tool without using docker or docker-compose, while installing all required dependencies on your machine.
- Either download a released version of the source code in the link provided in the Release notes section or clone the repository through the command
$ git clone https://github.com/itskikat/firelab.git
-
Move to the source code directory of the root folder of the project:
$ cd FIRELab_website
-
Create a virtual environment (venv) to run the tool on:
$ python3 -m venv venv
Note the last venv can be replaced with the name/path of the virtual environment you want to create, but remember to adjust subsequent commands
-
Activate the virtual environment:
$ source venv/bin/activate
-
Install the required dependencies:
$ add-apt-repository ppa:ubuntugis/ppa && apt-get update $ sudo apt-get install -y binutils libgdal-dev gdal-bin $ sudo apt-get install -y python3-opencv
-
Install the requirements through the
requirements.txt
file:$ pip3 install -r requirements.txt
-
Export the path variable for gdal
$ export CPLUS_INCLUDE_PATH=/usr/include/gdal $ export C_INCLUDE_PATH=/usr/include/gdal
-
Check the gdal info version, to see if it was correctly installed:
$ gdalinfo --version
-
Install GDAL version 2.4.2 using pip:
$ pip3 install -I GDAL==2.4.2
- First you need to create a user on the database, with the credentials
user: superuser
andpassword: firelabdbpass
- Create a database
firlab
with hostlocalhost
on the default port (5432
) - In the created database, create the extension for postgis using
CREATE EXTENSION postgis
-
First we need to migrate the database schema to properly set up the PostgeSQL database:
$ python3 manage.py makemigrations main $ python3 manage.py migrate
If everything runs smoothly, the database is ready for use.
-
Run the Django web application with:
$ python3 manage.py runserver 0.0.0.0:8000
This will run the application on port 8000; if another port is available, you can modify this number. After that, you should see the web application start in your terminal, indicating that it is ready to use.
-
Enter the localhost's port 8000 (or, the one you chose) in a web browser to see the web application running.
- To stop the application, just use
Ctrl+z
on the terminal window it's running on.
More information available on the project's website as well as a tutorial demo. Thank you for using our tool, contributions are always helpful and appreciated.