#4287 Add new option for mock option - bootstrap_image_ready
Opened 2 months ago by jcupova. Modified 8 hours ago
jcupova/koji issue-3958  into  master

file modified
+2
@@ -469,6 +469,8 @@ 

                  cmd.append('--new-chroot')

              else:

                  cmd.append('--old-chroot')

+         if self.config['extra'].get('mock.bootstrap_image_ready', False):

+             cmd.append('--bootstrap-image-ready')

          cmd.extend(args)

          self.logger.info(format_shell_cmd(cmd))

          workdir = getattr(self, 'workdir', None)

@@ -1188,6 +1188,9 @@ 

          opts['bootstrap_image'] = buildcfg['extra']['mock.bootstrap_image']

      else:

          opts['use_bootstrap_image'] = False

+     if 'mock.bootstrap_image_ready' in buildcfg['extra']:

+         opts['bootstrap_image_ready'] = bool(buildcfg['extra']['mock.bootstrap_image_ready'])

+     # no else part as it would be driven by site-defaults.cfg

      if 'mock.use_bootstrap' in buildcfg['extra']:

          opts['use_bootstrap'] = buildcfg['extra']['mock.use_bootstrap']

      if 'mock.module_setup_commands' in buildcfg['extra']:

@@ -437,6 +437,11 @@ 

  

    - this option will automatically turn ``mock.use_bootstrap`` (this is how

      it is implemented in mock)

+ 

+ * ``mock.bootstrap_image_ready`` - For the specification that we are ready for bootstrapping.

+   If we want to specify, that we are ready for bootstrapping, we need to know that these

+   two packages `python3-dnf` and `python3-dnf-plugins-coreare installed in the container.

+ 

  * ``mock.module_setup_commands`` - commands for configuring the modules active

    in a buildroot. Available in `mock 2.4

    <https://github.com/rpm-software-management/mock/wiki/Release-Notes-2.4>`__.

@@ -254,6 +254,7 @@ 

                  'mock.yum.best': 10,

                  'mock.bootstrap_image': 'bootstrap_image_content',

                  'mock.use_bootstrap': True,

+                 'mock.bootstrap_image_ready': True,

                  'mock.module_setup_commands': 'module_setup_commands_content',

                  'mock.releasever': 'releasever_content',

              },
@@ -297,6 +298,7 @@ 

              'releasever': 'releasever_content',

              'use_bootstrap': True,

              'use_bootstrap_image': True,

+             'bootstrap_image_ready': True,

              'yum_best': 10,

          })

  

rebased onto d1c0d77

2 months ago

More simple:

if self.config['extra'].get('mock.bootstrap_image_ready', False):

Not necessarily true - e.g. buildcfg['extra']['mock.bootstrap_image_ready'] = False In fact, next lines ('use_bootstrap') should be also fixed. People sometimes don't delete the extra record, just set it to False. So,

if 'mock.bootstrap_image_ready' in buildcfg['extra']:
    opts['bootstrap_image_ready'] = bool(buildcfg['extra']['mock.bootstrap_image_ready']
# no else part as it would be driven by site-defaults.cfg

This is not right place. It should be part of https://docs.pagure.org/koji/using_the_koji_build_system/#tuning-mock-s-behavior-per-tag Also, the next command is not true (container needs these packages, but not the builder)

rebased onto 310d087

2 months ago

rebased onto 310d087

2 months ago

rebased onto 310d087

2 months ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 months ago

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready
- Pull-request tagged with: testing-basic

8 hours ago