-
Notifications
You must be signed in to change notification settings - Fork 2
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
Python AWS commands #4
Comments
That's a good idea. I think some of the notebooks already have this (e.g. the spectral fit and extended source fit NBs). Specifically, they have the wasabi terminal commands wrapped in an |
Since I saw I could do Maybe we can add a common wrapper function like this: import subprocess, os
def download_wasabi_file(file, output = None):
if output is None:
output = file.split('/')[-1]
subprocess.run('aws', 's3api', 'get-object', '--bucket', 'cosi-pipeline-public', '--key', file, '--endpoint-url=https://s3.us-west-1.wasabisys.com', output],
env = os.environ.copy() | {'AWS_ACCESS_KEY_ID':'GBAL6XATQZNRV3GFH9Y4', 'AWS_SECRET_ACCESS_KEY':'GToOczY5hGX3sketNO2fUwiq4DJoewzIgvTCHoOv'}) I just tried to test it but Wasabi doesn't seem responsive right now :( |
That's not a bad idea. Yeah, wasabi can be spotty sometimes. |
A suggestion relevant to this discussion: could you add the following to the tutorial notebooks
|
Thanks for the suggestions, @avalluvan. Yes, we can add the file size. Sure, the |
I added the function here: cositools/cosipy#141 @ckarwin Can you please review and merge? |
Great, thanks @israelmcmc! I tested it and left some comments in the PR. |
The new utility function has been merged into the main branch. I'll wait until all the notebooks have been updated before closing this issue. |
Sounds good. Thanks, @ckarwin |
This issue can be closed now. All notebooks have been updates. |
I’ve been thinking about adding a cell on each Jupyter NB that downloads all the files needed to run the NB. I think it can be done with the awscli library (installed already by cosipy). I’ll look into that since it’s been a common problem reported by many people
The text was updated successfully, but these errors were encountered: