diff --git a/docker/ceilometer/ceilometer-base/Dockerfile.j2 b/docker/ceilometer/ceilometer-base/Dockerfile.j2 index 3763851692..8a469d43fc 100644 --- a/docker/ceilometer/ceilometer-base/Dockerfile.j2 +++ b/docker/ceilometer/ceilometer-base/Dockerfile.j2 @@ -10,8 +10,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD ceilometer-base.tar / -RUN ln -s /ceilometer-* ceilometer \ +ADD ceilometer-base-archive /ceilometer-base-source +RUN ln -s ceilometer-base-source/* ceilometer \ && useradd --user-group ceilometer \ && pip --no-cache-dir install /ceilometer \ && mkdir -p /etc/ceilometer /var/log/ceilometer /home/ceilometer \ diff --git a/docker/cinder/cinder-base/Dockerfile.j2 b/docker/cinder/cinder-base/Dockerfile.j2 index 72879e883a..21a808f9cc 100644 --- a/docker/cinder/cinder-base/Dockerfile.j2 +++ b/docker/cinder/cinder-base/Dockerfile.j2 @@ -33,8 +33,8 @@ RUN apt-get install -y --no-install-recommends lvm2 \ {% endif %} -ADD cinder-base.tar / -RUN ln -s /cinder-* cinder \ +ADD cinder-base-archive /cinder-base-source +RUN ln -s cinder-base-source/* cinder \ && useradd --user-group cinder \ && pip --no-cache-dir install /cinder \ && mkdir -p /etc/cinder /var/log/cinder /home/cinder \ diff --git a/docker/designate/designate-base/Dockerfile.j2 b/docker/designate/designate-base/Dockerfile.j2 index f4894f0375..340b98c4de 100644 --- a/docker/designate/designate-base/Dockerfile.j2 +++ b/docker/designate/designate-base/Dockerfile.j2 @@ -25,8 +25,8 @@ RUN echo '{{ install_type}} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD designate-base.tar / -RUN ln -s /designate-* designate \ +ADD designate-base-archive /designate-base-source +RUN ln -s designate-base-source/* designate \ && useradd --user-group designate \ && pip --no-cache-dir install /designate \ && mkdir -p /etc/designate /var/log/designate /home/designate \ diff --git a/docker/glance/glance-base/Dockerfile.j2 b/docker/glance/glance-base/Dockerfile.j2 index 80b61ec16c..e447b265c0 100644 --- a/docker/glance/glance-base/Dockerfile.j2 +++ b/docker/glance/glance-base/Dockerfile.j2 @@ -17,8 +17,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD glance-base.tar / -RUN ln -s /glance-* glance \ +ADD glance-base-archive /glance-base-source +RUN ln -s glance-base-source/* glance \ && useradd --user-group glance \ && pip --no-cache-dir install /glance \ && mkdir -p /etc/glance /var/log/glance /home/glance \ diff --git a/docker/gnocchi/gnocchi-base/Dockerfile.j2 b/docker/gnocchi/gnocchi-base/Dockerfile.j2 index e2de1b5796..343f239bfe 100644 --- a/docker/gnocchi/gnocchi-base/Dockerfile.j2 +++ b/docker/gnocchi/gnocchi-base/Dockerfile.j2 @@ -14,8 +14,8 @@ RUN apt-get install -y --no-install-recommends libpq-dev \ {% endif %} -ADD gnocchi-base.tar / -RUN ln -s /gnocchi-* gnocchi \ +ADD gnocchi-base-archive /gnocchi-base-source +RUN ln -s gnocchi-base-source/* gnocchi \ && useradd --user-group gnocchi \ && pip --no-cache-dir install /gnocchi \ && mkdir -p /etc/gnocchi /var/log/gnocchi /home/gnocchi \ diff --git a/docker/heat/heat-base/Dockerfile.j2 b/docker/heat/heat-base/Dockerfile.j2 index 4accc807e2..38e88935f0 100644 --- a/docker/heat/heat-base/Dockerfile.j2 +++ b/docker/heat/heat-base/Dockerfile.j2 @@ -16,8 +16,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD heat-base.tar / -RUN ln -s /heat-* heat \ +ADD heat-base-archive /heat-base-source +RUN ln -s heat-base-source/* heat \ && useradd --user-group heat \ && pip --no-cache-dir install /heat \ && mkdir -p /etc/heat /var/log/heat /home/heat \ diff --git a/docker/horizon/Dockerfile.j2 b/docker/horizon/Dockerfile.j2 index 7535624079..f7af3d4925 100644 --- a/docker/horizon/Dockerfile.j2 +++ b/docker/horizon/Dockerfile.j2 @@ -50,8 +50,8 @@ RUN apt-get install -y --no-install-recommends \ {% endif %} -ADD horizon.tar / -RUN ln -s /horizon-* horizon \ +ADD horizon-archive /horizon-source +RUN ln -s horizon-source/* horizon \ && pip --no-cache-dir install /horizon \ && useradd --user-group horizon \ && mkdir -p /etc/openstack-dashboard /home/horizon \ diff --git a/docker/ironic/ironic-base/Dockerfile.j2 b/docker/ironic/ironic-base/Dockerfile.j2 index b49d41b576..523c223ec1 100644 --- a/docker/ironic/ironic-base/Dockerfile.j2 +++ b/docker/ironic/ironic-base/Dockerfile.j2 @@ -20,8 +20,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD ironic-base.tar / -RUN ln -s /ironic-* ironic \ +ADD ironic-base-archive /ironic-base-source +RUN ln -s ironic-base-source/* ironic \ && useradd --user-group ironic \ && pip --no-cache-dir install /ironic \ && mkdir -p /etc/ironic /var/log/ironic /home/ironic \ diff --git a/docker/keystone/Dockerfile.j2 b/docker/keystone/Dockerfile.j2 index 9bb316a1a8..1a60da0ff3 100644 --- a/docker/keystone/Dockerfile.j2 +++ b/docker/keystone/Dockerfile.j2 @@ -49,8 +49,8 @@ RUN apt-get install -y --no-install-recommends \ {% endif %} -ADD keystone.tar / -RUN ln -s /keystone-* keystone \ +ADD keystone-archive /keystone-source +RUN ln -s keystone-source/* keystone \ && useradd --user-group keystone \ && pip --no-cache-dir install /keystone \ && mkdir -p /etc/keystone /var/www/cgi-bin/keystone /var/log/apache2 /home/keystone \ diff --git a/docker/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2 index 078d7027b6..aa81301b92 100644 --- a/docker/magnum/magnum-base/Dockerfile.j2 +++ b/docker/magnum/magnum-base/Dockerfile.j2 @@ -18,8 +18,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD magnum-base.tar / -RUN ln -s /magnum-* magnum \ +ADD magnum-base-archive /magnum-base-source +RUN ln -s magnum-base-source/* magnum \ && useradd --user-group magnum \ && pip --no-cache-dir install /magnum \ && mkdir -p /etc/magnum /var/log/magnum /home/magnum \ diff --git a/docker/murano/murano-base/Dockerfile.j2 b/docker/murano/murano-base/Dockerfile.j2 index 59bdc1cb7b..6564a87654 100644 --- a/docker/murano/murano-base/Dockerfile.j2 +++ b/docker/murano/murano-base/Dockerfile.j2 @@ -8,8 +8,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} -ADD murano-base.tar / -RUN ln -s /murano-* murano \ +ADD murano-base-archive /murano-base-source +RUN ln -s murano-base-source/* murano \ && useradd --user-group murano \ && pip --no-cache-dir install /murano \ && mkdir -p /etc/murano /var/log/murano /home/murano \ diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2 index c4dcde7ff8..4b96b68aba 100644 --- a/docker/neutron/neutron-base/Dockerfile.j2 +++ b/docker/neutron/neutron-base/Dockerfile.j2 @@ -31,8 +31,8 @@ RUN apt-get install -y --no-install-recommends \ {% endif %} -ADD neutron-base.tar / -RUN ln -s /neutron-* neutron \ +ADD neutron-base-archive /neutron-base-source +RUN ln -s neutron-base-source/* neutron \ && useradd --user-group neutron \ && pip --no-cache-dir install /neutron \ && mkdir -p /etc/neutron /usr/share/neutron /var/log/neutron /home/neutron \ diff --git a/docker/nova/nova-base/Dockerfile.j2 b/docker/nova/nova-base/Dockerfile.j2 index 0010cbaed8..f6ec8c3e13 100644 --- a/docker/nova/nova-base/Dockerfile.j2 +++ b/docker/nova/nova-base/Dockerfile.j2 @@ -39,8 +39,8 @@ RUN apt-get install -y --no-install-recommends \ {% endif %} -ADD nova-base.tar / -RUN ln -s /nova-* nova \ +ADD nova-base-archive /nova-base-source +RUN ln -s nova-base-source/* nova \ && useradd --user-group nova \ && pip --no-cache-dir install /nova \ && mkdir -p /etc/nova /var/log/nova /home/nova \ diff --git a/docker/nova/nova-novncproxy/Dockerfile.j2 b/docker/nova/nova-novncproxy/Dockerfile.j2 index a2fcf98cc8..1a90e4f01f 100644 --- a/docker/nova/nova-novncproxy/Dockerfile.j2 +++ b/docker/nova/nova-novncproxy/Dockerfile.j2 @@ -12,8 +12,8 @@ RUN yum -y install \ {% endif %} {% elif install_type == 'source' %} -ADD nova-novncproxy.tar / -RUN ln -s /kanaka-noVNC-* /usr/share/novnc +ADD nova-novncproxy-archive /nova-novncproxy-source +RUN ln -s nova-novncproxy-source/* /usr/share/novnc {% endif %} diff --git a/docker/swift/swift-base/Dockerfile.j2 b/docker/swift/swift-base/Dockerfile.j2 index 142f411b8c..6ffbe35778 100644 --- a/docker/swift/swift-base/Dockerfile.j2 +++ b/docker/swift/swift-base/Dockerfile.j2 @@ -15,8 +15,8 @@ RUN echo '{{ install_type}} not yet available for {{ base_distro }}' \ {% elif install_type == 'source' %} -ADD swift-base.tar / -RUN ln -s /swift-* swift \ +ADD swift-base-archive /swift-base-source +RUN ln -s swift-base-source/* swift \ && useradd --user-group swift \ && pip --no-cache-dir install /swift \ && mkdir -p /etc/swift /var/log/swift /home/swift \ diff --git a/docker/zaqar/Dockerfile.j2 b/docker/zaqar/Dockerfile.j2 index f05ea350a5..b20e8bd4e3 100644 --- a/docker/zaqar/Dockerfile.j2 +++ b/docker/zaqar/Dockerfile.j2 @@ -14,8 +14,8 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ {% endif %} {% elif install_type == 'source' %} -ADD zaqar.tar / -RUN ln -s /zaqar-* zaqar \ +ADD zaqar-archive /zaqar-source +RUN ln -s zaqar-source/* zaqar \ && useradd --user-group zaqar \ && pip --no-cache-dir install /zaqar \ && mkdir -p /etc/zaqar /var/log/zaqar /home/zaqar \ diff --git a/kolla/cmd/build.py b/kolla/cmd/build.py index 17142b54b0..437f19cc4f 100755 --- a/kolla/cmd/build.py +++ b/kolla/cmd/build.py @@ -88,27 +88,25 @@ class WorkerThread(Thread): def process_source(self, image): source = image['source'] - dest_dir = image['path'] - dest_tar = os.path.join(dest_dir, image['name'] + '.tar') + dest_archive = os.path.join(image['path'], image['name'] + '-archive') if source.get('type') == 'url': - LOG.debug("{}:Getting tarball from {}".format(image['name'], + LOG.debug("{}:Getting archive from {}".format(image['name'], source['source'])) r = requests.get(source['source']) if r.status_code == 200: - with open(dest_tar, 'wb') as f: + with open(dest_archive, 'wb') as f: f.write(r.content) else: LOG.error( - '{}:Failed to download tarball: status_code {}'.format( + '{}:Failed to download archive: status_code {}'.format( image['name'], r.status_code)) image['status'] = "error" return elif source.get('type') == 'git': - clone_dir = os.path.splitext(dest_tar)[0] + \ - '-' + source['reference'] + clone_dir = dest_archive + '-' + source['reference'] try: LOG.debug("{}:Cloning from {}".format(image['name'], source['source'])) @@ -125,7 +123,7 @@ class WorkerThread(Thread): image['status'] = "error" return - with tarfile.open(dest_tar, 'w') as tar: + with tarfile.open(dest_archive, 'w') as tar: tar.add(clone_dir, arcname=os.path.basename(clone_dir)) else: @@ -134,8 +132,8 @@ class WorkerThread(Thread): image['status'] = "error" return - # Set time on destination tarball to epoch 0 - os.utime(dest_tar, (0, 0)) + # Set time on destination archive to epoch 0 + os.utime(dest_archive, (0, 0)) def builder(self, image): LOG.debug('{}:Processing'.format(image['name']))