openfisca / openfisca-ops

Scripts and config files for deploying OpenFisca on a server
MIT License
1 stars 1 forks source link

Ansible configuration for web APIs services uses a Python version behind OpenFisca reference version #125

Closed sandcha closed 5 months ago

sandcha commented 1 year ago

The ansible configuration installs Python 3.7 for the web API services (demo and France) while openfisca-core now needs Python 3.9+.

Should we update to Python 3.9 or a newer revision? openfisca-core library is compatible with Python 3.9, 3.10 and 3.11. So we have multiple options: 1️⃣ Use Python 3.9 on our server to check if the web API is still working as expected for users with older systems. 2️⃣ Use Python 3.10.6 as it's the current Python version used to test the library in the CI (the CI can use multiple versions so, we can choose to set our server default Python revision to the latest Python used in the CI). 3️⃣ Use Python 3.11 on our server to check that the web API works as expected in production with the latest Python version supported by openfisca-core.

Can we keep Python 3.7 for some time on our server? No. openfisca-core now needs numpy >=1.24.2, <1.25 and numpy 1.24 documentation says: "This release supports Python versions 3.8-3.11.". So, using the web API with Python 3.7 might raise some issues with the /calculate endpoint.

So, we move to Python 3.9/3.10 or 3.11 in ansible configuration and that's it? We detected performance issues when we updated the Python version to 3.9+. Some fixes have been merged like https://github.com/openfisca/openfisca-core/pull/1188 and https://github.com/openfisca/openfisca-core/pull/1189 but we might need to check the response time of the demo/fr web API on the server.

MattiSG commented 1 year ago

Thanks @sandcha for this clear recap!

I am clearly in favour of 3️⃣ and upgrading to the latest supported version of Python, in order to minimise maintenance on the infrastructure for later upgrades.

MattiSG commented 5 months ago

Fixed by https://github.com/openfisca/openfisca-ops/pull/126.