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

Implement paperclip or other way to upload to Google Cloud Storage #9760

Closed
icarito opened this issue Jun 7, 2021 · 8 comments · Fixed by #9807
Closed

Implement paperclip or other way to upload to Google Cloud Storage #9760

icarito opened this issue Jun 7, 2021 · 8 comments · Fixed by #9807
Labels
feature explains that the issue is to add a new feature

Comments

@icarito
Copy link
Member

icarito commented Jun 7, 2021

In order to migrate to Google Cloud Storage, we've had to mount our storage bucket with gcsfuse. This solution seems not stable enough as it sometimes locks the mountpoint (#9758 is an instance of this). This happened recently and we didn't notice until today, and it may have caused more problems in the past week.

Please describe the desired behavior.
Ideally, we would not have to mount this volume, but the app would upload the data directly to the Google Cloud Storage API.

@icarito icarito added the feature explains that the issue is to add a new feature label Jun 7, 2021
@anirudhprabhakaran3
Copy link
Member

What exactly are we storing on Google Cloud? Images and attachments? I don't understand the part about mounting the volume...

@jywarren
Copy link
Member

I think gcsfuse is a library which allows Google Cloud Storage to act as a linux-native disk mount, and fuse in general is a class of disk-mount interfaces -- for example, i think someone for fun made a gmail-fuse library which is able to use your gmail inbox appear as a fuse-based disk on linux devices. Obviously not that efficient 😄

Here, i guess it was just too much of a beta, or something -- so agreed, let's look at how Paperclip and Google Cloud's storage options can interact!

@anirudhprabhakaran3
Copy link
Member

It seems as though Paperclip has been depreciated. The official Paperclip GitHub repo advises us to use ActiveStorage.

The RoR docs give instructions to use ActiveStorage along with Google Cloud storage, along with lots of other services, like AWS and Azure. They can be found here: https://guides.rubyonrails.org/active_storage_overview.html#google-cloud-storage-service

We'll have to see how much time and effort it takes to use ActiveStorage to use Google Cloud

@jywarren
Copy link
Member

Thanks @anirudhprabhakaran3 -- we had tried switching to ActiveStorage a while back but it didn't yet support very many backends. Looking at it again now, but... my preference would be to try using Paperclip for a relatively quick fix on this, then scheduling a bigger switch to ActiveStorage later. But let's see what's possible. Thanks!

@jywarren
Copy link
Member

Google storage is supported through Fog Storage: https://github.com/thoughtbot/paperclip#storage

@jywarren
Copy link
Member

And we're on Paperclip v6.1.0: #3782

@jywarren
Copy link
Member

@jywarren
Copy link
Member

jywarren commented Jun 15, 2021

OK - @icarito i started the changeover here: #9807

My questions/thoughts:

  • what about moving the existing files over
  • changes in path config for cloud instead of file storage?
  • secrets/keys storage, i chose ENV["GOOGLE_STORAGE_KEY"] and ENV["GOOGLE_STORAGE_SECRET"] but open to whatever
  • Can you set up unstable with the keys following the above naming so we can try this out?
  • what about testing in gitpod, what if we did this /only/ in production or something? otherwise relying on local storage?
  • Do we condition the switch on what mode (production/development) or using an env variable?
  • anything else you can think of before this ought to start working?

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature explains that the issue is to add a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants