www.postgresql.org/download (the current ver. 12.3)
Name | Value |
---|---|
Host name/Address | model-garden-db-prod-1.<id>.eu-central-1.rds.amazonaws.com |
Username | postgres |
Password | ****** |
Port | 5432 |
Also update the password in DATABASES = {...}
dict in
settings.py.
- Update
POSTGRES_PASSWORD
in <model_garden_root>/docker-compose.yml.
Also update the password in DATABASES = {...}
dict in
settings.py.
- Run the database container:
docker-compose up -d postgres
The is no need to build the image, because postgres:12-alpine is already pre-build.
Run from <model_garden_root> docker-compose exec postgres psql -U postgres -W <password> model_garden
to access the database via command line.
See in <model_garden_root>/backend/.env file.
-
Follow all the steps in CVAT Installation Guide.
-
Add to the installed CVAT a superuser with
CVAT_ROOT_USER_NAME
andCVAT_ROOT_USER_PASSWORD
specified in <model_garden_root>/backend/.env (see Add Backend .env File below).
NOTE: The currently supported version of CVAT backend API is 0.6.1.
<model_garden_root>/backend/CVAT.postman_collection.json is prepared for Postman API debug client to evaluate used backend API calls to CVAT API in isolation from Model Garden code itself (see a guide about Collections In Postman).
Create <model_garden_root>/backend/.env.
AWS_ACCESS_KEY_ID='<ABCDEFGHIJKLMNOPQRST>*'
AWS_SECRET_KEY='<abcdefghijklmnopqrstuvwxyz0123456789-+/>*'
CVAT_HOST='localhost'
CVAT_PORT=8080
CVAT_ROOT_USER_NAME='<cvat_super_user>*'
CVAT_ROOT_USER_PASSWORD='<cvat_super_user_password>*'
DJANGO_DB_HOST='localhost'
DJANGO_DB_PORT=5444
* - environment specific values
$ python -V
Python 3.8.2
$ pip install virtualenv
$ virtualenv .venv
$ . .venv/bin/activate
$ source ./.venv/Scripts/activate
Or
$ .venv/Scripts/activate.bat
$ pip install -r requirements.txt -r test-requirements.txt
Migrate the database from <model_garden_root>/backend/ dir:
$ python ./manage.py migrate
Reset the database from <model_garden_root>/backend/ dir:
$ python ./manage.py reset_db
Provide initial data for models by reloading fixtures. It's used to pre-populate database with some defaults used in local development.
python manage.py loaddata default_bucket
$ ./manage.py runserver 0:9000
...
Django version 3.0.5, using settings 'model_garden.settings'
Starting development server at http://127.0.0.1:9000/
Quit the server with CONTROL-C.
Run worker in background to update task statuses from CVAT
python worker.py
See http://www.stackoverflow.com/questions/33868806/configuring-pycharm-with-existing-virtualenv
From repository root:
$ docker-compose build
To check the results:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
model_garden latest bd6bc2eadb1d 58 seconds ago 464MB
From repository root:
$ docker-compose up -d
To check the results:
$ docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------
model_garden_backend_1 bash -c python3 manage.py ... Up 0.0.0.0:9000->9000/tcp
model_garden_frontend_1 /bin/sh -c nginx -g 'daemo ... Up 0.0.0.0:80->80/tcp
model_garden_postgres_1 docker-entrypoint.sh postgres Up 0.0.0.0:5444->5432/tcp
model_garden_worker_1 python3 worker.py Up
$ make lint