You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RHOAIENG-26264: throttle concurrent skopeo invocations to at most 22 concurrent skopeo instances running (opendatahub-io#1165)
* RHOAIENG-26264: throttle concurrent skopeo invocations
Implements throttling for concurrent skopeo invocations in the
`scripts/update-commit-latest-env.py` script by using an asyncio.Semaphore.
This change addresses issue opendatahub-io#1158.
The script now uses a semaphore to limit the number of concurrent
`skopeo inspect` operations to 22. This helps to:
- Avoid overwhelming container registries with too many requests.
- Prevent potential rate limiting issues.
- Provide more stable execution under different network conditions.
The `get_image_vcs_ref` function was updated to accept a semaphore,
and the `inspect` function was updated to create and manage the
semaphore, passing it to the image inspection tasks.
* Revert: Revert accidental commit of test file
This commit reverts the changes made to
`manifests/base/params-latest.env` which was
accidentally included in the previous commit (feat: Throttle concurrent
skopeo invocations).
The `params-latest.env` file in that location was created
for testing purposes during development and should not be part of the
final changeset. This commit restores it to its state prior to that
accidental modification.
* Refactor: Reduce semaphore scope in get_image_vcs_ref
This commit refactors the get_image_vcs_ref function in
`scripts/update-commit-latest-env.py`.
The scope of the asyncio.Semaphore is now reduced to cover only the
`asyncio.create_subprocess_exec` call for `skopeo` and the subsequent
`process.communicate()` call.
Processing of the skopeo output (JSON parsing, label extraction, and
associated logging) has been moved outside of the semaphore block.
This change is made to improve code clarity and provide a smaller diff
for review, as per your feedback. The performance impact is expected
to be negligible for this specific script, but the change aligns with
best practices for minimizing resource holding time.
* Revert: Correct state of manifests/base/params-latest.env
This commit ensures that `manifests/base/params-latest.env` is
restored to its state prior to the recent refactoring commit
("Refactor: Reduce semaphore scope in get_image_vcs_ref").
The file `manifests/base/params-latest.env` was
unintentionally included in that refactoring commit. This commit
reverts that specific file to the version present in the preceding
commit ("Revert: Revert accidental commit of test file"), which
should represent its correct state before the recent series of changes
related to skopeo throttling.
* Revert: Ensure correct state of manifests/base/params-latest.env
This commit reverts the accidental inclusion of a test version of
`manifests/base/params-latest.env` that occurred during the
commit for a PEP 8 indentation fix ("Fix: Correct PEP 8
indentation in JSONDecodeError logging").
The file `manifests/base/params-latest.env` has been restored
to its state from the commit prior to that indentation fix,
which should be its correct, intended version.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
0 commit comments