Improve docs and debug messages #1447
glundgrenm
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello guys! First thanks a lot for all the work did until now, it's an incredible tool.
I want to share a real life experience implementing a kamal deploy in a newly created Rails 8 project.
I had some difficult to make it work properly. It took me about 2-3 days to fully configure it and feel confident about the deployment process.
I will talk about the difficulties, doubts, make some suggestions and i hope we can work together to improve this. I am recalling it from memory, so it should not be 100% accurate.
Difficulties
First, it's important to mention that I am using a Mac M3 with 16GB RAM.
The Dockerfile never build at first. I don't know why, but It kept raising errors on several gems during bundle install that somehow was being solved each time i ran the kamal deploy/setup until it installed all the gems and proceeded. Why this happens?
The setup command is not optimal. This command will mostly fail the first time you run it because you are still figuring things out/configuring. You will probably keep using the setup command until it finishes successfully, but the thing is that if you use accessories, for example, it will never finish successfully, it will always finish with an error saying a container app-accessory already exists, or something like that. It takes a while until you realize you need to change the command to deploy.
The environment variables, secrets and credentials are confuse. Took me a while until i understand how to pass the env/secrets to the app and what should go inside the credentials. The easiest way was reading the secrets using cat
RAILS_MASTER_KEY=$(cat config/master.key)
. Although it's a very good feature read it from 1Password or Bitwarden, it only adds a layer of unnecessary complexity when you are starting.I couldn't make the postgres db accessory works. At first, it's not documented that the DB_HOST on Rails app should be the appname-accessory string, i got this info from a blog post. I understand that Kamal is a generic tool and Rails specifics should not belong on the docs, but i believe we should have a Rails section on the docs addressing the Rails particularities.
RAILS_ENV Kamal sets RAILS_ENV=production for the main deploy.yml, but i think it didnt setted for other envs (Ex.: deploy.staging.yml). I had to manually set the RAILS_ENV to staging in order to make it work properly. Its not clear why it setted the RAILS_ENV to production in Rails using deploy.yml and not deploy.staging.yml? Took me a lot of time to figure it out, because we dont know if its cache from Docker or something else that is causing the problems.
Doubts
Stability: Although its obvious that it handles the stability of the server (restarting if fail), i think it should be explicitly said in the docs.
Concurrency: It's not clear how to handle concurrency properly, a simple guide on how and when we scale the server vertically or horizontally and use a load balancer should work.
Swap and configurations: As Kamal is a tool that setups the server for you, heres a very basic thing that it misses. Do we need to configure the swap of the server manually? Should kamal setup handle this?
Security: can we be sure that the server is secure? Reinforcing this on docs would be great.
That's only a few of the issues i had, most of them can be solved with changes in docs, for example, adding a section for Ruby on Rails and other frameworks specifics, etc.
The optimal path is to start simple, get confidence, and add complexity from there.
What you guys think?
Beta Was this translation helpful? Give feedback.
All reactions