Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-13762

Performance issues when using registries.conf

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • 4.14.0
    • 4.13.0
    • oc-mirror
    • No
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      When using the --oci-registries-config flag explicitly or getting registries.conf from the environment, execution time when processing related images via the addRelatedImageToMapping function serially can drastically impact performance depending on the number of images involved. In my testing of a large catalog, there were approximately 470 images and this took approximately 13 minutes. This processing occurs prior to letting the underlying oc mirror code plan out the images that should be mirrored. Actual planning time is consistent at around 1 min 30 seconds.

      The cause of this is due to the need to determine mirrors for each one of the related images based on the configuration provided in registries.conf, and this action is done serially in a loop. If I introduce parallel execution, the processing time for addRelatedImageToMapping is reduced from ~13 min to ~14 seconds.

      Version-Release number of selected component (if applicable): 4.13

      How reproducible: always

      Steps to Reproduce:

      Note: the catalog used here is publicly available, but the related images are not so this may be difficult to reproduce.

      1. Copy catalog image to disk in OCI layout
        mkdir -p /tmp/oci/registriesconf/performance
        skopeo --override-os linux copy docker://quay.io/jhunkins/ocp13762:v1 oci:///tmp/oci/registriesconf/performance --format v2s2
        
      2. Create a ~/.config/containers/registries.conf file with this content
        [[registry]]
        location = "icr.io/cpopen"
        insecure = false
        blocked = false
        mirror-by-digest-only = true
        prefix = ""
        [[registry.mirror]]
          location = "quay.io/jhunkins"
          insecure = false
        
      3. Create a ISC [path to isc]/isc-registriesconf-performance.yaml
        kind: ImageSetConfiguration
        apiVersion: mirror.openshift.io/v1alpha2
        mirror: 
          operators: 
          - catalog: oci:///tmp/oci/registriesconf/performance
            full: true
            targetTag: latest
            targetCatalog: ibm-catalog
        storageConfig: 
          local: 
            path: /tmp/oc-mirror-temp
        
      4. run oc mirror with OCI flags (running with dry run is sufficient to replicate this issue)
        oc mirror --config [path to isc]/isc-registriesconf-performance.yaml --include-local-oci-catalogs --oci-insecure-signature-policy --dest-use-http docker://localhost:5000/oci --skip-cleanup --dry-run
        

      Actual results:

      roughly 13 minutes elapses before the planning phase begins

      Expected results:

      much faster execution before the planning phase begins

      Additional info:

      I intend to create a PR which adds parallel execution around the addRelatedImageToMapping function

              luzuccar@redhat.com Luigi Mario Zuccarelli
              jhunkins@redhat.com John Hunkins (Inactive)
              ying zhou ying zhou
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: