Skip to content
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

Update to the new GEE authentication process #904

Closed
dfguerrerom opened this issue Jan 4, 2024 · 6 comments
Closed

Update to the new GEE authentication process #904

dfguerrerom opened this issue Jan 4, 2024 · 6 comments

Comments

@dfguerrerom
Copy link
Collaborator

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:

  • gee folder references
  • init_ee function
@dfguerrerom dfguerrerom self-assigned this Jan 4, 2024
@dfguerrerom dfguerrerom removed their assignment Jan 4, 2024
@12rambau
Copy link
Member

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
Copy link
Collaborator Author

dfguerrerom commented Feb 13, 2024

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 #905 but the sepal_ui tests failed because of #905 (comment), would you mind checking that comment?

@12rambau
Copy link
Member

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
Copy link
Collaborator Author

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
Copy link
Member

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
Copy link
Collaborator Author

fixed wtih #915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants