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

Binding to PIPELINE2_WS_HOST #717

Closed
josteinaj opened this issue Sep 8, 2023 · 2 comments
Closed

Binding to PIPELINE2_WS_HOST #717

josteinaj opened this issue Sep 8, 2023 · 2 comments

Comments

@josteinaj
Copy link
Member

We have a file ("docker-entrypoint.sh") which I have set up to be used as the entrypoint when running Pipeline 2 in our docker environment (docker swarm):

#!/bin/bash -e

# Make sure that the Pipeline 2 Web Service can bind to the remote endpoint.
# For instance, if container is exposed as pipeline.example.com, then PIPELINE2_WS_HOST
# must be set to pipeline.example.com so that the web service responses include the
# correct hostname when returning URLs. However, the web service will also try to bind
# to the host declared in PIPELINE2_WS_HOST (this cannot be declared separately), so
# we map PIPELINE2_WS_HOST to 0.0.0.0 ("all interfaces") in /etc/hosts so that Pipeline 2
# are able to bind to the correct interface and listen for requests.

if [ "$PIPELINE2_WS_HOST" != "" ] && [ "$PIPELINE2_WS_HOST" != "0.0.0.0" ] ; then
    echo "0.0.0.0 $PIPELINE2_WS_HOST" >> /etc/hosts
fi

/opt/daisy-pipeline2/bin/pipeline2 "$@"

Let's say PIPELINE2_WS_HOST is example.com. This setup will make it bind to and use example.com as 0.0.0.0 internally, while still using example.com in API responses where there are URLs to jobs, scripts etc.

I'm not sure if this is a docker specific issue, or if it's a more general networking issue. But maybe there should be a separate environment variable for which host to bind to.

This couldmake docker setup easier, as was brought up in #709

@bertfrees
Copy link
Member

@josteinaj
Copy link
Member Author

Ah, yes, I thought I might have brought this up before. So this is a duplicate.

I'll let you know on those issues when I've tried 👍

@josteinaj josteinaj closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants