#841 kojid: make install timeout of imagefactory conf configurable
Merged 4 years ago by mikem. Opened 4 years ago by julian8628.
julian8628/koji issue/837  into  master

file modified
+5 -4
@@ -3519,8 +3519,8 @@ 

              #IF specific

              'imgdir': os.path.join(self.workdir, 'scratch_images'),

              'tmpdir': os.path.join(self.workdir, 'oz-tmp'),

-             'verbose' : True,

-             'timeout': 7200,

+             'verbose': True,

+             'timeout': self.options.oz_install_timeout or None,

              'output': 'log',

              'raw': False,

              'debug': True,
@@ -5666,7 +5666,7 @@ 

                  'max_retries': 120,

                  'offline_retry': True,

                  'offline_retry_interval': 120,

-                 'keepalive' : True,

+                 'keepalive': True,

                  'timeout' : None,

                  'no_ssl_verify' : False,

                  'use_fast_upload': True,
@@ -5681,6 +5681,7 @@ 

                                       'resolver-status.properties *.lastUpdated',

                  'failed_buildroot_lifetime' : 3600 * 4,

                  'rpmbuild_timeout' : 3600 * 24,

+                 'oz_install_timeout': 0,

                  'cert': None,

                  'ca': '',  # FIXME: Unused, remove in next major release

                  'serverca': None}
@@ -5688,7 +5689,7 @@ 

          for name, value in config.items('kojid'):

              if name in ['sleeptime', 'maxjobs', 'minspace', 'retry_interval',

                          'max_retries', 'offline_retry_interval', 'failed_buildroot_lifetime',

-                         'timeout', 'rpmbuild_timeout',]:

+                         'timeout', 'rpmbuild_timeout', 'oz_install_timeout',]:

                  try:

                      defaults[name] = int(value)

                  except ValueError:

file modified
+5
@@ -38,6 +38,11 @@ 

  ; Timeout for build duration (24 hours)

  ; rpmbuild_timeout=86400

  

+ ; Install timeout(seconds) for image build

+ ; Default value is 0, which means using the number in /etc/oz/oz.cfg,

+ ; supported since oz-0.16.0

+ ; oz_install_timeout=7200

+ 

  ; The URL for the xmlrpc server

  server=http://hub.example.com/kojihub

  

@@ -660,6 +660,11 @@ 

      #.  python-psphere => 0.5

      #.  VMDKStream => 0.2

      #.  pykickstart

+ #.  Edit ``/etc/kojid/kojid.conf``, and set an second value, eg: 7200 for

+     ``oz_install_timeout``. It's a timeout waiting guest installing. Default

+     value is 0, that means oz will use its default value. Since ``oz-0.16.0``,

+     it can be configured in ``/etc/oz/oz.cfg`` as ``install`` in ``[timeouts]``

+     section.

  #.  Edit ``/etc/oz/oz.cfg``, and set the memory value in the ``[libvirt]``

      section to at least 2048. Set ``safe_generation`` under ``[icicle]`` to yes.

  #.  Run: ``mkdir -p ~root/.psphere/templates``, and then copy the following

related PR #837
fixes #842

make this value configurable,

if it's not specified in kojid.conf, passing None to imagefactory, who will tell oz to use default timeout which can be specified in /etc/oz/oz.cfg since oz-0.16.0

This defaults to None, where before we had a fixed value of 7200.

When options.oz_install_timeout is None, we pass that along, which leads me to wonder:

  • is there a difference between passing timeout: None and leaving it out?
  • or for that matter, does it have a different meaning from a timeout of 0?
  • is the None value useful? If so, should we provide a way for the user to specify it explicitly?

is there a difference between passing timeout: None and leaving it out?

If moving 'timeout' key from imagefactory configuration dict, imagefactory will raise KeyError

or for that matter, does it have a different meaning from a timeout of 0?

Aha, 0 is actually ZERO on oz, it won't wait and throw timeout error immediately

is the None value useful? If so, should we provide a way for the user to specify it explicitly?

None value tells oz to use the number in /etc/oz/oz.cfg.
I added some comments in default kojid.conf. I'm going to add notes in docs.

1 new commit added

  • add explanation in image_build.rst
4 years ago

added explanation in image_build.rst

:+1: Thank you @julian8628 for working on this patch.

We need this patch in F27 koji build in order to configure timeout to fix cloud-base image failure for s390x in F28.

Aha, 0 is actually ZERO on oz, it won't wait and throw timeout error immediately

So presumably no one would ever want to do this.

None value tells oz to use the number in /etc/oz/oz.cfg.
I added some comments in default kojid.conf. I'm going to add notes in docs.

The None value is important, but there is no way explicitly configure this since oz_install_timeout is parsed strictly as an int.

Perhaps we should check for the zero value and pass None in that case instead (unless someone can think of a reason to use a literal timeout of zero).

If we did this, then we could continue to have a default timeout.

rebased onto 6b05300

4 years ago

Commit b64151d fixes this pull-request

Pull-Request has been merged by mikem

4 years ago