This repository contains everything needed to deploy and run the project.
To run the application in a development environment, simply use the command:
docker-compose up
To run GPU accelerated containers install NVIDIA Container Toolkit.
If the images for the containers aren't created already, the up
command will create them automatically. Changes like new requirements or changes in the build process (Dockerfile) require a rebuild, for that you should use the docker-compose build
command.
If this is your first time deploying the project, you should follow the steps below in order to setup your database and Django application:
- Run the command
docker-compose run --rm backend /bin/bash
. - Migrate the database, run the command
python manage.py migrate
. - Create a superuser, run the
python manage.py createsuperuser
command to create one. - Download the following file and extract it in backend/artifacts:
- Download one of the following files and place it in backend/photovoltiac/fixtures:
- Load backup data, run
python manage.py loaddata base_name.json
to load it into your database.
You can run a task to simulate the input of PV data in the Django admin page
- Go to http://localhost:8000/admin
- In Periodic tasks click on the Add button
- Put a name of your choice and select "photovoltaic.tasks.simulate_input" in Task (registered)
- Create a 1-minute Interval Schedule
- Lastly, save
docker-compose -f docker-compose-gcp.yaml build
docker-compose -f docker-compose-gcp.yaml up