From 57e1341738798eab6e3aa54b2433a3ca1b36b297 Mon Sep 17 00:00:00 2001 From: <> Date: Thu, 26 Dec 2024 11:05:46 +0000 Subject: [PATCH] Deployed 21aab5253 with MkDocs version: 1.5.2 --- .../iaso_concepts/iaso_concepts.html | 137 ++++++++++++- search/search_index.json | 2 +- sitemap.xml | 188 +++++++++--------- sitemap.xml.gz | Bin 1903 -> 1903 bytes 4 files changed, 227 insertions(+), 100 deletions(-) diff --git a/fr/pages/users/reference/iaso_concepts/iaso_concepts.html b/fr/pages/users/reference/iaso_concepts/iaso_concepts.html index 83dd309985..d69d6b5526 100644 --- a/fr/pages/users/reference/iaso_concepts/iaso_concepts.html +++ b/fr/pages/users/reference/iaso_concepts/iaso_concepts.html @@ -321,10 +321,57 @@ @@ -749,10 +796,57 @@ @@ -780,7 +874,40 @@

Concepts#

-

Traduction française bientôt disponible#

+

Formulaires de collecte de données XLS#

+

La collecte de données implique des questions, et pour organiser ces questions, des formulaires de collecte de données. Ils se composent de questions pour lesquelles on souhaite collecter des réponses, tout en spécifiant des options (obligatoires ou non, saut d'une question en fonction d'une réponse précédente, etc.).\ +IASO utilise les XLS forms pour ses questionnaires, qui sont donc prédéfinis à l'aide d'un fichier Excel.

+

Dans IASO, les formulaires de collecte de données sont versionnés, ce qui signifie qu'à chaque fois qu'une nouvelle version est créée, l'ancienne version est conservée et reste disponible dans le système. Il est possible d'y revenir aisément.

+

Unités d'organisation#

+

IASO utilise la notion d'Unités Od'organisation (Org unit ou OU) pour gérer les données géographiques.\ +Les types d'unité d'organisation (OUT) représentent les niveaux dans la hiérarchie.

+

Exemple :#

+ +

Les unités d'organisation sont classées dans la pyramide selon un parent et un ou plusieurs enfants (sauf les parents au sommet et les enfants au bas de la hiérarchie).

+

Exemple ci-dessous :#

+ +

La collecte de données dans IASO est structurée selon la hiérarchie définie, et chaque utilisateur doit explicitement sélectionner une unité d'organisation avant d'ouvrir le questionnaire et de répondre aux questions. Cela garantit que les données collectées sont correctement associées à la géographie pertinente.

+

Projets#

+

Dans IASO, un Projet est lié à une instance d'application mobile, avec son propre ID d'application (ou "App ID"). Au sein d'un même compte IASO, vous pouvez avoir un ou plusieurs Projet(s) avec différentes options de fonctionnalités.\ +Les utilisateurs peuvent être liés à un ou plusieurs Projet(s).

+

À savoir :#

+ diff --git a/search/search_index.json b/search/search_index.json index 1c3464e7d2..c6641d7999 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en","fr"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"AWS-Deployment.html","title":"How Iaso is deployed on AWS","text":"

on ElasticBeanstalk + RDS

"},{"location":"AWS-Deployment.html#main-parts","title":"Main parts","text":""},{"location":"AWS-Deployment.html#host-infrastructure","title":"Host infrastructure","text":"

This documentation concerned the main Iaso deployment, that are done on AWS.

The main pillar is AWS Elastic beanstalk

Which is kind of a magic solution from Amazon that tie several of their service together, handle deployment logic, etc...

In the past we configured it by hands but now we are moving toward having it all handled via Terrraform so it is in code (we can have an history, avoid misclick, do complex ops etc...).

The technical term for this is \"Provisioning\" if you want to look it up.

"},{"location":"AWS-Deployment.html#setup-of-the-elastic-beainstalk","title":"Setup of the Elastic Beainstalk","text":"

See https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

We have custom commands and configuration in .ebextensions/ and in and in .platform/ to extend the nginx config.

"},{"location":"AWS-Deployment.html#running-django-3-on-elastic-beanstalk-custom-ami","title":"Running Django 3 on Elastic Beanstalk / Custom AMI","text":"

Django 3 requires version 2+ of the gdal library. Sadly, Beanstalk is based on Amazon Linux that contain an outdated version of GDAL.

To fix this you have to create a custom AMI to use in your Elastic Beanstalk environments and compile and your own version of gdal and it's dependencies.

See the AWS documentation on creating adn using a custom AMI and the Django documentation on compiling the GIS libraries

Custom build of the following libraries were done:

You can check scripts/create_ami.sh for reference

Read AWS documentation on creating adn using a custom AMI but in summary:

  1. In EC2 -> AMIs, identify the AMI of the Elastic Beanstalk EC2 server(Ex: Choose a public AMI in which python3.9 installed with Amazon Linux 2).
  2. Select the AMI and launch a new instance based on it.
  3. Specify the instance name and choose a key pair.
  4. Don't forget to set in the advanced section:
#cloud-config\n  repo_releasever: repository version number\n  repo_upgrade: none\n
  1. Connect via SSH to the instance
  2. Install the dependencies (see scripts/create_ami.sh)
  3. Then go to Actions -> Image -> Create Image
  4. When it's ready, go to the Beanstalk Instance Settings and specify the AMI reference of the image we just created.
"},{"location":"AWS-Deployment.html#where-is-the-code","title":"Where is the code ?","text":"

Infrastructure and configuration in the Github repository BLSQ/terraform-iaso-eb There is good documentation from Mbayang in the docs/ folder. Visibility is restricted.

In the BLSQ/iaso Github repository: * .github For the workflow info * scripts/ * .ebextension For the Elastic beanstalk specific command * .platform Configuration override

"},{"location":"AWS-Deployment.html#related-services","title":"Related services","text":"

Two type of env in elastic beanstalk: * web * worker

We tie them via an \"env\" tag in AWS, so we can deploy them at the same time

One Elastic Beanstalk Env can contain multipe \"EC2 Instance\", that is virtual machine server. Their number auto scale according to rule in elastic beanstalk. Usually we have 1 instance for Worker and 2 for Web.

"},{"location":"AWS-Deployment.html#s3-bucket","title":"S3 bucket","text":"

Static are readable by all.

Media are only accessible via Signed url that expire after a laps of time (15 minutes I think) and that are generated on the fly by iaso when needed.

"},{"location":"AWS-Deployment.html#cicd","title":"CI/CD","text":"

Deployment of new version is done via Github action.

Each change on main are automically deployed on the staging environment

Deployment to other env have to be manually triggered

"},{"location":"AWS-Deployment.html#deployement-process","title":"Deployement process","text":"

How a new version of Iaso is deployed

This is a simplified view, some details are omitted for clarity

  1. A user trigger the deploy worflow in github actions (or it is trigger automatically for staging)
  2. In the github worker: (code in .github/workflows/deploy.yml)
    1. Determine version number. Call set_version to set it.
    2. It build all the JS/CSS and other ressource for the front-end
    3. Add the to the git repo
    4. scripts/eb-deploy.py:
      1. Connect to the AWS api to fetch all the beanstalk environments for the iaso environment. e.g. : staging -> iaso-staging2 and iaso-staging2-worker
      2. For each beanstalk env, trigger eb deploy (from awseb cli):
        1. Make a zip file of the content of the git repo (done by eb deploy). Including the compiled asset
        2. Call ElasticBeanstalk API to deploy it
  3. In the Iaso servers (EC2 instances): Our code/config for this is in the directory .ebextensions Action markqe with \u00a5 are part of Elastic beanstalk logic
    1. Deployment is triggered \u00a5
    2. New app version is copied in /var/app/staging \u00a5
    3. The dependencies in requirements.txt are installed \u00a5
    4. Our logic is executed
      1. Server translations are compiled
      2. The frontend (compiled JS, image, css) is pushed to the S3 bucket.
      3. Database migration are done
      4. Cache table is created
    5. /var/app/staging is moved in /var/app/current \u00a5
    6. If these steps fail, Elastic beanstalk will do a rollback and revert to the previous version. Note since we do manually the maching between worker and web, sometime we have the problem that one is rolled back and not the other and we have a version mismatch. We sometime also have the problem with incompatible database migrations. \u00a5
    7. Send a Slack notification to notify of the success of failure of the github deployment.
