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

resolve resolveip command not found issue in integration test #8666

Closed
wants to merge 1 commit into from

Conversation

freyayunfu
Copy link

@freyayunfu freyayunfu commented Oct 13, 2019

Fixes (partially) #7842 .

Description

We use resolveip to get the hose ip address when generating the keys and certs, which command not necessary already installed/worked well on that platform where user run the integration test. This would cause the integration test fail. Replacing resolveip with curl ifconfig.me to get the host ip address will be more robust and prevent the integration test fail.

However, I'm still getting below error after this issue is resolved: java.net.ConnectException: Connection refused: /192.168.99.100:8081 Coordinator does not start up in time for some reason, which requires more research.

@leventov leventov added Area - Dev For items related to the project itself, like dev docs and checklists, but not CI Development Blocker Area - Testing and removed Area - Dev For items related to the project itself, like dev docs and checklists, but not CI labels Oct 13, 2019
@leventov
Copy link
Member

Now all integration tests fail in CI, e. g. see https://travis-ci.org/apache/incubator-druid/jobs/597175561

In this PR: #6702 I've experimented with another approach to solving this, like

if [[ "$OSTYPE" == "darwin"* ]]; then
  # On Mac OS X resolveip may not be available
  export DOCKER_HOST_IP=$(dig +short $HOSTNAME | awk '{ print ; exit }')
else
  export DOCKER_HOST_IP=$(resolveip -s $HOSTNAME)
fi

See changes to Dockerfile and some other files but without much success, either

@leventov leventov changed the title resolve resolveip command not found issue in integration test (Fixes #7842) resolve resolveip command not found issue in integration test Oct 13, 2019
@freyayunfu
Copy link
Author

Now all integration tests fail in CI, e. g. see https://travis-ci.org/apache/incubator-druid/jobs/597175561

In this PR: #6702 I've experimented with another approach to solving this, like

if [[ "$OSTYPE" == "darwin"* ]]; then
  # On Mac OS X resolveip may not be available
  export DOCKER_HOST_IP=$(dig +short $HOSTNAME | awk '{ print ; exit }')
else
  export DOCKER_HOST_IP=$(resolveip -s $HOSTNAME)
fi

See changes to Dockerfile and some other files but without much success, either

Thanks @leventov But before we do the PR for selfDiscovered endpoint, do we know what is the reason for the connection refused for coordinator in integration test? Is it because we didn't wait for enough time so that zookeeper hasn't added the node to cluster, or something else? I mean, I don't think PR #6702 will resolve the issue before we confirm the reason why the integration test failed.

@leventov
Copy link
Member

@woshifudayun I don't know the reasons. Otherwise, that PR wouldn't be stuck.

@@ -86,4 +86,4 @@ EXPOSE 8300 8301 8302 8303 8304 8305
EXPOSE 9092 9093

WORKDIR /var/lib/druid
ENTRYPOINT export HOST_IP="$(resolveip -s $HOSTNAME)" && /tls/generate-server-certs-and-keystores.sh && exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
ENTRYPOINT export HOST_IP="$(curl ifconfig.me)" && /tls/generate-server-certs-and-keystores.sh && exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an internet connection, and relies on an external web service that might go away. I think we can do it without needing one. How about:

host `hostname` | perl -nle '/has address (.*)/ && print $1'

The two most common dns lookup commands AFAIK are host and dig, so probably either one would be fine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. And i think @leventov already had a fix based on dig here: #6702 which also looks good to me.

@suneet-s
Copy link
Contributor

@woshifudayun Thanks for your fix! I used this as inspiration to get myself unblocked and submitted a PR here - #9065

Would love if you could look over this change!

@stale
Copy link

stale bot commented Feb 16, 2020

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions.

@stale stale bot added the stale label Feb 16, 2020
@stale
Copy link

stale bot commented Mar 15, 2020

This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@stale stale bot closed this Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants