#dynolocker (2019-02)

https://github.com/joshmyers/dynolocker

https://github.com/joshmyers/dynolocker

Archive: https://archive.sweetops.com/dynolocker/

2019-02-06

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
11:34:06 PM

@Erik Osterman (Cloud Posse) has joined the channel

joshmyers avatar
joshmyers
11:34:06 PM

@joshmyers has joined the channel

mumoshu avatar
mumoshu
11:34:07 PM

@mumoshu has joined the channel

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@joshmyers was just talking with @mumoshu about your tool

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

i’ve been referring a bunch of people over to dynolocker

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

there’s no good solution like this that does distributed locking.

mumoshu avatar
mumoshu

@joshmyers hi!

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@mumoshu has an interesting (common) use-case about renewing locks

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
11:35:57 PM
Andriy Knysh (Cloud Posse) avatar
Andriy Knysh (Cloud Posse)
11:36:20 PM

@Andriy Knysh (Cloud Posse) has joined the channel

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@joshmyers is based in GMT (London), so he’ll be online tomorrow

michal.matyjek avatar
michal.matyjek
11:37:17 PM

@michal.matyjek has joined the channel

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@michal.matyjek are you guys doing any distributed locking?

dustinvb avatar
dustinvb
11:37:41 PM

@dustinvb has joined the channel

michal.matyjek avatar
michal.matyjek

I don’t remember

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

I was also sharing dynolocking with @dustinvb from codefresh

mumoshu avatar
mumoshu

ah i remembered that i had created a very similar command myself 3 years ago, but in ruby https://github.com/crowdworks/joumae-ruby#cli

crowdworks/joumae-ruby

A client library for the Joumae lock service. Contribute to crowdworks/joumae-ruby development by creating an account on GitHub.

mumoshu avatar
mumoshu

i definitely like a command written in golang am eager to submit a pr to dynolocker if that makes sense

mumoshu avatar
mumoshu

dynolocker run --lock_name mylock --renew_interval 30s -- terraform apply

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

yea, let’s breath some life into it

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

also wire it up with a codefresh pipeline to build binary releases

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

then we can also distribute through cloudposse/packages

1
michal.matyjek avatar
michal.matyjek

so the use case is…?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

see the snippet above

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

basically, you need to lock something which could be used across pipelines or even within the same pipeline

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

for example, if you’re terraforming, you want to lock a project to a pull request

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

(e.g. like in atlantis)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

also, i’ve had the problem we’re we merge 2 PRs too close to each other

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

and we end up doing concurrent helm deployments of the same app

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

we should really be locking a helm release before performing a helm deployment

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

that’s (2) very strong use-cases for locking

mumoshu avatar
mumoshu

probably it is unlikely to happen when you run the pipeline on a new commit to e.g. master

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

(happened to me yesterday… and we have wait: true, so second release was rolling out destroying pods from first release)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

first release then was blocked by second release completing

mumoshu avatar
mumoshu

but i do have encountered the same situation as erik’s in my terraform pipeline powered by github flow(the latest one, apply/deploy before merging for final testing)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

i think for terraform it’s scarier

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

are you using codefresh with terraform now?

mumoshu avatar
mumoshu

not yet, but i’m seriously considering to move to codefresh for anything related to github flow

2019-02-07

joshmyers avatar
joshmyers

Morning wave

joshmyers avatar
joshmyers

Sure, PRs always welcome

joshmyers avatar
joshmyers

it was a hacky tool whipped up due to a race condition when bootstrapping Vault nodes (a few years back now)

joshmyers avatar
joshmyers

locksmithctl by coreOS may also be interesting

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

That one requires etcd, no?

joshmyers avatar
joshmyers

Yeah it was based off etcd

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

That might not work well if running outside of k8s

joshmyers avatar
joshmyers

dynolocker might not work well outside of AWS

joshmyers avatar
joshmyers

well, def won’t

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Haha well, kinda depends on what “outside” means ;-)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

But yea, I get your point. For our purposes, AWS is an acceptable requirement.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

(And already use it for terraform locking)

joshmyers avatar
joshmyers

Yeah, I was going to try and do more with it and actually have it do sane things with process and signals etc but never got around to it

joshmyers avatar
joshmyers

huh, I like this Variant

2019-02-08

richwine avatar
richwine
11:02:56 PM

@richwine has joined the channel

    keyboard_arrow_up