Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nisanthchunduru/45e04aff2cc514bf038906f1da016a4a to your computer and use it in GitHub Desktop.

Select an option

Save nisanthchunduru/45e04aff2cc514bf038906f1da016a4a to your computer and use it in GitHub Desktop.
My Kamal 1 to my Kamar 2 experience

My experience upgrading from kamal 1 to kamal 2

Since kamal 1 launched, I hosted my blog https://nisanthchunduru.com/ in a Cloud VM using kamal 1. kamal deploys a project to Docker containers in 1 or more servers.

In Q3 2024, Basecamp launched kamal 2. kamal 2 is slightly backwards incompatible with kamal 1.

When a kamal command I ran unexpectly failed, I decided to just upgrade my blog to kamal 2 (instead of investing time to investigate a failure in an older kamal version).

To upgrade to kamal 2, I

  • Modified my blog's kamal config file (so it became compatible with kamal 2)
  • Created the .kamal/secrets file
  • And then ran the kamal upgrade command

Unfortunatley, the kamal upgrade failed because my blog’s Docker container failed kamal’s health check https://gist.github.com/nisanthchunduru/dc908ac676454c18adb64837bf204aeb I added a HEALTHCHECK directive to my blog’s Dockerfile and kamal upgrade succeeded.

I then proceeded modified my blog and ran the kamal deploy command to deploy change. Unfortunately, kamal deploy failed

...
INFO [f6b4836f] Running /usr/bin/env git -C /var/folders/q3/0jl1k3mx143fw8xbs4m8qp0w0000gq/T/kamal-clones/blog-f5d00af52b8b7/blog/ status --porcelain as chunisan@localhost
INFO [f6b4836f] Finished in 0.038 seconds with exit status 0 (successful).
INFO [98e6f00b] Running /usr/bin/env git -C /var/folders/q3/0jl1k3mx143fw8xbs4m8qp0w0000gq/T/kamal-clones/blog-f5d00af52b8b7/blog/ rev-parse HEAD as chunisan@localhost        
INFO [98e6f00b] Finished in 0.031 seconds with exit status 0 (successful).        
Finished all in 8.5 second
ERROR (NoMethodError): undefined method `gsub' for true

The method gsub is a method that all strings in the Ruby programming language have. A variable that kamal 2 expected to a string seems to be a boolean with the value true.

Every abstraction added to a project introduces a learning curve. When introducing an abstraction in a project, I believe its utility must significiantly exceed the learning curve and complexity it'd add. While I’ve extensive experience with Ruby and should be able to resolve the error above, I decided that kamal may be unnecessary abstraction for a project as simple as a blog. I instead moved to Docker https://nisanthchunduru.com/posts/1a818e24-host-your-blog-in-a-cloud-vm-using-docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment