Closed albertnanda closed 5 years ago
Hi, @albertnanda
By default, running application containers do not have access to the Internet. You have to supply everything along with the model when first uploading it.
Hi @tidylobster,
Can I configure it? I am trying to create a service which needs access to internet.
Hi @albertnanda It depends on your infrastructure. If you deployed hydro-serving using our docker-compose file, you could change the network definition there to get access to external resources. https://github.com/Hydrospheredata/hydro-serving/blob/2727c1b8b80a29ef2eeb7ed4904a784729165bce/docker-compose.yml#L78-L87
@tidylobster .. should this work? networks: hydronet: name: demo_hydronet driver: bridge
extnet: driver: bridge
@albertnanda It's enough to just throw away internal: true
parameter, which isolates the network. Bear in mind though, all of your services will be available from the outside in that configuration.
@tidylobster : This is my config file: networks: hydronet: name: demo_hydronet
ipam:
config:
- subnet: 172.16.0.0/24
extnet: driver: bridge
After updating docker-compose.yml, I did: 1. docker stop $(docker ps -aq) 2. docker rm $(docker ps -aq) 3. docker rmi $(docker images -aq) 4. docker-compose up -d 5. hs upload
My application can't still access internet.
I did docker exec -it
Probably, you haven't recreated networks to align with the new configuration. Check that demo_hydronet
network doesn't have internal
flag set to true
$ docker network inspect demo_hydronet | grep -i internal
@tidylobster My bad, you are right, I did - docker network rm $(docker network ls -q) and then deleted everything.. docker-compose up -d. It's working now. Thanks a lot. I do have one question, how can i make only one service access internet, instead of all the services. Is there a way to do it?
Unfortunately no - manager creates all containers within a defined network.
@KineticCookie Even with custom runtimes? Can I create a custom runtime and maybe copy config or something?
Runtime is basically a code with dependencies to lauch your models. Networking and other settings are defined in the infrastructure level, and can only be changed on deploy.
However you could try to create new network with internet access and connect desired container to in manually (https://docs.docker.com/engine/reference/commandline/network_connect/), but we didn't test such use cases and we can't guarantee that it will work.
@KineticCookie Think this is a dead end for me. Can you please plan to add this as a feature in your next version?
Hi,
I have created a service which will takes an url as input and use requests(python) to get the content. However, there seems to be a problem with name resolution. Here is the error message from runtime: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'. I am using the standard hydrosphere runtime.
Thanks, AN