Skip to content
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

make weave port configurable via WEAVE_PORT #551

Merged
merged 1 commit into from Apr 16, 2015
Merged

Conversation

rade
Copy link
Member

@rade rade commented Apr 12, 2015

This is a follow on of #534.

We cannot just leave that to the `-port` parameter since that only
controls the container internal port weave is listening on (and uses
as the default destination port for outbound connections). Also, we
need the port for connection tracking cleanup during `stop` and
`reset`.

So we make setting `WEAVE_PORT` the only documented mechanism for
overriding the port, and let `-port` set the container internal port
only (and the script pays attentiont to that, so it can establish the
correct port mapping).
@rade
Copy link
Member Author

rade commented Apr 12, 2015

@dpw review please

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

Other than the comment about $PORT, works for me.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

The general rule I've tried to follow is that WEAVE_ vars are for thing we expected to be supplied by a user, and that they seed the non-prefixed variants. We could change that to use the same var for the latter, but it should be applied to all such vars in the weave script, not just PORT. Hence should go into a separate PR.

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

The general rule I've tried to follow is that WEAVE_ vars are for thing we expected to be supplied by a user, and that they seed the non-prefixed variants. We could change that to use the same var for the latter, but it should be applied to all such vars in the weave script, not just PORT. Hence should go into a separate PR.

Ok. The WEAVE_PORT idea just seemed convenient to me. I'd be happy with renaming PORT to something else non-generic. But the WEAVE_PORT vs PORT thing just seems too confusing to ok as is.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

any more confusing than CONTAINER_NAME?

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

The confusingness of CONTAINER_NAME does not seem pertinent to or exacerbated by this PR. You can fix that if it makes you happy though.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

It is pertinent because if we go with WEAVE_PORT throughout then that is inconsistent with how other vars are treated. We could go with another non-weave name (suggestions?), but tbh I do not understand what you find confusing about PORT. And it's always been called PORT; this is not something introduced in this PR.

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015 via email

@rade
Copy link
Member Author

rade commented Apr 13, 2015

PROTOCOL_PORT? PEER_PORT?

@awh
Copy link
Contributor

awh commented Apr 13, 2015

You appear to be having trouble getting this bikeshed painted ;) GOSSIP_PORT?

@rade
Copy link
Member Author

rade commented Apr 13, 2015

GOSSIP_PORT

The port is used for more than gossip.

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

PROTOCOL_PORT? PEER_PORT?

These do not seem to hint at the purpose of the variable as it contrasts with the purpose of WEAVE_PORT.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

I will just leave it as PORT then.

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

I'm not raising this point frivolously, I genuinely think the distinction between WEAVE_PORT and PORT is not obvious. And that given state of the weave script, we need an abundance of caution when introducing changes that tend to make it worse.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

I don't think it's a frivolous point. But I cannot come up with a better name. It's not worth holding this up for that.

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

I was clear what I thought the best way to address this was up front (I.e. conflate WEAVE_PORT and PORT). You didn't like that suggestion, because some other thing should be changed for consistency. That might be a valid point, but it's not one I raised, and not one I would have held things up for. And you could have made the wider change for consistency if you believed that proper - it would not have been time consuming.

As for changing the name of PORT, I don't think an earnest attempt to find a better

@dpw dpw closed this Apr 13, 2015
@dpw dpw reopened this Apr 13, 2015
@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

(Cont) name would take more than five or ten minutes.

In short, I don't think I am the one holding this up, except by providing feedback, and guidance on what would or would not satisfy that feedback. If you want someone to rubber stamp your PRs without giving them careful consideration, find someone else, you know that's not my style.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

I don't think I am the one holding this up

I didn't suggest you were. To be clear, I am not asking you to merge this PR.

If you want someone to rubber stamp your PRs without giving them careful consideration, find someone else, you know that's not my style.

I don't mind the careful consideration. Quite the opposite. But sometimes there will be disagreement about a particular piece of feedback. And sometimes it's not worth holding up a PR until that is resolved.

I'll let this one sit until tomorrow. If somebody comes up with a mutually acceptable name for the var then I'll make that change. Otherwise I'll merge this as is.

@dpw
Copy link
Contributor

dpw commented Apr 13, 2015

I don't mind the careful consideration. Quite the opposite. But sometimes there will be disagreement about a particular piece of feedback. And sometimes it's not worth holding up a PR until that is resolved.

Ah, but who gets to make the call - there's the rub. If a developer can unilaterally override, then that leads to a low standard of review (because all developers are reluctant to change work they have invested in, or to do further work they regard as unnecessary; and because reviewers have a disincentive to be diligent if their diligence may be disregarded at a whim).

I'll let this one sit until tomorrow. If somebody comes up with a mutually acceptable name for the var then I'll make that change. Otherwise I'll merge this as is.

We both know how that will go, so this seems like a pretense.

@rade
Copy link
Member Author

rade commented Apr 13, 2015

I disagree, but let's not have that meta discussion in this issue, please.

@rade rade self-assigned this Apr 15, 2015
@awh
Copy link
Contributor

awh commented Apr 16, 2015

The flag help for -port in weaver/main.go is "router port". ROUTER_PORT?

@dpw
Copy link
Contributor

dpw commented Apr 16, 2015

My opinion on this one may be by the by, but if PORT became ROUTER_PORT, then WEAVE_PORT could become WEAVE_ROUTER_PORT on exactly the same basis, and we'd be more or less back where we started I am not suggesting renaming for the sake of renaming, with a name that is merely different from WEAVE_PORT and longer than PORT, but rather I'd like a name that accounts for the specific purpose of that variable. Yes, it's a port number, yes it's the router port number, but why does it exist in addition to WEAVE_PORT?

@rade rade modified the milestone: 0.10.0 Apr 16, 2015
@awh
Copy link
Contributor

awh commented Apr 16, 2015

I think the problem here stems from the fact that PORT is used for several things - e.g. both the control plane traffic over TCP and the forwarding path over UDP, both of which are distinct protocols proprietary to the weave router. As a consequence it's quite hard to give it a pithy name! Actually I agree with your suggestion to do WEAVE_PORT=${WEAVE_PORT:-6783}, and would actually extend it to the other variables too, with some further changes to the other port names to make them more descriptive:

WEAVE_CONTAINER_NAME=${WEAVE_CONTAINER_NAME:-weave}
WEAVEDNS_CONTAINER_NAME=${WEAVEDNS_CONTAINER_NAME:-weavedns}
WEAVE_BRIDGE=weave
WEAVE_CONTAINER_IFNAME=ethwe
WEAVE_MTU=65535
WEAVE_ROUTER_PORT=${WEAVE_ROUTER_PORT:-6783}
WEAVE_REST_PORT=${WEAVE_REST_PORT:-6784}
WEAVEDNS_REST_PORT=${WEAVEDNS_REST_PORT:-6785}

rade added a commit that referenced this pull request Apr 16, 2015
make weave port configurable via WEAVE_PORT
@rade rade merged commit af51aef into weaveworks:master Apr 16, 2015
@rade
Copy link
Member Author

rade commented Apr 16, 2015

@awh please open a separate issue if you want to go on a var renaming spree.

As for your latest suggestion. See #551 (comment)... The WEAVE_ prefix indicates that the var can be supplied by the user. Some of the vars in your list aren't configurable that way. And neither should they be. That also goes for the 'rest' ports - these are only accessed via the container IP and thus cannot clash with anything).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants