berkeley-dsep-infra / hubploy

Toolkit to deploy many z2jh based JupyterHubs
BSD 3-Clause "New" or "Revised" License
17 stars 15 forks source link

Authenticator Updates (with special attention to AWS) #48

Closed salvis2 closed 4 years ago

salvis2 commented 4 years ago

The functions in auth.py have been changed to become context managers to allow only temporary access to credential file locations. The only functions that were changed significantly were the AWS-related ones, which now set and unset the AWS_SHARED_CREDENTIALS_FILE environment variable with os.environ[].

__main__.py has changed to reflect the fact that auth.py's functions are now context managers. I moved the if statement

if args.push or args.check_registry:

from __main__.py to registry_auth() in auth.py so that the context manager is always entered. Now, if the if statement isn't passed, the function doesn't do anything, so it should be functionally the same as before.

Resolves #44 and generally treats the AWS credentials files more appropriately.

salvis2 commented 4 years ago

I tested the setup on my AWS test cluster. Don't have access to / experience with anything GCP. Will make these changes and test again before adding more commits.

yuvipanda commented 4 years ago

Thanks a lot, @salvis2!

tjcrone commented 4 years ago

Unfortunately it looks like this merge broke things for us over at Pangeo (https://github.com/pangeo-data/pangeo-cloud-federation/issues/533). We rolled back to a previous version of hubploy to get things working. Happy to help and/or test updates here to see if we can get things fixed. Thanks!

salvis2 commented 4 years ago

Sorry @tjcrone . Looking more closely at my fork, I can see that my GitHub build action failed. I should be examining that even if I'm not using the CI/CD part of hubploy yet. I should be able to work on fixes this week as well.