From 61e69f1a63f83a27f885e9bc5618be13db11dd90 Mon Sep 17 00:00:00 2001 From: jhughesbiot <50999916+jhughesbiot@users.noreply.github.com> Date: Fri, 5 Apr 2024 02:09:15 -0600 Subject: [PATCH] Bug/docker network dns (#368) * Remove private network from network service containers * Remove private network creation and cleanup * Fix pylint --------- Co-authored-by: Jacob Boddey --- cmd/prune | 4 +++- framework/python/src/net_orc/network_orchestrator.py | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cmd/prune b/cmd/prune index ed9b4851d..9f471897d 100755 --- a/cmd/prune +++ b/cmd/prune @@ -36,4 +36,6 @@ fi # Remove docker networks echo Removing docker networks sudo docker network rm endev0 > /dev/null -sudo docker network rm tr-private-net > /dev/null \ No newline at end of file +# Private network not used, add cleanup +# back in if/when implemented +#sudo docker network rm tr-private-net > /dev/null \ No newline at end of file diff --git a/framework/python/src/net_orc/network_orchestrator.py b/framework/python/src/net_orc/network_orchestrator.py index 90dce8500..94c747758 100644 --- a/framework/python/src/net_orc/network_orchestrator.py +++ b/framework/python/src/net_orc/network_orchestrator.py @@ -357,7 +357,9 @@ def create_net(self): if 'CI' in os.environ: self._ci_post_network_create() - self._create_private_net() + # Private network not used, disable until + # a use case is determined + #self._create_private_net() # Listener may have already been created. Only create if not if self._listener is None: @@ -479,6 +481,7 @@ def _start_network_service(self, net_module): network = 'host' if net_module.net_config.host else PRIVATE_DOCKER_NET LOGGER.debug(f"""Network: {network}, image name: {net_module.image_name}, container name: {net_module.container_name}""") + try: client = docker.from_env() net_module.container = client.containers.run( @@ -487,7 +490,10 @@ def _start_network_service(self, net_module): cap_add=['NET_ADMIN'], name=net_module.container_name, hostname=net_module.container_name, - network=PRIVATE_DOCKER_NET, + # Undetermined version of docker seems to have broken + # DNS configuration (/etc/resolv.conf) Re-add when/if + # this network is utilized and DNS issue is resolved + #network=PRIVATE_DOCKER_NET, privileged=True, detach=True, mounts=net_module.mounts,