-
Notifications
You must be signed in to change notification settings - Fork 487
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
[DCOS-15645] Change sed
in installer to not be GNU specific
#1571
[DCOS-15645] Change sed
in installer to not be GNU specific
#1571
Conversation
This repo has @mesosphere-mergebot integration. You can interact with the following commands.
|
cc @karlkfi @gpaul @mhrabovcin (I'm not really sure who to ping) @BenWhitehead - pinging because I've seen that you have opinions on related matters. I'd ask that reviewers please read the PR description for context. |
It appears that BSD awk doesn't have the extension necessary to read and write binary files on non-POSIX systems. However, you can do the script in GNU awk without the tail by moving the print to before the matching:
I also found a way to do it with BSD sed, which is probably the preferred solution:
It appears that GNU sed interprets both I have confirmed this command works on both mac and ubuntu. |
Thank you @karlkfi . Do you prefer that to Python? I'm easy but my preference is Python as, to me, it looks clearer and someone else has dealt with worrying about cross-platform issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm relatively certain switching to python2 here will prevent the dcos_generate_config.sh
from being able to run on CoreOS boxes since it doesn't have python2 installed.
To even consider this change it will have to work on CoreOS, which I think leaves us with sed/awk as the only options.
(A change to fix the build error is going to merge in the next train, where I suspect we would actually see the install fail for the test builds that run on CoreOS)
please squash this to 1 commit |
You can test this on an existing installer:
|
I don't understand why, but the
|
Looks like the artifact got updated. The current train has an update for this and this will go back to working once that goes in. You can cherry-pick it to unblock for now 773227c |
6b2dd14
to
ac8b5d2
Compare
@mellenburg do we actually know why the |
ac8b5d2
to
58c7433
Compare
sed
for Python in an installer commandsed
in installer to not be GNU specific
58c7433
to
e387104
Compare
sha1 change is blocking #1505 too |
The dcos-launch source fix needs to be backported to 1.9 as well. https://github.com/dcos/dcos/blob/1.9.1/packages/dcos-launch/buildinfo.json#L11 |
The fix for pyinstaller just merged to master, can you please rebase this PR off latest master? |
e387104
to
cff3042
Compare
@BenWhitehead Thank you, I have done this just now. @branden I imagine that that request would be welcome in JIRA or perhaps another PR. |
kicked |
|
@mesosphere-mergebot label Ready For Review |
@mesosphere-mergebot label ship-it |
High Level Description
My goal was to make DC/OS Docker runnable from my Mac as a development convenience.
This -
sed
syntax which does not work on macOS - was the one blocker in DC/OS.Related Issues
https://jira.mesosphere.com/browse/DCOS-15645 - Run DC/OS Docker on macOS without Vagrant
Further context and CI
I originally wrote a way of overwriting
sed
with GNU sed on macOS (see https://github.com/dcos/dcos-docker/pull/36/files#diff-04c6e90faac2675aa89e2176d2eec7d8R33). This would require no changes to DC/OS but may have unintended consequences for the user.I was asked by @karlkfi in review to create a cross-platform compatible change and to add to DC/OS a test which runs on a macOS builder. The suggested test would potentially spin up a DC/OS Docker cluster on macOS. My preference is to not do that because:
I therefore submit this change and ask for feedback on whether we should:
I would like DC/OS Docker macOS support, but also because since mentioning it on Slack, there has been a good response which shows that this is wanted.
Other solutions
See the high level description for options which do not involve modifying this file.
Other solutions in this file include:
gawk
and require it to be installed on macOS withbrew install gawk
(handled in DC/OS Docker):sed
and GNU sed. I failed to achieve this but I am not an expert in either tool.gsed
is available, and if so, use it instead ofsed
.Testing
I have tested this by running the following command on CentOS (DC/OS Docker Vagrant VM) and macOS.
On both platforms the command succeeds.
I await tests mainly to see if my indentation is alright but I'm interested in feedback as early as possible.
Checklist for all PR's