"},{"location":"AWS-Deployment.html#related-services-in-more-details","title":"Related services in more details","text":""},{"location":"AWS-Deployment.html#enketo","title":"Enketo","text":"

Deployed separately, handled via Elastic Beanstalk also, linked to Iaso via environment variable. Mbayang manage this

"},{"location":"AWS-Deployment.html#aws-sqs","title":"AWS SQS","text":"

Queue system used for Worker, see worker section in README

"},{"location":"AWS-Deployment.html#s3-bucket_1","title":"S3 bucket","text":"

S3 see above

"},{"location":"AWS-Deployment.html#architecture-inside-the-vm","title":"Architecture inside the VM","text":"

Code is in the /var/app/current

Systemctl launch the web server as the web unit. This is done via Gunicorn under the web user, gunicorn launch multiple Django server.

There is a NGINX in front of gunicorn. The above is handled automatically via Iaso

The logs can be listed inside the VM via journalctl -u web

We have 2 crons (for now). They can be seen by using systemctl list-timers

"},{"location":"index.html","title":"Welcome to the documentation of IASO","text":""},{"location":"index.html#introduction-to-iaso","title":"Introduction to IASO","text":"

IASO is an innovative, open-source, bilingual (EN/FR) data collection platform with advanced geospatial features to plan, monitor and evaluate health, environmental or social programmes in low- and middle-income settings (LMICs). IASO is recognized as a Digital Public Good by the Digital Public Good Alliance and listed as a Digital Square Software Global Good, a testament to its proven impact. For more information and detailed use cases, please visit IASO website.

IASO comprises:

In terms of features, IASO can be summarized around four main components which are interconnected and expand the powers of one another:

The platform has been implemented in Benin, Burkina Faso, Burundi, Cameroon, Central African Republic, the Democratic Republic of Congo, Haiti, Ivory Coast, Mali, Niger, Nigeria and Uganda. It is the official georegistry in Burkina Faso since 2023. IASO has also been implemented at regional level (AFRO region) in support to the Global Polio Eradication Initiative for its geospatial and health facility registries capabilities.

"},{"location":"index.html#technical-stack","title":"Technical stack","text":"

IASO is made of a white labeled Android application using Java/Kotlin, reusing large parts of the ODK projects, and a web platform programmed using Python/GeoDjango on top of PostGIS. Frontend is mainly React/Leaflet. The API is implemented via Django rest framework, all data is stored in Postgresql or the media/ directory. One of the aims is the ease of integration with other platforms. We already have csv and geopackage imports and exports and target easy integration with OSM.

The companion mobile app for Android allows form submission and and org unit creation. Forms can also be filled in a web interface via the Enketo companion service.

"},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html","title":"How to add a new permission in Iaso","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#1-add-permission-in-the-model","title":"1. Add permission in the model","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#2-include-the-permission-in-a-module","title":"2. Include the permission in a module","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#3-include-the-permission-in-the-corresponding-group","title":"3. Include the permission in the corresponding group","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#4-if-the-added-permission-must-be-coupled-with-another-permission-like-read-and-edit","title":"4. If the added permission must be coupled with another permission like read and edit","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#5-make-and-run-migration","title":"5. Make and run migration","text":"

docker compose run --rm iaso manage makemigrations && docker compose run --rm iaso manage migrate

"},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#6-add-the-permission-in-the-front-end","title":"6. Add the permission in the front-end","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#7-add-translations-in-the-front-end","title":"7. Add translations in the front-end","text":""},{"location":"pages/dev/how_to/add_new_permission/add_new_permission.html#8-add-translation-for-new-module-if-applicable","title":"8. Add translation for new module (if applicable)","text":"