-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🪄 Passage à Poetry pour la gestion des dépendances #1219
base: main
Are you sure you want to change the base?
Conversation
b2fd62f
to
62fbec4
Compare
83b32aa
to
d50bdc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK donc si je comprends bien:
CI
: on préfixe les commandes de build avec poetry (pour que poetry charge son environnement et éxecute ce qui suit)poetry.toml
: conf de base poetrypyproject.toml
: c'est maintenant là qu'on vient définir les différents requirements*requirements.in/txt
: tout ça dégage 🥳Dockerfile
: petites modifs pour intégrer poetry
J'ai manqué un truc important?
Peux-tu stp faire un résumé des commandes à utiliser au quotidien? (le workflow standard)
d3dc731
to
42b9fc4
Compare
a634c95
to
5e45cc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Airflow ne trouve pas gdal
Broken DAG: [/opt/airflow/dags/cluster/tasks/business_logic/misc/df_sort.py]
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.12/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 10, in <module>
from django.contrib.gis.gdal.libgdal import lgdal
File "/home/airflow/.local/lib/python3.12/site-packages/django/contrib/gis/gdal/libgdal.py", line 62, in <module>
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal3.8.0", "gdal3.7.0", "gdal3.6.0", "gdal3.5.0", "gdal3.4.0", "gdal3.3.0", "gdal3.2.0", "gdal3.1.0", "gdal3.0.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.
expand_more
airflow-scheduler.Dockerfile
Outdated
# TODO: could be moved to the builder at some point. | ||
USER root | ||
WORKDIR /opt/aws | ||
COPY --from=builder /opt/aws/ . | ||
RUN ./install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je pense qu'on plus besoin de AWS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Après résolution du Pb GDAL, j'ai un autre pb python
Broken DAG: [/opt/airflow/dags/cluster/dags/cluster_acteurs_suggestions.py]
Traceback (most recent call last):
File "/opt/airflow/qfdmo/models/acteur.py", line 39, in <module>
from qfdmo.models.action import Action, get_action_instances
File "/opt/airflow/qfdmo/models/action.py", line 11, in <module>
from dsfr_hacks.colors import DSFRColors
ModuleNotFoundError: No module named 'dsfr_hacks'
af42ca3
to
e83aa79
Compare
e83aa79
to
465c9d3
Compare
Description succincte du problème résolu
https://www.notion.so/accelerateur-transition-ecologique-ademe/La-gestion-des-d-pendances-ne-semble-pas-optimale-1596523d57d7807a91b7d9eaa85ff139?pvs=4
Ça tourne sur https://dashboard.scalingo.com/apps/osc-fr1/quefairedemesobjets-preprod/deploy/baf37131-258f-4af8-a506-b1c023c58ac7
Utilisation de Poetry ✍️
Désormais toutes les installations de dépendance, gestion d'environnement virtuel, déploiements passent par poetry.
Intérêt (voir https://www.notion.so/accelerateur-transition-ecologique-ademe/Synchronisation-des-Techos-1756523d57d78090be2df64e55e29142?pvs=4#17c6523d57d780b8a399cab5b559beb0)
Dependabot 🤖
à tester sur le moyen / long terme, mais je crois que dependabot va uniquement mettre à jour le poetry.lock.
On est donc pas exemptés de mettre à jour les versions majeures manuellement dans le pyproject si on souhaite fixer une version spécifique.
CI 🏗️
Tout est fonctionnel et testé
Déploiements 🚀
Scalingo supporte les poetry.lock, j'ai testé un déploiement en staging et on est bon ! 🎉
Docker 🐳
J'en ai profité pour assainir les dockerfile :
awscli
On copie le contenu de chaque étape de build dans le runtime.
Les avantages
En local
Idéalement il faudrait que vous réinitialisiez votre environnement local pour qu'on soit sûr de l'absence d'effets de bords
TODO
Type de changement :
Auto-review
Les trucs à faire avant de demander une review :
.env.template