-
Notifications
You must be signed in to change notification settings - Fork 26
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
Assets & migration #134
Comments
Hey @jurgen1c, thanks for giving Kuby a try! There's a lot here, so let me try to respond to each of your questions in turn.
The kuby-sidekiq plugin currently doesn't support using a managed Redis instance, but certainly could. I would welcome a PR, or you could file a separate issue on that repo and I would be happy to look into it.
Hmm that's weird. What specifically wasn't working, and what error message did you get? What version of bundler were you using?
Migrations are run automatically on every deploy. In the past I considered requiring devs to run migrations manually, and maybe that's the right thing to do - after all, migrations can be tricky and/or dangerous. At the very least I think you should be able to disable automatic migrations in your Kuby config. I've filed an issue to that effect. You can run individual rake tasks using the Kuby CLI, for example: bundle exec kuby -e production remote exec -- bin/rails db:migrate
That's a tricky question because as I mentioned earlier, migrations can be tricky and/or dangerous. For example, if a migration fails before it finishes, it could leave your database in a broken state. Depending on the size of your team and your application's tolerance to downtime, there are a few options. If it's ok for the app to be down once and a while and/or you have a small team, then automatic migrations are probably fine. If you have a larger team and/or the app must be as available as possible, then you might consider performing online schema changes or migrating in several steps (eg. 1. deploy a code change that only reads from a new column if it exists, otherwise reads the old data, 2. add column, 3. remove old code, 4. drop old column). For the most part, migrations are something Kuby can't (and probably shouldn't) help with.
No, assets should work out-of-the-box. I know Sprockets works because that's what I use in one of the websites I deploy with Kuby. Can you verify the assets pod is running in your Kubernetes cluster ( |
Hi @camertron, thanks for response!
Cradhloop from sidekiq is new, but i have seen it come up and be healthy. Possibly missing something in development env config, will try with staging. Do i need to define the asset host?
|
Very interesting, I've never seen that before. I wonder if it's happening with newer versions of bundler 🤔
Ok no problem. The
Yeah, the assets pod appears to be running successfully and should be serving assets. Are you able to request any single asset from your app, i.e. https://my-app.com/assets/application.css? (double-check that URL, I can't remember the right path)
No, that shouldn't be necessary. The asset and web pods are available behind the same Kubernetes service object, i.e. they should be accessible via the same domain as the Rails app. Happy to pair on debugging this if you've got the time and inclination 😄 |
Hi, not really an issue more general inquiry. Awesome gem! Really simplified the kubernetes deploy for me, how ever have run into a few things that I can't seem to overcome any guidance is appreciated. I am running kuby with kind first as a proof of concept before actually moving to staging and production. I am on a rails 6.1 app with sprockets( no webpack since its a legacy app, upgraded to rails 6,1 from 5.0 but kept sprockets to minimize the changes need. Planning on moving to esbuild in the near future), sidekiq (using plugin, unclear if there is a way to get the plugin to use managed db since seems to always spin up a redis instance), redis and postgesql Using managed dbs for both).
Got everything deployed and healthy, side note got a weird issue with bundler bin stubs had to add this
bundle binstubs bundler --force
to docker file to get it to work. now only got two hurdles left to call it working. First migrations, i see there is a task to migrate but couldn't get it to work. Only fix to run migrations on remote db from local and then deploy. In a CD pipeline what is the right way to deal with deploys that might need migrations? Second the assets, might be due to the use of sprockets but my app seems to not be getting css/js served is there a config change needed to point the js/stylesheet tags pointed at the right place?The text was updated successfully, but these errors were encountered: