#11843 Repush F38 flatpak runtimes to candidate registry
Closed: Fixed a year ago by kevin. Opened a year ago by otaylor.

[edited to fix some bugs for future documentation]

Pushing the Bodhi updates for the final F38 runtime builds is failing because the content got garbage collected from the candidate registry. The builds are still on Koji so it's possible to reconstruct.

Reconstructed tarball for flatpak-runtime: [https://otaylor.fedorapeople.org/flatpak-runtime-f38-3820231204155221.1.docker-v2s2.oci-archive.tar]

Push that to the candidate registry as:

podman login candidate-registry.fedoraproject.org
skopeo copy --all --format=v2s2 oci-archive:flatpak-runtime-f38-3820231204155221.1.docker-v2s2.oci-archive.tar docker://candidate-registry.fedoraproject.org/f38/flatpak-runtime:f38-3820231204155221.1

My fedorapeople.org quota is insufficient to upload the SDK, so here's how to reconstruct it (also serving as documentation for how I got the tarball above):

curl -O https://kojipkgs.fedoraproject.org//packages/flatpak-sdk/f38/3820231204155221.1/images/oci-image-sha256:10d0b8728c48f7d65cc63e099f0a8d9a48edd56d6d566b30f87f23ef9b97359a.x86_64.tar.gz
curl -O https://kojipkgs.fedoraproject.org//packages/flatpak-sdk/f38/3820231204155221.1/images/oci-image-sha256:93ab9c2af930eebc09a91c742908399cd222d74f009032e9e2a0e863e85dae54.aarch64.tar.gz
skopeo copy --format=v2s2 oci-archive:oci-image-sha256:10d0b8728c48f7d65cc63e099f0a8d9a48edd56d6d566b30f87f23ef9b97359a.x86_64.tar.gz oci:flatpak-sdk
skopeo copy --format=v2s2 oci-archive:oci-image-sha256:93ab9c2af930eebc09a91c742908399cd222d74f009032e9e2a0e863e85dae54.aarch64.tar.gz oci:flatpak-sdk
python3 make-index.py  # see below
mv 65d5a5c4d6629db90ade04ad39a35210b763e94464d5259ae90e0ad86add1963 flatpak-sdk/blobs/sha256/
mv index.json flatpak-sdk

# To make a tarball
skopeo copy --all --format=v2s2 oci:flatpak-sdk oci-archive:flatpak-sdk-f38-3820231204155221.1.docker-v2s2.oci-archive.tar

# To upload directly
skopeo copy --all --format=v2s2 oci:flatpak-sdk docker://candidate-registry.fedoraproject.org/f38/flatpak-sdk:f38-3820231204155221.1

Where make-index.py is:

#!/usr/bin/python3

import json
import sys
import hashlib

# flatpak-runtime-f38-3820231204155221.1
# manifests = [{
#     "digest": "sha256:a13ae0213f0766f75c638b0fc402b8c0881c567cc819f542eb937ba0ad222f0a",
#     "size": 430,
#     "architecture": "amd64",
# }, {
#     "digest": "sha256:e628918609920fb1219f128a68f49e2bb3604d7e481fbfac96db0e3cc9a0e06e",
#     "size": 431,
#     "architecture": "arm64"
# }]

# flatpak-sdk-f38-3820231204155221.1
manifests = [{
    "digest": "sha256:dcc3a3ce7fd11111e03c2c400f5c3d55ec5f54e74b5cbd51945d84d701a0928a",
    "size": 431,
    "architecture": "arm64",
}, {
    "digest": "sha256:85ace1da234c85e3e6313c21b231fd2722a2a4425dd468395fc5b937f20ed55d",
    "size": 431,
    "architecture": "amd64"
}]

manifest_list = json.dumps({
    "schemaVersion": 2,
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "manifests": sorted([
        {
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "size": m['size'],
            "digest": m['digest'],
            "platform": {
                "architecture": m['architecture'],
                "os": "linux"
            }
        } for m in manifests
    ], key=lambda entry: entry['platform']['architecture']),
}, indent=4, sort_keys=True, separators=(',', ': '))

manifest_list_bytes = manifest_list.encode("utf8")
digest = hashlib.sha256(manifest_list_bytes).hexdigest()

with open(digest, "wb") as f:
    f.write(manifest_list_bytes)

print(f"Wrote manifest list to {digest}")

index_json = json.dumps({
    "schemaVersion": 2,
    "manifests": [
        {
            "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
            "size": len(manifest_list_bytes),
            "digest": "sha256:" + digest,
        }
    ],
}, indent=4, sort_keys=True, separators=(',', ': '))

with open("index.json", "w") as f:
    f.write(index_json)

print("Wrote index.json")

Metadata Update from @phsmoura:
- Issue assigned to kevin
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: medium-gain, medium-trouble, ops

a year ago

ok....

these two didnt like the : in the filename...

skopeo copy --format=v2s2 oci-archive:oci-image-sha256:10d0b8728c48f7d65cc63e099f0a8d9a48edd56d6d566b30f87f23ef9b97359a.x86_64.tar.gz oci:flatpak-sdk
skopeo copy --format=v2s2 oci-archive:oci-image-sha256:93ab9c2af930eebc09a91c742908399cd222d74f009032e9e2a0e863e85dae54.aarch64.tar.gz oci:flatpak-sdk

I renamed the files with - instead of :

then creating the tar wasn't happy:

skopeo copy --format=v2s2 oci:flatpak-sdk oci-archive:flatpak-sdk-f38-3820231204155221.1.docker-v2s2.oci-archive.tar
FATA[0000] initializing source oci:flatpak-sdk:: more than one image in oci, choose an image

tried -a and --multi-arch all with no change. ;(

ditto the upload...

ok. Got it all sorted. The update is pushed to testing now.

Thanks!

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

a year ago

Metadata Update from @otaylor:
- Issue status updated to: Open (was: Closed)

a year ago

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

a year ago

Log in to comment on this ticket.

Metadata
Boards 1
ops Status: Backlog