openforis / sepal_ui

wrapper for ipyvuetify widgets to unify the display of voila dashboards in the SEPAL plateform
https://map-app.up.railway.app
MIT License
12 stars 3 forks source link

Update to the new GEE authentication process #904

Closed dfguerrerom closed 1 month ago

dfguerrerom commented 8 months ago

I'm opening this issue for future reference.

Newer sepal_ui installations will install the latest earthengine-api version which now requires to set a default project to work with.

With this version, the legacy assets are not longer reachable through getAssetRoots() and I haven't found a way to get them. There is no need to create a home folder, the default folder is projects/{project}/assets/.

We should update:

12rambau commented 7 months ago

I worked on a pytest-gee pytest plugin for this very purpose, I guess sepal-ui could rely on it for the test suit. The difficult part is to ensure it works for both local and distant build.

Side note, I will create a dedicated project as suggested by google people so we are not charged when the testes are run.

dfguerrerom commented 6 months ago

I dont't see any reference to the new project structure in https://github.com/gee-community/pytest-gee/tree/main, I was working on some changes in https://github.com/12rambau/sepal_ui/pull/905 but the sepal_ui tests failed because of https://github.com/12rambau/sepal_ui/pull/905#issuecomment-1934733285, would you mind checking that comment?

12rambau commented 6 months ago

I just published a new release of pytest-gee that include modifications to match the new project base EE init process. I also set up the different environment variables needed to make it work.

I don't have much time to dedicate to sepal-ui right now, could you adapt the test code so that it rely on pytest-gee ?

dfguerrerom commented 6 months ago

I just published a new release of pytest-gee that include modifications to match the new project base EE init process. I also set up the different environment variables needed to make it work.

I don't have much time to dedicate to sepal-ui right now, could you adapt the test code so that it rely on pytest-gee ?

The idea of having a pytest- plugin is no so clear to me... to do this integration, do you advice to import pytest-gee as a module and doing the authentication process trhough it?, so replace our init_gee with either method available in this new package?

I'm trying to understand what is a pytest plugin, I hope you can give me an advice.

12rambau commented 6 months ago

oh no, ptest-gee is just for pytest itself. It was extremely enoying to find a proper way to test GEE related packages (and I start to have a decent number of them) so the plugin is simply a wrapper of what we did in sepal_ui in the past. It should only be used for tests.

it remains compatible with the init_ee decorator becasue the first step of it is checking if a user is already connected. so outside of tests you'll see errrors if you forget to Init, in tests you will see nothing as everything get initialized in the conftest.py

dfguerrerom commented 1 month ago

fixed wtih https://github.com/openforis/sepal_ui/pull/915