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.
- 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
- 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
- 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
- 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
- is cloned by
-
OCPBUGS-13962 related image validation against catalog displays false positives
- Closed
- links to
-
RHEA-2023:5006 rpm