-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
HUB_HOST and HUB_PORT to handle hub and nodes #640
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
Conversation
…TCP_ADDR and HUB_PORT_4444_TCP_PORT, in favor of the future deprecation of links in docker.
We should squash and merge the PR when the review is complete, the commit history is a bit messy. |
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.
all in all, looks great. just those questions there
# In the long term the idea is to remove $HUB_PORT_4444_TCP_ADDR and $HUB_PORT_4444_TCP_PORT and only work with | ||
# $HUB_HOST and $HUB_PORT | ||
if [ ! -z "$HUB_HOST" ]; then | ||
HUB_PORT_PARAM=4444 |
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.
confused about a couple of things, why do you check
"if $HUB_HOST isn't empty, set port to 4444"
also, i see 4 variables...
HUB_HOST, HUB_PORT, HUB_HOST_PARAM, HUB_PORT_PARAM.
what's the differences between these? can';t we consolidate? make things a little simpler?
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.
No, no... There are only 3 variables: HUB_HOST
, HUB_PORT
and HUB_PORT_PARAM
.
What I tried to do is to check first if HUB_HOST
was set, if so then use HUB_PORT_PARAM
as a placeholder for port 4444 (assuming that the user started the hub with port 4444).
Therefore they only will need to set HUB_HOST
and the default port will be 4444. And in case they started the hub with a different port, then HUB_PORT
would be set and HUB_PORT_PARAM
takes its value.
It could be simplified by doing something like:
if [ ! -z "$HUB_HOST" ] && [ ! -z "$HUB_PORT" ]; then
echo "Connecting to the Hub using the host ${HUB_HOST} and port ${HUB_PORT}"
HUB_PORT_4444_TCP_ADDR=${HUB_HOST}
HUB_PORT_4444_TCP_PORT=${HUB_PORT}
fi
So the user will need to set both variables always. I just thought it could be nicer when the user only needs to set HUB_HOST
since in most of the cases people will use 4444 for hub.
What do you think?
if this is ready to merge @diemol and you're comfortable with it, i'm comfortable with it. you can pull the trigger |
Cool, thanks for reviewing @ddavison! |
This PR has the following objectives:
Introduce
HUB_HOST
andHUB_PORT
as a replacement to deprecateHUB_PORT_4444_TCP_ADDR
andHUB_PORT_4444_TCP_ADDR
.HUB_HOST
andHUB_PORT
will map toHUB_PORT_4444_TCP_ADDR
andHUB_PORT_4444_TCP_ADDR
, and when people use--link
with the proposed container name in the examplesselenium-hub:hub
, it will continue to work.HUB_PORT_4444_TCP_ADDR
andHUB_PORT_4444_TCP_ADDR
won't be mentioned anymore in the docs, so ideally people will migrate to this new env vars gradually.HUB_HOST
would be needed, sinceHUB_PORT
is defaulting to 4444. The user is also able to overwriteHUB_PORT
in case the hub is listening to a different port.Improving the README showing a "docker network" way to start the grid and a simple docker-compose example, with the intention that users tend to use these ones more than the
--link
option.Credits to @SpencerMalone and @RubyTester since most of the content comes from their work and ideas in #136 and #133.
@ddavison, could you please have a look? Let me know if something doesn't look straightforward to you.
X
in the preceding checkbox, I verify that I have signed the Contributor License Agreement