#9901 Use podman to create manifest for quay.io images
Opened 8 months ago by humaton. Modified 4 months ago
humaton/releng container_base_quay  into  main

@@ -72,6 +72,7 @@ 

      work_dir=$(mktemp -d)

      pushd ${work_dir} &> /dev/null

      koji download-build --type=image  ${build_name}

+     podman manifest create quay.io/fedora/fedora:${1}

      # Import the image

      for arch in "${ARCHES[@]}"

      do
@@ -82,10 +83,13 @@ 

              skopeo copy docker-archive:${build_name}.${arch}.tar docker://registry.fedoraproject.org/fedora:${1}-${arch}

              skopeo copy docker-archive:${build_name}.${arch}.tar docker://candidate-registry.fedoraproject.org/fedora:${1}-${arch}

              skopeo copy docker-archive:${build_name}.${arch}.tar docker://quay.io/fedora/fedora:${1}-${arch}

+             podman manifest add quay.io/fedora/fedora:${1} docker://quay.io/fedora/fedora:${1}-${arch}

+             podman manifest push quay.io/fedora/fedora:${1} docker://quay.io/fedora/fedora:${1}

          else

              registries=("registry.stg.fedoraproject.org" "candidate-registry.stg.fedoraproject.org")

              skopeo copy docker-archive:${build_name}.${arch}.tar docker://registry.stg.fedoraproject.org/fedora:${1}-${arch}

              skopeo copy docker-archive:${build_name}.${arch}.tar docker://candidate-registry.stg.fedoraproject.org/fedora:${1}-${arch}

+ 

          fi

      done

  
@@ -105,12 +109,15 @@ 

      done

      printf "Removing temporary directory\n"

      rm -rf $work_dir

+     podman rmi -f quay.io/fedora/fedora:${1}

+ 

  fi

  if [[ -n ${minimal_build_name} ]]; then

      # Download the image

      work_dir=$(mktemp -d)

      pushd ${work_dir} &> /dev/null

      koji download-build --type=image  ${minimal_build_name}

+     podman manifest create quay.io/fedora/fedora-minimal:${1}

      # Import the image

      for arch in "${ARCHES[@]}"

      do
@@ -120,6 +127,9 @@ 

              registries=("registry.fedoraproject.org" "candidate-registry.fedoraproject.org")

              skopeo copy docker-archive:${minimal_build_name}.${arch}.tar docker://registry.fedoraproject.org/fedora-minimal:${1}-${arch}

              skopeo copy docker-archive:${minimal_build_name}.${arch}.tar docker://candidate-registry.fedoraproject.org/fedora-minimal:${1}-${arch}

+             podman manifest add quay.io/fedora/fedora-minimal:${1} docker://quay.io/fedora/fedora-minimal:${1}-${arch}

+             podman manifest push quay.io/fedora/fedora-minimal:${1} docker://quay.io/fedora/fedora-minimal:${1}

+ 

          else

              registries=("registry.stg.fedoraproject.org" "candidate-registry.stg.fedoraproject.org")

              skopeo copy docker-archive:${minimal_build_name}.${arch}.tar docker://registry.stg.fedoraproject.org/fedora-minimal:${1}-${arch}
@@ -144,5 +154,5 @@ 

  

       printf "Removing temporary directory\n"

       rm -rf $work_dir

- 

+      podman rmi -f quay.io/fedora/fedora-minimal:${1}

  fi

Use podman to create and push image manifests to quay.io registry
Fix: releng#9880

@humaton When I tried to run podman manifest create ... twice, it errored out

 ~/pagure/ansible   centos-odcs $  
$ podman manifest create quay.io/fedora/fedora:test                                           114ms  Tue 15 Dec 2020 04:56:12 PM UTC
b8a5a29f364876e6bdcaaed40ed1d4198f044530851be3391a68dfbdf7631550
 ~/pagure/ansible   centos-odcs $  
$ podman manifest create quay.io/fedora/fedora:test                                           133ms  Tue 15 Dec 2020 04:56:14 PM UTC
Error: error creating manifest quay.io/fedora/fedora:test: error creating image to hold manifest list: image name "quay.io/fedora/fedora:test" is already associated with image "b8a5a29f364876e6bdcaaed40ed1d4198f044530851be3391a68dfbdf7631550": that name is already in use

We need to remove the remove the list, but I am not able to find the command to do so. podman manifest remove removes only the image in the list but not the list itself.

No idea here. Is there someone we can ask?

No idea here. Is there someone we can ask?

podman rmi should be good enough to delete manifests, see e.g. https://github.com/fedora-ci/eln-upload-container-images/blob/master/sync-latest-container-base-image.sh#L33 (which uses buildah, but that shouldn't matter).

I did that work a while back but somehow it broke registry.fp.o. This was the commit I pushed https://pagure.io/releng/c/0b3e9d5a53162245635e07b6f7e9b3a008da05cd?branch=main

At that time I did not had time to look at why registry.fp.o did not work with manifest generated by podman.

Metadata