-
Notifications
You must be signed in to change notification settings - Fork 91
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
Current Symlink & Restart == Chicken & Egg #68
Comments
Hi @tomduckering, thanks for the report. I'd like to make sure I understand what you are describing. You are encountering a situation where you are writing out a service to somewhere like |
Hey @KAllan357, Yeah - some differences in the tools but you've got the gist of it. I'm not so much as raising an issue with the code but wondering if you have any particular thoughts on a good approach to overcome this issue. In the past - using a similar approach - I've had a means to start a named release of the application. e.g. I was interested to know if you had encountered this conundrum too and if you had any advice on dealing with it since your documentation doesn't allude to it. Cheers, |
I was chatting about this issue with @ivey and we both agreed on the same conclusion, that in general, it seemed like the best practice to reference the I think that logic also applies here - we're configuring a file that will exist outside of I have an idea, and a few questions, so I will start with the questions.
Finally, I have on suggestion about a possible workaround. I allude to it in the documentation, that once you are inside any of the Procs, you have access to any of the internal methods of the Resource class. With that, I think you could do your restart logic in the
That might get you the idempotency you need. To note, I think at one point we already moved the current symlink creation time logic higher in the artifact_deploy flow, so I'm not adverse to the idea of changing it. Perhaps @ivey can weigh in on that discussion. Kyle |
@KAllan357, running into the same issue as @tomduckering, although our use case exactly matches your assumption:
Using a conditional |
Am running into this issue as well, and attempted @KAllan357's workaround (testing I ended up testing against
|
Since it sounds like we already have an init.d type template that is already being managed by Chef, I still think the appropriate action is to reference |
I'm deploying a ruby app running under unicorn, and sending a USR2 reload to unicorn (via bluepill). Unicorn working directory is |
@KAllan357 using Of course, there's probably a good reason why it was placed before the symlink in the first case, I just haven't run into that use-case yet. |
@mgreensmith could I ask you how you are handling Ruby/Rails deployments using the artifact cookbook? I would like to use it for Rails apps as well, but we're currently using the |
I think I'm convinced. I'm not sure how disruptive it will be to change, but I will target this and some other issues in a 2.0.0 release. I think I will just change the ordering as discussed above. |
@KAllan357 Awesome, thanks. At the cost of increasing complexity, you could consider making the ordering of some actions configurable for multiple use cases. @JeanMertz We "build" our ruby app in Jenkins (bundle install into a subdirectory, build assets, etc.) and then tar up the entire application directory including the bundled gems. This makes our deploy process simple and fast: use artifact_deploy to download/expand the tarball and trigger a unicorn restart. Deploys happen in <1min. |
Any movement on this? I'd love to help test any changes. For us, moving the if deploy? ... run_proc :restart block to after the "current" symlink creation looks like it should be sufficient. This will make your artifact_deploy provider match the behavior of Chef's deploy provider which would be a huge win. Doesn't seem like it should break anyone's existing deploys (is anyone depending on the "current" symlink to point to the previous revision at restart?) so hopefully no drama. |
I'm running around in circles on this. I'm using chef 11.14.2 with artifact 1.12.1 and running into this issue. I've tried using
But get the error:
I then tried
but nothing ever happens. I tried looking at the same code that seems to trigger the restart proc and did:
that did work, but is triggering the restart more often then it should: I deploy from a tarball, so nothing local should change, but the restart is often triggered even when the tarball path remains the same, which I would like to avoid. Any ideas what I might be doing wrong? |
Just hit this one trying to use the 'current' symlink in a systemd unit file to a binary included in the deployment artifact. 🎱 |
I submitted a change which moves the callback execution timing for both migration and restart to after the current symlink is generated @ #153. |
still in favour of this change. Any update on this recently @KAllan357 ? |
Also in favor as this is preventing us from moving entirely to artifact. @tarrall's suggestion seems simplest. Would rather not fork if we don't have to. |
Hi,
We have a slight frustration with the fact that the restart occurs before the "current" symlink is in place. We like to refer to the app for it's service control via that symlink.
Obviously there are ways around it but I wonder if you might be able to offer the ability to have the symlink creation somewhere else?
Thanks
The text was updated successfully, but these errors were encountered: