#6897 prepare push-two-week-atomic for f26 first release
Merged 6 years ago by maxamillion. Opened 6 years ago by dustymabe.
dustymabe/releng dusty-f26-atomic  into  master

file modified
+47 -10
@@ -47,7 +47,8 @@ 

  

  # Define "constants"

  ATOMIC_DIR = "/mnt/koji/mash/atomic/%s"

- TARGET_REF = "fedora-atomic/%s/x86_64/docker-host"

+ PREVIOUS_MAJOR_RELEASE_FINAL_COMMIT = 'ce555fa89da934e6eef23764fb40e8333234b8b60b6f688222247c958e5ebd5b'

+ TARGET_REF = "fedora/%s/x86_64/atomic-host"

  COMPOSE_BASEDIR = "/mnt/koji/compose/twoweek/"

  MASHER_LOCKFILE_GLOB = "/mnt/koji/mash/updates/MASHING*"

  
@@ -557,19 +558,51 @@ 

                      "prune_old_composes: command failed: {}".format(prune_cmd)

                  )

  

+ def generate_static_delta(release, old_commit, new_commit):

+     """

+     generate_static_delta

  

- def move_tree_commit(release, old_commit, new_commit):

-     log.info("Creating diff")

+         Generate a static delta betwee two commits

+ 

+     :param release - the Fedora release to target (25,26,etc)

+     :param old_commit - starting point for delta

+     :param new_commit - ending point for delta

+     """

      # Run as apache user because the files we are editing/creating

      # need to be owned by the apache user

      diff_cmd = ["/usr/bin/sudo", "-u", "apache",

                  "ostree", "static-delta", "generate", "--repo",

                  ATOMIC_DIR % release, "--if-not-exists", "--from", old_commit,

                  "--to", new_commit]

+     log.info("Creating Static Delta from %s to %s" % (old_commit, new_commit))

      if subprocess.call(diff_cmd):

-         log.error("move_tree_commit: diff generation failed: %s", diff_cmd)

+         log.error("generate_static_delta: diff generation failed: %s", diff_cmd)

          exit(3)

  

+ def update_ostree_summary_file(release):

+     """

+     update_ostree_summary_file

+ 

+         Update the summary file for the ostree repo

+ 

+     :param release - the Fedora release to target (25,26,etc)

+     """

+     # Run as apache user because the files we are editing/creating

+     # need to be owned by the apache user

+     summary_cmd = ["/usr/bin/sudo", "-u", "apache",

+                    "ostree", "summary", "-u", "--repo",

+                    ATOMIC_DIR % release]

+     log.info("Updating Summary file")

+     if subprocess.call(summary_cmd):

+         log.error("update_ostree_summary_file: update failed: %s", summary_cmd)

+         exit(3)

+ 

+ def move_tree_commit(release, old_commit, new_commit):

+     generate_static_delta(release=release,

+                           old_commit=old_commit,

+                           new_commit=new_commit)

+ 

+     log.info("Moving ref %s to commit %s" %(TARGET_REF, new_commit))

      reset_cmd = ['/usr/bin/sudo', '-u', 'apache',

                   'ostree', 'reset', TARGET_REF % release,

                   new_commit, '--repo', ATOMIC_DIR % release]
@@ -577,12 +610,8 @@ 

          log.error("move_tree_commit: resetting ref to new commit failed: %s", reset_cmd)

          exit(3)

  

-     summary_cmd = ["/usr/bin/sudo", "-u", "apache",

-                    "ostree", "summary", "-u", "--repo",

-                    ATOMIC_DIR % release]

-     if subprocess.call(summary_cmd):

-         log.error("move_tree_commit: summary update failed: %s", summary_cmd)

-         exit(3)

+     update_ostree_summary_file(release)

+ 

  

  

  if __name__ == '__main__':
@@ -701,6 +730,14 @@ 

          log.info("Moving tree commit %s => %s (%s)", previous_commit, tree_commit, tree_version)

          move_tree_commit(pargs.release, previous_commit, tree_commit)

  

+     # Also, if existing previous release commit is defined, then

+     # generate a static delta from it

+     if PREVIOUS_MAJOR_RELEASE_FINAL_COMMIT is not None:

+         generate_static_delta(release=pargs.release,

+                               old_commit=PREVIOUS_MAJOR_RELEASE_FINAL_COMMIT,

+                               new_commit=tree_commit)

+         update_ostree_summary_file(pargs.release)

+ 

      log.info("Staging release content in /pub/alt/atomic/stable/")

      stage_atomic_release(compose_id)

  

atomic: update ref for f26
atomic: create generate_static_delta function
atomic: create update_ostree_summary_file function
atomic: add code for delta creation of f25 commit
atomic: define the last released commit for f25

Each commit should stand on its own pretty well. With this PR
I am proposing that on two week release we add a static delta
creation of a delta from Fedora 25's last commit.

rebased

6 years ago

5 new commits added

  • atomic: define the last released commit for f25
  • atomic: add code for delta creation of f25 commit
  • atomic: create update_ostree_summary_file function
  • atomic: create generate_static_delta function
  • atomic: update ref for f26
6 years ago

Pull-Request has been merged by maxamillion

6 years ago
Metadata