Remove name collisions of replaced files in multi-node setups#427
Remove name collisions of replaced files in multi-node setups#427lrascao merged 1 commit intoerlware:masterfrom
Conversation
|
Thanks! I can't get this to work right now but have to run. Hopefully I will have some time this afternoon to poke at it. |
|
It seems to work fine in my Linux setup with multiple nodes. |
|
From reading the code, this seems like it'd work well, and I vlosed my PR #357 in favor of this one. That said, I can't make it play nice with rebar3 on my local setup for reasons that seem unrelated to relx. So can't test right now. Happy to dig into it more after vacation, or just to see if merged if no one else is having issues getting it to work as my problem is likely unrelated. |
|
What you need to do to make it work with rebar3 is to remove the rebar.lock, so that it'd get regenerated, and also apply this (until |
|
you don't need to remove the rebar.lock. You can call |
|
Thanks for the tip. |
| # Generate a random id | ||
| relx_gen_id() { | ||
| od -t x -N 4 /dev/urandom | head -n1 | awk '{print $2}' | ||
| od -X -N 4 /dev/urandom | head -n1 | gawk '{print $2}' |
There was a problem hiding this comment.
is there some behavior of gawk that we need here? it isn't universally installed
There was a problem hiding this comment.
It's not needed in this particular line, but may be needed in other place (see comments below), so this one has been renamed to match other gawk invocations.
|
Sorry that I took ages to look at this; however it does not seem to work correctly with rebar3. It isn't getting the correct location for my vm.args and thus can't generate per-node versions. |
|
Perhaps you can elaborate a bit more with examples? I have been using this approach/patch in production on multi-node Linux systems for a while now without issues. |
|
@saleyn i know it's been a while but could you please rebase onto master so i could give a try as well? |
|
I rebased the branch to master. |
|
@saleyn, we've since put some tests in place that exercise the |
|
Done |
|
commit cf5ed97 removed a lot of bash related stuff due to it not being supported in Solaris/SmartOS, is the switch to bash strictly necessary to make the multi-node setup work? |
|
The multi-node setup doesn't depend on bash features. The bash dependency was created to support advanced variable substitution (e.g. |
|
I see, maybe it's best to separate the two issues, one PR for multi-node setup and a different one for advanced variable substitution (perhaps with a different approach than replace |
|
How about having two separate |
|
That's one way, i'm sure more people will want to weigh in on this, still i think we should split this into PRs and keep the bash discussion in the new one, what do you think? |
|
I'll look into it some time next week. |
This update extends PR erlware#427 by supporting variable replacement syntax of bash to be used in vm.args and sys.config. The changes are backward-compatible with non-bash shells.
|
I believe that the approach of creating random files in Additionally, the proposed version allows for the node name in the |
|
@saleyn Make sense. Can we add a parameter for the location of the modified vm..args (sys..config)? By default, it would use the same location as vm.args. However, if some other location is provided then we could use that. |
|
You are welcome to send a patch. |
|
so to sum up the changes still needed:
am i missing anything else? |
|
Not sure if you described the changes needed before or after applying my reworked patch. If you meant the changes needed after applying the patch, then it's only the first bullet. The second bullet is already covered by the patch. |
|
i meant before your patch, do you think you can narrow down the changes to only contain the strictly necessary to implement the second bullet? There are a lot of other changes that seem unrelated |
|
If your comment is for changes "before the patch", then the third bullet is to allow for node name in My patch addresses bullets 2 and 3 only. Aside from that there's only one slight change that readlink is used with '-f' option, which canonicalizes the real script's path, so that it's clear where the script actually is if components of the path are links as well. Even though it seems like there are many changes - if you follow the changes, the majority is a result of merely rearranging the same code, so that the formation of |
|
i also agree that is best to include it, @saleyn could you please make this change? i think it's just a matter of consulting a new env var that defaults to empy string and prefix the |
This update extends PR erlware#427 by supporting variable replacement syntax of bash to be used in vm.args and sys.config. The changes are backward-compatible with non-bash shells.
|
Added optional |
|
lgtm. Should we also append few tests to cover RELX_OUT_FILE_PATH case? |
|
thanks @saleyn, looks good |
|
@saleyn could you please cherry-pick 77450da (lrascao@77450da) into your branch so the new tests can run? |
|
@saleyn sorry, the previous commit was missing the new test in the suite |
|
Any update on this one? |
|
@saleyn need a hand with this or just too busy? |
|
Was busy with other stuff. Check out now. |
|
thanks! |
This update extends PR erlware#427 by supporting variable replacement syntax of bash to be used in vm.args and sys.config. The changes are backward-compatible with non-bash shells.
This update extends PR erlware#427 by supporting variable replacement syntax of bash to be used in vm.args and sys.config. The changes are backward-compatible with non-bash shells.
Generated vm.2.args and sys.2.config files are renamed to
vm.${NAME}.argsandsys.${NAME}.configto avoid naming collisions in the multi-node startup off of the same release dir.