-
Notifications
You must be signed in to change notification settings - Fork 249
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
Add support for google cloud #3821
Add support for google cloud #3821
Conversation
have a look at this for sql issues https://dev.to/ku6ryo/access-cloud-sql-from-docker-on-cloud-run-41b6 |
Also this for postgres stuff needed |
I think this looks good now. |
features/support/fixtures/cassettes/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it necessary to put this re-enabling of vcr in this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually looks like I just accidentally removed the last blank line, which doesn't seem to hurt anything
Gemfile
Outdated
@@ -36,6 +36,7 @@ gem 'faker' | |||
gem 'font-awesome-rails' | |||
gem 'friendly_id' | |||
gem 'geocoder' | |||
gem 'google-cloud-storage' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this in this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try taking all of the cloud storage stuff out. There's a chance that it's necessary for asset pipeline, but hopefully not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took it out.
config/application.rb
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
require_relative 'boot' | |||
require 'rails' | |||
require "active_storage/engine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we end up needing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took it out.
config/storage.yml
Outdated
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> | ||
# bucket: your_own_bucket | ||
# [START cloudrun_rails_storage] | ||
google: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took it out.
@@ -0,0 +1,48 @@ | |||
# This migration comes from active_storage (originally 20170806125915) | |||
class CreateActiveStorageTables < ActiveRecord::Migration[5.2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we don't need this in this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took it out.
# [START cloudrun_rails_base_image] | ||
# Pinning the OS to buster because the nodejs install script is buster-specific. | ||
# Be sure to update the nodejs install command if the base image OS is updated. | ||
FROM ruby:3.0-buster as base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we running 3.0.5 here with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think they keep 'buster' up with the 'stable' version of ruby 3.0.x
@mtc2013. See it this looks good now. We should squash the commits when merging since there's so many. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pull this in and open a ticket for streamlining the deploy to google cloud. It's not a showstopper since we're not doing continuous delivery right now, nor do we have a production site.
Modifications to allow running the site on docker locally and on Google Cloud.
It's currently dying on trying to connect to Google Cloud SQL postgres with this:
PG::ConnectionBad: could not connect to server: No such file or directory
It seems to happen first when 'rake db:setup' tries to create the db and do migrations. And the postgres logs don't show it hitting the database. And the 'websiteone-production' db doesn't get created unless I do it manually.
I have checked a lot of things, and it may be a problem with the encrypted db password using the 'master key' method in rails, but I also seem to get the error just defining the password in the cloud service. Possibly the master key or 'rails secret key' didn't get saved correctly.