diff --git a/.zuul.d/base.yaml b/.zuul.d/base.yaml index 34a0a28479..8847eb55c9 100644 --- a/.zuul.d/base.yaml +++ b/.zuul.d/base.yaml @@ -45,7 +45,7 @@ pre-run: tests/playbooks/pre.yml run: tests/playbooks/run.yml post-run: tests/playbooks/post.yml - attempts: 1 + attempts: 5 irrelevant-files: - ^.*\.rst$ - ^doc/.* diff --git a/docker/barbican/barbican-api/Dockerfile.j2 b/docker/barbican/barbican-api/Dockerfile.j2 index e25e6fb058..a2bc60e46d 100644 --- a/docker/barbican/barbican-api/Dockerfile.j2 +++ b/docker/barbican/barbican-api/Dockerfile.j2 @@ -35,7 +35,7 @@ RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \ 'apache2', 'barbican-api', 'libapache2-mod-wsgi-py3', - 'uwsgi-plugin-python' + 'uwsgi-plugin-python3' ] %} {{ macros.install_packages(barbican_api_packages | customizable("packages")) }} diff --git a/docker/base/opendaylight.repo b/docker/base/opendaylight.repo index 44c1eb26d5..c1e8798c9e 100644 --- a/docker/base/opendaylight.repo +++ b/docker/base/opendaylight.repo @@ -1,6 +1,5 @@ [opendaylight] -name=CentOS CBS OpenDaylight Release Repository -# opendaylight package is not signed, so download from HTTPS source at least -baseurl=https://cbs.centos.org/repos/nfv7-opendaylight-6-release/x86_64/os/ +name=OpenDaylight Carbon +baseurl=https://nexus.opendaylight.org/content/repositories/opendaylight-carbon-epel-7-x86_64-devel/ enabled=1 gpgcheck=0 diff --git a/docker/prometheus/prometheus-openstack-exporter/Dockerfile.j2 b/docker/prometheus/prometheus-openstack-exporter/Dockerfile.j2 index ff5d55e130..9a5e17c94c 100644 --- a/docker/prometheus/prometheus-openstack-exporter/Dockerfile.j2 +++ b/docker/prometheus/prometheus-openstack-exporter/Dockerfile.j2 @@ -4,7 +4,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% block prometheus_openstack_exporter_header %}{% endblock %} {% block prometheus_openstack_exporter_repository_version %} -ENV prometheus_openstack_exporter_version=0.2.1 +ENV prometheus_openstack_exporter_version=0.6.0 {% endblock %} {% block prometheus_openstack_exporter_install %} diff --git a/docker/qdrouterd/Dockerfile.j2 b/docker/qdrouterd/Dockerfile.j2 index d9071cdefe..19ce0755b7 100644 --- a/docker/qdrouterd/Dockerfile.j2 +++ b/docker/qdrouterd/Dockerfile.j2 @@ -16,6 +16,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build 'qpid-dispatch-tools' ] %} +# make sure qpid is pulled from centos-openstack-RELEASE (RDO) repo +RUN yum-config-manager --disable epel centos-release-opstools extras + {{ macros.install_packages(qdrouterd_packages | customizable("packages")) }} {% elif base_package_type == 'deb' %} diff --git a/kolla/image/build.py b/kolla/image/build.py index 2e88061049..5fd2cde0ce 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -317,6 +317,11 @@ def run(self): self.success = True +class PushError(Exception): + """Raised when there is a problem with pushing image to repository.""" + pass + + class PushTask(DockerTask): """Task that pushes an image to a docker repository.""" @@ -340,6 +345,9 @@ def run(self): ' have the correct privileges to run Docker' ' (root)') image.status = STATUS_CONNECTION_ERROR + except PushError as exception: + self.logger.error(exception) + image.status = STATUS_PUSH_ERROR except Exception: self.logger.exception('Unknown error when pushing') image.status = STATUS_PUSH_ERROR @@ -364,8 +372,7 @@ def push_image(self, image): if 'stream' in response: self.logger.info(response['stream']) elif 'errorDetail' in response: - image.status = STATUS_ERROR - self.logger.error(response['errorDetail']['message']) + raise PushError(response['errorDetail']['message']) # Reset any previous errors. image.status = STATUS_BUILT diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index b0ce009a9a..f9b2deab0b 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -83,6 +83,7 @@ def test_push_image(self, mock_client): @mock.patch.dict(os.environ, clear=True) @mock.patch('docker.APIClient') def test_push_image_failure(self, mock_client): + """failure on connecting Docker API""" self.dc = mock_client mock_client().push.side_effect = Exception pusher = build.PushTask(self.conf, self.image) @@ -96,6 +97,7 @@ def test_push_image_failure(self, mock_client): @mock.patch.dict(os.environ, clear=True) @mock.patch('docker.APIClient') def test_push_image_failure_retry(self, mock_client): + """failure on connecting Docker API, success on retry""" self.dc = mock_client mock_client().push.side_effect = [Exception, []] pusher = build.PushTask(self.conf, self.image) @@ -112,6 +114,44 @@ def test_push_image_failure_retry(self, mock_client): self.assertTrue(pusher.success) self.assertEqual(build.STATUS_BUILT, self.image.status) + @mock.patch('docker.version', '3.0.0') + @mock.patch.dict(os.environ, clear=True) + @mock.patch('docker.APIClient') + def test_push_image_failure_error(self, mock_client): + """Docker connected, failure to push""" + self.dc = mock_client + mock_client().push.return_value = [{'errorDetail': {'message': + 'mock push fail'}}] + pusher = build.PushTask(self.conf, self.image) + pusher.run() + mock_client().push.assert_called_once_with( + self.image.canonical_name, decode=True, stream=True) + self.assertFalse(pusher.success) + self.assertEqual(build.STATUS_PUSH_ERROR, self.image.status) + + @mock.patch('docker.version', '3.0.0') + @mock.patch.dict(os.environ, clear=True) + @mock.patch('docker.APIClient') + def test_push_image_failure_error_retry(self, mock_client): + """Docker connected, failure to push, success on retry""" + self.dc = mock_client + mock_client().push.return_value = [{'errorDetail': {'message': + 'mock push fail'}}] + pusher = build.PushTask(self.conf, self.image) + pusher.run() + mock_client().push.assert_called_once_with( + self.image.canonical_name, decode=True, stream=True) + self.assertFalse(pusher.success) + self.assertEqual(build.STATUS_PUSH_ERROR, self.image.status) + + # Try again, this time without exception. + mock_client().push.return_value = [{'stream': 'mock push passes'}] + pusher.reset() + pusher.run() + self.assertEqual(2, mock_client().push.call_count) + self.assertTrue(pusher.success) + self.assertEqual(build.STATUS_BUILT, self.image.status) + @mock.patch.dict(os.environ, clear=True) @mock.patch('docker.APIClient') def test_build_image(self, mock_client):