Skip to content

Commit

Permalink
Bug/docker network dns (#368)
Browse files Browse the repository at this point in the history
* Remove private network from network service containers

* Remove private network creation and cleanup

* Fix pylint

---------

Co-authored-by: Jacob Boddey <[email protected]>
  • Loading branch information
jhughesbiot and jboddey authored Apr 5, 2024
1 parent 83a678e commit 61e69f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/prune
Original file line number Diff line number Diff line change
Expand Up @@ -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
# Private network not used, add cleanup
# back in if/when implemented
#sudo docker network rm tr-private-net > /dev/null
10 changes: 8 additions & 2 deletions framework/python/src/net_orc/network_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit 61e69f1

Please sign in to comment.