-
Notifications
You must be signed in to change notification settings - Fork 0
CMS Installation
The Mukau CMS hosts the Mukau East Africa drought observatory pages. Mukau Drought Observatory is a near-real time system that uses Earth Observation and Weather information to monitor drought conditions in the East Africa region. The Mukau pages contain drought-relevant information such as maps of indicators derived from different data sources (e.g., precipitation measurements, satellite measurements, modelled soil moisture content). Different tools, like Graphs and Compare Layers, allow for displaying and analysing the information and drought reports give an overview of the situation in case of imminent droughts.
It uses a Wagtail based content management system to manage all the content for its website. Wagtail is an open-source CMS written in Python and built on the Django framework. For indepth detail about the Mukau CMS go to Content Management System Documentation CMS .
This section describes the installation steps for the Mukau CMS component as a standalone. It also describes the steps inorder to push any changes made to the Mukau entrypoint.
In order to install Mukau, the following softwares need to be installed first:
Mukau requires docker in order to function. Follow these instructions to install docker on Windows, and these instructions to install docker on Mac OS. If you are running Linux, follow the instructions on this page that are appropriate for the Linux distribution you are using.
- Introduction
- Installation
- Deploy Latest Development (Local) updates to Staging/Production
- Other Commands
The Mukau CMS hosts the Mukau East Africa drought observatory pages. Mukau Drought Observatory is a near-real time system that uses Earth Observation and Weather information to monitor drought conditions in the East Africa region. The Mukau pages contain drought-relevant information such as maps of indicators derived from different data sources (e.g., precipitation measurements, satellite measurements, modelled soil moisture content). Different tools, like Graphs and Compare Layers, allow for displaying and analysing the information and drought reports give an overview of the situation in case of imminent droughts.
THe system is a service developed as part of the Intra-ACP Climate Services Project in collaboration with the Drought Unit at the Joint Research Centre of the European Commision. THe system is an adaptation of the European Drought Observatory (EDO) adapted to the conditions in the East Africa region.
git clone https://github.com/icpac-igad/mukau-cms.gitTo create a .env file at the root of the project execute:
cp .env.sample .envThe .env file expects the following Environment Variables:
| Variable | Description |
|---|---|
| PROTOCOL | e.g http, https |
| HOST_IP | IP address eg. 127.0.0.1 |
| POSTGRES_USER_CMS | cms postgres user |
| POSTGRES_DB_CMS | cms database name |
| POSTGRES_HOST_CMS | host for cms postgres |
| POSTGRES_PASSWORD_CMS | password for the postgres cms database |
| POSTGRES_PORT_CMS | cms postgres port |
| CMS_PORT | port the cms will run on |
| DATABASE | set to postgres |
| RECAPTCHA_PUBLIC_KEY | |
| RECAPTCHA_PRIVATE_KEY | |
| WEB_IMAGE_URI | The web production image to use. This should be the URI to the image on a local or remote private registry, with the version tag e.g localhost:5000/mukau-cms:1.0 |
You can view the available tags for mukau-cms image at https://eahazardswatch.icpac.net/v2/mukau-cms/tags/list. This requires authentication.
At the root of mukau-cms execute,
cp .env.prod.db.sample .env.prod.dbThe .env.prod.db file is utilized by mukau_cms_db container in the docker-compose.yml file and expects the following Environmental Variables. N.B These variables should match with those specified in the env.prod file
POSTGRES_DB=>
POSTGRES_USER=>
POSTGRES_PASSWORD=>
To build the docker image, run:
sudo docker-compose buildsudo docker-compose up -dsudo docker-compose exec mukau_cms_web web python manage.py migratesudo docker-compose exec mukau_cms_web python manage.py loaddata datadump.jsonThe application should now be running at http:<ip_address>:<CMS_PORT>
The CMS Admin interface can be accessed at http:<ip_address>:<CMS_PORT>/admin. Default credentials are:
Username: admin
Password: mukau@cms
Change the WEB_IMAGE_URI tag version in the .env file to a higher version. The convension used is that version numbers ending in an odd number (for example 1.1) are development versions, while versions ending in an even number (for example (1.2) are release versions.
For example, set this variable in the production .env:
WEB_IMAGE_URI=localhost:5000/mukau-cms:1.0To build the docker image, run:
sudo docker-compose -f docker-compose-dev.yml buildMirror local tag (MUKAU-GEOCMS) with the remote tag(MUKAU-DOCKER).
sudo docker tag <local_tag> <remote_tag>For example:
sudo docker tag localhost:5000/mukau-cms:1.0 eahazardswatch.icpac.net/mukau-cms:1.0 Next, login to the eahazardswatch.icpac.net registry, execute the command below and provide appropriate credentials.
sudo docker login eahazardswatch.icpac.netPush the new image to the private registry, run:
sudo docker push <remote_tag>For example,
sudo docker push eahazardswatch.icpac.net/mukau-cms:1.0 To view the status of the database, run:
sudo docker logs mukau_cms_db -f
To view the status of the mukau_cms_web app, run:
sudo docker logs mukau_cms_web -f
To update the application, for example after changing the WEB_IMAGE_URI variable in .env file just run again:
sudo docker-compose stopthen
sudo docker-compose upTo stop and remove everything including volumes run (reset). NOTE: This will result in lose of any data save to the database
sudo docker-compose down --volumesdocker exec -it <DB_CONTAINER> psql -U <DB_USER> <DB_NAME>
sudo docker exec -it <DB_CONTAINER> pg_dump -U <DB_USER> -t <DB_TABLE> <DB_NAME> > 'path_to_ouput.sql'docker exec -t <DB_CONTAINER> pg_dumpall -c -U <DB_USER> | gzip > ./tmp/dump_$(date +"%Y-%m-%d_%H_%M_%S").gzgunzip < your_dump.sql.gz | docker exec -i <DB_CONTAINER> psql -U <DB_USER> -d <DB_NAME>Access to the running container (mukau_cms_web or any container name, the one defined in docker-compose.yml)
docker exec -it <CONTAINER> bash