From 661f2a45c26de322000ac6739bb1cea9c4b761d6 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Fri, 25 Nov 2016 00:14:20 -0600 Subject: Remove --include-header and --include-footer parameter In Newton, kolla moved to Dockerfile customization, and the parameters --included-header and --include-footer were marked deprecated. This patch set removes them in the Ocata release. Change-Id: I3263c305bf619ab47a31cf4eafe5d4fcfa4aec17 Closes-Bug: #1643967 --- doc/image-building.rst | 31 +++++----------------- kolla/common/config.py | 12 --------- kolla/image/build.py | 8 ------ ...-header-footer-parameters-68a6374635a8c9b0.yaml | 6 +++++ 4 files changed, 13 insertions(+), 44 deletions(-) mode change 100644 => 100755 kolla/image/build.py create mode 100644 releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml diff --git a/doc/image-building.rst b/doc/image-building.rst index a4ce5bb2d..96a14e07a 100644 --- a/doc/image-building.rst +++ b/doc/image-building.rst @@ -145,21 +145,14 @@ the best use of the docker cache. type = local location = /tmp/ironic.tar.gz -To build RHEL containers, it is necessary to use the ``-i`` (include header) -feature to include registration with RHN of the container runtime operating -system. To obtain a RHN username/password/pool id, contact Red Hat. - -First create a file called ``rhel-include``: - -:: +To build RHEL containers, it is necessary to include registration with RHN +of the container runtime operating system. To obtain a RHN +username/password/pool id, contact Red Hat. Use a template's header block +overrides file, add the following:: RUN subscription-manager register --user= --password= \ && subscription-manager attach --pool -Then build RHEL containers:: - - kolla-build -b rhel -i ./rhel-include - Dockerfile Customisation ======================== @@ -371,32 +364,22 @@ insecure registry. See Building behind a proxy ----------------------- -The build script supports augmenting the Dockerfiles under build via so called -`header` and `footer` files. Statements in the `header` file are included at -the top of the `base` image, while those in `footer` are included at the bottom -of every Dockerfile in the build. - -A common use case for this is to insert http_proxy settings into the images to +We can insert http_proxy settings into the images to fetch packages during build, and then unset them at the end to avoid having them carry through to the environment of the final images. Note however, it's not possible to drop the info completely using this method; it will still be visible in the layers of the image. -To use this feature, create a file called ``.header``, with the following -content for example:: +To set the proxy settings, we can add this to the template's header block:: ENV http_proxy=https://evil.corp.proxy:80 ENV https_proxy=https://evil.corp.proxy:80 -Then create another file called ``.footer``, with the following content:: +To unset the proxy settings, we can add this to the template's footer block:: ENV http_proxy="" ENV https_proxy="" -Finally, pass them to the build script using the ``-i`` and ``-I`` flags:: - - kolla-build -i .header -I .footer - Besides this configuration options, the script will automatically read these environment variables. If the host system proxy parameters match the ones going to be used, no other input parameters will be needed. These are the diff --git a/kolla/common/config.py b/kolla/common/config.py index 1c3c5d2e4..efd31bd38 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -76,18 +76,6 @@ _CLI_OPTS = [ help='Turn on debugging log level'), cfg.DictOpt('build-args', help='Set docker build time variables'), - cfg.StrOpt('include-header', short='i', - deprecated_for_removal=True, - deprecated_reason=('Use a header block within a template' - ' overrides file instead'), - help=('Path to custom file to be added at ' - 'beginning of base Dockerfile')), - cfg.StrOpt('include-footer', short='I', - deprecated_for_removal=True, - deprecated_reason=('Use a footer block within a template' - ' overrides file instead'), - help=('Path to custom file to be added at ' - 'end of Dockerfiles for final images')), cfg.BoolOpt('keep', default=False, help='Keep failed intermediate containers'), cfg.BoolOpt('list-dependencies', short='l', diff --git a/kolla/image/build.py b/kolla/image/build.py old mode 100644 new mode 100755 index 55ff7a11e..f84193be5 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -526,8 +526,6 @@ class KollaWorker(object): self.image_prefix = self.base + '-' + self.install_type + '-' - self.include_header = conf.include_header - self.include_footer = conf.include_footer self.regex = conf.regex self.image_statuses_bad = dict() self.image_statuses_good = dict() @@ -669,12 +667,6 @@ class KollaWorker(object): env.filters.update(self._get_filters()) env.globals.update(self._get_methods()) template = env.get_template(template_name) - if self.include_header: - with open(self.include_header, 'r') as f: - values['include_header'] = f.read() - if self.include_footer: - with open(self.include_footer, 'r') as f: - values['include_footer'] = f.read() content = template.render(values) content_path = os.path.join(path, 'Dockerfile') with open(content_path, 'w') as f: diff --git a/releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml b/releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml new file mode 100644 index 000000000..86008cb45 --- /dev/null +++ b/releasenotes/notes/remove-include-header-footer-parameters-68a6374635a8c9b0.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - The --include-header and --include-footer parameters were deprecated + as of the Newton release. They should be move use header and footer + block in template overrides file. The two parameters are removed in + the Ocata-release. -- cgit v1.2.3