diff --git a/contrib/busybox/Dockerfile b/contrib/busybox/Dockerfile new file mode 100644 index 00000000..4c1acc7d --- /dev/null +++ b/contrib/busybox/Dockerfile @@ -0,0 +1,3 @@ +FROM scratch +ADD busybox.tar.xz / +CMD ["sh"] diff --git a/contrib/busybox/build_image.sh b/contrib/busybox/build_image.sh new file mode 100755 index 00000000..8ec95710 --- /dev/null +++ b/contrib/busybox/build_image.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +tar cv --files-from /dev/null | docker import - scratch + +sudo docker build -t kuryr/busybox . diff --git a/contrib/busybox/busybox.tar.xz b/contrib/busybox/busybox.tar.xz new file mode 100644 index 00000000..ddcd4651 Binary files /dev/null and b/contrib/busybox/busybox.tar.xz differ diff --git a/devstack/plugin.sh b/devstack/plugin.sh index da7d5eb7..a6abd59e 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -155,6 +155,11 @@ if is_service_enabled kuryr-libnetwork; then done echo "" sudo chown "$STACK_USER":docker "$KURYR_DOCKER_ENGINE_SOCKET_FILE" + + echo "Build busybox docker image for fullstack and rally test" + cd $DEST/kuryr-libnetwork/contrib/busybox + sudo usermod -aG docker $STACK_USER + sh build_image.sh fi if [[ "$1" == "stack" && "$2" == "extra" ]]; then diff --git a/kuryr_libnetwork/tests/fullstack/test_container.py b/kuryr_libnetwork/tests/fullstack/test_container.py index 274f3f69..d2cadcab 100644 --- a/kuryr_libnetwork/tests/fullstack/test_container.py +++ b/kuryr_libnetwork/tests/fullstack/test_container.py @@ -22,7 +22,6 @@ class ContainerTest(kuryr_base.KuryrBaseTest): """ def setUp(self): super(ContainerTest, self).setUp() - self.docker_client.pull(repository='busybox', tag='1') fake_ipam = { "Driver": "kuryr", @@ -62,7 +61,7 @@ class ContainerTest(kuryr_base.KuryrBaseTest): # Test if support connect/disconnect operations container_name = lib_utils.get_random_string(8) container = self.docker_client.create_container( - image='busybox:1', + image='kuryr/busybox', command='/bin/sleep 600', hostname='kuryr_test_container', name=container_name) diff --git a/rally-jobs/plugins/context/docker_networks.py b/rally-jobs/plugins/context/docker_networks.py index 1e012a57..6e9edac5 100644 --- a/rally-jobs/plugins/context/docker_networks.py +++ b/rally-jobs/plugins/context/docker_networks.py @@ -53,8 +53,6 @@ class DockerNetworkContext(context.Context): """Create kuryr or non-kuryr docker network, and prepare image cache""" try: docker_client = docker.Client(base_url="tcp://0.0.0.0:2375") - # Cache busybox image - docker_client.pull(repository="busybox", tag="1") if self.config["is_kuryr"]: ipam = { diff --git a/rally-jobs/plugins/scenarios/utils.py b/rally-jobs/plugins/scenarios/utils.py index bdb5e8e5..86fa58a3 100644 --- a/rally-jobs/plugins/scenarios/utils.py +++ b/rally-jobs/plugins/scenarios/utils.py @@ -80,7 +80,7 @@ class KuryrScenario(scenario.OpenStackScenario): def _start_container(self, container_create_args=None): """Start Container on docker network.""" container = self.docker_client.create_container( - image='busybox:1', + image='kuryr/busybox', command='/bin/sleep 600') container_id = container.get('Id') self.docker_client.start(container=container_id)