Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eea/copernicus-insitu-db
Copernicus In Situ Component Information System
https://github.com/eea/copernicus-insitu-db
copernicus datatables django docker elasticsearch python
Last synced: about 2 months ago
JSON representation
Copernicus In Situ Component Information System
- Host: GitHub
- URL: https://github.com/eea/copernicus-insitu-db
- Owner: eea
- License: gpl-3.0
- Created: 2017-05-16T09:56:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T14:32:31.000Z (10 months ago)
- Last Synced: 2024-04-11T13:00:18.237Z (9 months ago)
- Topics: copernicus, datatables, django, docker, elasticsearch, python
- Language: Python
- Homepage:
- Size: 13.5 MB
- Stars: 8
- Watchers: 38
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Copernicus In Situ Component Information System
The Copernicus In-Situ Coordination (GISC) project aimed at linking in-situ data providers and Copernicus service providers to ensure access to in-situ data for Copernicus services.
The application provides up-to-date information across the
Copernicus services on in situ data requirements (current and expected), data used, gaps, data providers, access arrangements, and partnerships.![Build](https://github.com/eea/copernicus-insitu-db/workflows/CI/badge.svg)
[![Coverage](https://coveralls.io/repos/github/eea/copernicus-insitu-db/badge.svg?branch=master)](https://coveralls.io/github/eea/copernicus-insitu-db?branch=master)
[![Docker build](https://img.shields.io/docker/automated/eeacms/copernicus-insitu-db)](https://hub.docker.com/r/eeacms/copernicus-insitu-db)
[![Docker latest version](https://img.shields.io/docker/v/eeacms/copernicus-insitu-db)]()## Prerequisites
* Install [Docker](https://docs.docker.com/engine/installation/)
* Install [Docker Compose](https://docs.docker.com/compose/install/)### Installing the application
1. Get the source code:
git clone https://github.com/eea/copernicus-insitu-db.git
cd copernicus-insitu-db1. Start application stack:
docker-compose up -d
docker-compose ps1. Run migrations, create superuser:
docker exec -it insitu.app sh
python manage.py migrate
python manage.py createsuperuser1. Create read-only db user for explorer using the information from **docker/init_explorer_db.sql**
1. Create SQL views:
docker cp docker/create_views.sql insitu.db:create_views.sql
docker exec -it insitu.db bash
psql -U [psql_username] [psql_database] < create_views.sql1. Create elasticsearch index and start the development server:
python manage.py search_index -f --rebuild
python manage.py runserver 0.0.0.0:80001. Run tests:
docker exec -it insitu.app sh
python manage.py test --settings=copernicus.test_settings1. Check coverage:
docker exec -it insitu.app sh
coverage run --source='.' ./manage.py test --settings=copernicus.test_settings
python coverage html1. See it in action:
### Upgrading the application
1. Get the latest version of source code:
cd copernicus-insitu-db
git pull origin master1. Update the application stack, all services should be "Up":
docker-compose pull
docker-compose up -d
docker-compose ps1. See it in action:
### Debugging
Customize docker orchestration for local development:
cp docker-compose.override.yml.example docker-compose.override.yml
* Please make sure that `DEBUG = True` in the settings.
* Update docker-compose.override.yml file `app` section with the following so that `docker-entrypoint.sh` is not executed:
entrypoint: ["/usr/bin/tail", "-f", "/dev/null"]
* Attach to docker container and start the server in debug mode:
docker exec -it insitu.app sh
python manage.py runserver 0.0.0.0:8000* See it in action:
## Set User roles
* Read-Only User
- create a new regular user and add the user group "ReadOnly"
* ProductEditor
- create a new regular user and add the user group "ProductEditor"
* PicklistsEditor
- create a new staff user and add the user group "PicklistsEditor"## Ubuntu elasticsearch container error
* If your host runs ubuntu your elasticsearch container may fail to run with the error "bootstrap checks failed". This happens because max map count is set under the value __262144__
* You can fix this temporarily(till you restart your machine) by running:sudo sysctl -w vm.max_map_count=262144
* You can fix this permanently by modifying your max_map_count file:
sudo vim /proc/sys/vm/max_map_count
# Change the value from the file with 262144 and save# Save to fixtures explorer queries
python manage.py dumpdata explorer.query > explorer.json
To install
# Generate Sphinx documentationcd docs/
make htmlAfter the documentation has changed, a new PDF file should be generated and it should replace the current file.
docker exec -it insitu.app sh
apk add texlive-full
cd docs/
make latexpdf
cp _build/latex/CIS2.pdf ../insitu/static/docs/CIS2.pdf