Rex Dri issueshttps://gitlab.utc.fr/rex-dri/rex-dri/-/issues2019-06-30T16:23:30Zhttps://gitlab.utc.fr/rex-dri/rex-dri/-/issues/28Handling of automatic data update2019-06-30T16:23:30ZFlorent ChehabHandling of automatic data update# :warning: **Never ever commit any ID or data from the UTC DB** :warning:
## UTC Data
UTC data is hosted on an Oracle database.
### Step 1
* [x] ~~Create a new django app in the folder `interface_UTC` (at the root of the repo).~~ ...# :warning: **Never ever commit any ID or data from the UTC DB** :warning:
## UTC Data
UTC data is hosted on an Oracle database.
### Step 1
* [x] ~~Create a new django app in the folder `interface_UTC` (at the root of the repo).~~ (will be done in Java)
* [x] The app should connect to the UTC DB and convert the 4 views to JSON arrays,
* [x] This app must advertise one endpoint for each view,
* [x] The app must advertise other endpoints that accept a login as parameter:
* [x] to check what are the sharing permissions associated with a student
* [x] to get all the departures information for a student
* So that we don't have to fetch all the data when there is a permission change.
* [x] The app must be documented, consistent (error code) and resilient,
* [x] All endpoints will be readonly.
### Step 2
* [x] Create a mock of this new API so that we can easily use it in a dev environment.
* [x] Don't commit any personal data,
* [x] You can use a local database (of your choice) to hold the dev data,
* [x] All the mock data should be of the form of (commited) SQL scripts,
* [x] You should update the `docker-compose` file with the new service(s).
### Step 3
* [x] Create the python scripts to handle the transfer of the data from the API created above into Django models.
* [x] Those scripts should be runnable on demand.
* [x] Put them in a sub-application of the `backend` called `data_exchange`
## Currency exchange rate
* [x] Handle the connection to Fixer API to retrieve the exchange rates (directly from `data_exchange`)
* [x] Handle the update of the data in the model
* [x] Make it resilient.
## Both
* [x] Investigate the use of Cron (inside the backend docker container) to have an automated daily data update.
https://uwsgi-docs.readthedocs.io/en/latest/PythonDecorators.html
## Finally
- [x] Create a backend model / and frontend page, to show when where the latest update / the number of errors; so that anyone can see if the system is healthy at any point in time.
- [x] Also run clearsessions and delete user in the cron
:tada: PR nextAlexandre LanceartAlexandre Lancearthttps://gitlab.utc.fr/rex-dri/rex-dri/-/issues/32Ask the student to give the information of the course language when evaluating2019-06-27T20:03:58ZFlorent ChehabAsk the student to give the information of the course language when evaluatingAllow up to two languages per course (one might be null).
Following #29
This information might be used to search universities by teaching language at some point.
Linked to #116
Allow up to two languages per course (one might be null).
Following #29
This information might be used to search universities by teaching language at some point.
Linked to #116
PR nextSegolene BrisemeurSegolene Brisemeurhttps://gitlab.utc.fr/rex-dri/rex-dri/-/issues/66Create docker-compose config for deploy2019-05-25T12:07:18ZFlorent ChehabCreate docker-compose config for deploy# Description
* [x] Create a new `docker-compose` file (`docker-compose.prod.yml`) (at the root of the project), to be used in the production environment,
* [x] It should make use of the `Dockerfile` we already have for the backend,
*...# Description
* [x] Create a new `docker-compose` file (`docker-compose.prod.yml`) (at the root of the project), to be used in the production environment,
* [x] It should make use of the `Dockerfile` we already have for the backend,
* [x] For the frontend, it should be built (with production settings: `npm run build`) on startup, and then container will not be required. You can reuse what we currently have.
* [x] All client requests should go through an Nginx container
* [x] Nginx should be configured to serve the static files properly (with `gzip` configuration if possible)
* [x] The Django app should be through Uwsgi with 4 workers (for now)
* [x] The database stays the same,
* [x] You should have one persistent volume for the database (just like currently)
* [x] Only nginx (exposed on port 80) must be visible from outside; you can make use of private network where it makes sense.
**Env variables:**
Env variables are used to contain all IDs / very short configuration.
* [x] Create a dev.env file with all the current env variables set in `docker-compose.yml`
* [x] Update `docker-compose.yml` to make use of this file.
* [x] Create a prod.env file (**and add it to `.gitignore`) that will hold the production IDs (we will set the values later; it should have all the same entries as dev.env, with different values).
**Configuration files:**
You might need to create configuration files for nginx & uwsgi. Put them in a folder `prod_conf` at the root of the repo. You can then map them as dynamic volumes in `docker-compose`.
You might want to create different env files for the different aspect of the app and not to share all IDs in all containers. If so, put them in other `.env` files in `prod_conf`.
NB: no django migrations should be applied automatically.
# Other
* [x] Make sure django is configured properly (`allowed_host`, etc.)
# Conclusion
**The app should be up and running with production settings with a simple `docker-compose up --build --file docker-compose.prod.yml`**
## Documentation
* [x] Make sure to document (in the documentation) the exact steps required to put the app in production (all the commands and files to edit).
## TODO
* [x] Handle logging properly
* [x] Find a workaround for node_modules assets not being present if no `npm i` or needed to map them from the image (beurk)PR nextFlorent ChehabFlorent Chehab