Coder Social home page Coder Social logo

Comments (15)

djmb avatar djmb commented on August 29, 2024 2

We should also add the destination to the lock_dir.

Yes that seems sensible 👍

from kamal.

igor-alexandrov avatar igor-alexandrov commented on August 29, 2024 1

@dorianmariecom I wrote about concurrent deploys in this article: https://igor.works/blog/evolution-of-github-action-for-kamal.

TL; DR; concurrency can be (and should be) achieved by using GitHub deployment groups with cancel-in-progress: true and if: ${{ cancelled() }} options.

from kamal.

fredrikburmester avatar fredrikburmester commented on August 29, 2024 1

We should also add the destination to the lock_dir.

Yes, I agree.

@igor-alexandrov

from kamal.

wenderjean avatar wenderjean commented on August 29, 2024

@dorianmariecom Just for the sake of curiosity, do you have a real use case for concurrent deploys? I can just imagine deploying different environments at the same time

from kamal.

dorianmariecom avatar dorianmariecom commented on August 29, 2024

For instance I deploy a first fix and it's deployed while the second fix is building then deployed

from kamal.

morgoth avatar morgoth commented on August 29, 2024

that could get messed up. Imagine having long migration in the first one. It could happen that the second one finishes before the first one, which wouldn't be something you expect.

I think it would be better for you to cancel the first deploy and deploy only the next one.

from kamal.

dorianmariecom avatar dorianmariecom commented on August 29, 2024

I tried that but then if I make too many commits only the last one will get deployed

from kamal.

djmb avatar djmb commented on August 29, 2024

Just to confirm, is the issue that you are deploying from CI and the second deploy fails because the first is in progress?

Maybe we could add a setting to wait for the lock (with a timeout). Also relevant here is #455. If we remove the lock while building, then the lock won't be held for as long.

from kamal.

dorianmariecom avatar dorianmariecom commented on August 29, 2024

What's the issue with releasing the lock while a deploy is in progress? It seems like it works fine

from kamal.

djmb avatar djmb commented on August 29, 2024

Kamal deployments are not designed to work concurrently. There are many things that could go wrong if you ran two at the same time. If it works ok, that's by luck and not design!

from kamal.

igor-alexandrov avatar igor-alexandrov commented on August 29, 2024

@djmb seems like the issue can be closed.

from kamal.

fredrikburmester avatar fredrikburmester commented on August 29, 2024

One use case would be two environments like -d staging and -d production. It would be nice to be able deploy these at the same time.

from kamal.

igor-alexandrov avatar igor-alexandrov commented on August 29, 2024

@fredrikburmester, what is the use case for the simultaneous deployment of two environments?

from kamal.

fredrikburmester avatar fredrikburmester commented on August 29, 2024

@igor-alexandrov I have a production and staging environment, they have completely separate containers but run on the same server. Sometimes I have a change that I want to push to both branches, but then it'll run both my develop and main git workflows, triggering kamal deploy for both production and develop.

from kamal.

igor-alexandrov avatar igor-alexandrov commented on August 29, 2024

@fredrikburmester OK, now I understand. Currently, Kamal includes only the service name in the lock file name: https://github.com/basecamp/kamal/blob/main/lib/kamal/commands/lock.rb#L44. This allows you to deploy different services to the same host simultaneously.

We should also add the destination to the lock_dir.

@djmb do you agree?

from kamal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.