@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
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')
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()
def main():
args = parse_args()
+ if args.version[0] != 'v':
+ args.version = f'v{args.version}'
if args.promote:
promote(args)
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 <ver>`` 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):
.. prompt:: bash
cd <ceph-checkout>/container
- ./make-manifest-list.py --promote
+ ./make-manifest-list.py --promote --version <ver>
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