#218 New Pungi expects date in suffix for old compose in order to reuse it.
Merged 5 years ago by jkaluza. Opened 5 years ago by jkaluza.
jkaluza/odcs remove-hardlink  into  master

file modified
+2 -2
@@ -103,7 +103,7 @@ 

              log.info("Reusing repodata from old cached compose %s",

                       cached_compose_dir)

  

-             compose_dir_name = "odcs-%d-1-cached.n.0" % compose.id

+             compose_dir_name = "odcs-%d-1-19700101.n.0" % compose.id

              compose_dir = os.path.join(self.cache_dir, compose_dir_name)

  

              if os.path.exists(compose_dir):
@@ -115,7 +115,7 @@ 

          Cleans-up the configuration done by `reuse_cached`. Should be called

          once the image depending on cached image is built.

          """

-         compose_dir_name = "odcs-%d-1-cached.n.0" % compose.id

+         compose_dir_name = "odcs-%d-1-19700101.n.0" % compose.id

          compose_dir = os.path.join(self.cache_dir, compose_dir_name)

  

          if os.path.exists(compose_dir):

file modified
+1 -1
@@ -95,7 +95,7 @@ 

          self.cache.reuse_cached(c)

          copytree.assert_called_once_with(

              os.path.join(conf.target_dir, "koji_tag_cache/f26-0--x86_64"),

-             os.path.join(conf.target_dir, "koji_tag_cache/odcs-1-1-cached.n.0"),

+             os.path.join(conf.target_dir, "koji_tag_cache/odcs-1-1-19700101.n.0"),

              symlinks=True)

  

      @patch("shutil.copytree")

ODCS caches the old composes per the input Koji tag, so it can reuse some data from old compose to make the currently generating compose much more faster.

This stopped working after we updated to new Pungi. The new Pungi contains following code now: https://pagure.io/pungi/blob/master/f/pungi/util.py#_443 .

It expects the second character in suffix to be a digit. Before this PR, our suffix was "-cached", so it didn't work. In this PR, I just use very old date ("-19700101") in suffix, so the caching works again.

Pull-Request has been merged by jkaluza

5 years ago