aaronwmorris / indi-allsky

Software to manage a Linux-based All Sky Camera.
GNU General Public License v3.0
216 stars 35 forks source link

Google Cloud Platform - Google Storage Bucket - image storage (same as AWS) #1127

Closed gaitskell closed 4 months ago

gaitskell commented 6 months ago

Would it be possible to create an option to automatically move files to Google Storage Buckets as an alternative to AWS Buckets (in a way identical to that in which indi-allsky currently moves them to AWS Buckets)?

We are doing serial image analyses by students in Python Notebooks on Google Colab. Colab access is well integrated for the Google Storage Buckets. (We can also make subsequent examples of the Python-based image/observation analyses in Colab available publicly to help others.)

My thanks, Rick

aaronwmorris commented 6 months ago

The latest versions of indi-allsky supports Google Cloud Platform [GCP], Oracle OCI, and AWS buckets with the same level of functionality.

If you have existing files that you want uploaded to GCP, I can provide the SQL to reset the file bucket keys so they can be re-uploaded to GCP.

gaitskell commented 6 months ago

@aaronwmorris For the Config web interface. https://piallsky.local/indi-allsky/config

Forgive me but I have been unable to get the GCP upload to work. Do you have a help page that explains how to work in GCP with the "Credentials File" field?

Thanks, Rick

aaronwmorris commented 6 months ago

I do not have a page for it, but there are a couple of ways to access the Service Accounts.

The JSON file should automatically download. This is the file you place on the filesystem and then in the path in the config field.

gaitskell commented 6 months ago

@aaronwmorris Thank you so much for the additional instructions - your suggestions above worked. indi-allsky is now uploading to a GCP (Google Cloud Platform) bucket.

I should add that it was necessary in GCP to change Bucket Access Control from IAM to Fine-grained so that the ACL settings from indi-allsky specified in Config "publicRead" can be specified during upload.

Initially, I wanted to manage the permissions working just within GCP but under IAM I couldn't get the public read settings for the entire bucket to be allowed. "IAM policy update failed. A domain restriction organization policy is in place. Only principals in allowed domains can be added as principals in the policy. Correct the principal emails and try again."

aaronwmorris commented 6 months ago

I had to go back into the GCP console to figure this out since I do this infrequently...

If you go to Permissions for the bucket and set allUsers principal to Storage Object Viewer then all objects in the bucket are public and you do not need to specify the ACL.