From: Dan Mick Date: Mon, 16 Mar 2026 20:13:30 +0000 (-0700) Subject: container/make-manifest-list.py: add version support X-Git-Tag: v21.0.0~5^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5a92b13f3c95c833b40f89a54f20bb810871d6b;p=ceph.git container/make-manifest-list.py: add version support Add mandatory -v/--version to select version to examine (to allow multiple prerelease tags to exist). Reorder arguments so that usage help in the 'missing version' case shows the long option names. Requires change to ceph-release-containers job as well to pass the --version argument. This commit is part of a PR that includes an update to the "promote" invocation of make-manifest-list.py, which is done manually and must also contain the --version argument. Signed-off-by: Dan Mick --- diff --git a/container/make-manifest-list.py b/container/make-manifest-list.py index 27b00cc4777..085c1121689 100755 --- a/container/make-manifest-list.py +++ b/container/make-manifest-list.py @@ -77,14 +77,17 @@ def run_command_show_failure(args): @functools.lru_cache -def get_tags(path): +def get_tags(path, version=None): cmdout = get_command_output(f'skopeo list-tags docker://{path}') - return json.loads(cmdout)['Tags'] + alltags = json.loads(cmdout)['Tags'] + if version is None: + return alltags + return [t for t in alltags if t.startswith(version)] -def get_latest_tag(path): +def get_latest_tag(path, version): try: - latest_tag = get_tags(path)[-1] + latest_tag = get_tags(path, version)[-1] except IndexError: return None return latest_tag @@ -121,13 +124,13 @@ def get_all_matching_digest_tags(path, tag): def parse_args(): ap = argparse.ArgumentParser() - ap.add_argument('-n', '--dry-run', action='store_true', help='do all local manipulations but do not push final containers to MANIFEST_HOST, or in --promote, calculate but do not copy images to release host') - ap.add_argument('-P', '--promote', action='store_true', help='promote newest prerelease manifest container to released (move from MANIFEST_HOST to RELEASE_MANIFEST_HOST') + ap.add_argument('--dry-run', '-n', action='store_true', help='do all local manipulations but do not push final containers to MANIFEST_HOST, or in --promote, calculate but do not copy images to release host') + ap.add_argument('--promote', '-P', action='store_true', help='promote newest prerelease manifest container to released (move from MANIFEST_HOST to RELEASE_MANIFEST_HOST') + ap.add_argument('--version', '-v', required=True, help='operate on this version (leading string of container tag, like v20.2.0)') args = ap.parse_args() return args def build_prerelease(sysargs): - global args arch_specific_host = os.environ.get('ARCH_SPECIFIC_HOST', 'quay.ceph.io') amd64_repo = os.environ.get('AMD64_REPO', 'ceph/prerelease-amd64') @@ -218,7 +221,7 @@ def promote(sysargs): manifest_path = f'{manifest_host}/{manifest_repo}' release_path = f'{release_manifest_host}/{release_manifest_repo}' - latest_tag = get_latest_tag(manifest_path) + latest_tag = get_latest_tag(manifest_path, sysargs.version) all_tags = get_all_matching_digest_tags(manifest_path, latest_tag) copypaths = list() @@ -241,6 +244,8 @@ def promote(sysargs): def main(): args = parse_args() + if args.version[0] != 'v': + args.version = f'v{args.version}' if args.promote: promote(args) diff --git a/doc/dev/release-process.rst b/doc/dev/release-process.rst index 1b707b5b1d1..7a5781b0e99 100644 --- a/doc/dev/release-process.rst +++ b/doc/dev/release-process.rst @@ -265,7 +265,7 @@ This job: or "fat" container image and pushes it to ``quay.ceph.io/ceph/prerelease`` Finally, when all appropriate testing and verification is done on the -container images, run ``make-manifest-list.py --promote`` from the Ceph +container images, run ``make-manifest-list.py --promote --version `` from the Ceph source tree (at ``container/make-manifest-list.py``) to promote them to their final release location on ``quay.io/ceph/ceph`` (you must ensure that you're logged into ``quay.io/ceph`` and ``quay.ceph.io/ceph`` with appropriate permissions): @@ -273,7 +273,7 @@ that you're logged into ``quay.io/ceph`` and ``quay.ceph.io/ceph`` with appropri .. prompt:: bash cd /container - ./make-manifest-list.py --promote + ./make-manifest-list.py --promote --version The ``--promote`` step should be performed only as the final step in releasing containers, after the container images have been tested and have been confirmed