Skip to content

Commit

Permalink
add arm64 too
Browse files Browse the repository at this point in the history
Signed-off-by: Yutaka Kondo <[email protected]>
  • Loading branch information
youtalk committed Nov 28, 2024
1 parent c0e7a90 commit 6ddf470
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/measure_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,15 @@ def auth(dxf, response):
dxf = DXF("ghcr.io", f"{DOCKER_ORGS}/{DOCKER_IMAGE}", auth)
for package in packages:
tag_count = len(package["metadata"]["container"]["tags"])
arch = "amd64"
if tag_count == 0:
continue
tag = package["metadata"]["container"]["tags"][0]
if not tag.endswith("amd64"):
if tag.endswith("amd64"):
arch = "amd64"
elif tag.endswith("arm64"):
arch = "arm64"
else:
continue
docker_image = ""
if "autoware-" in tag:
Expand Down Expand Up @@ -253,9 +258,14 @@ def auth(dxf, response):
if manifest is None:
print(f"Failed to fetch manifest for {tag}")
continue
metadata = json.loads(
(manifest["linux/amd64"] if type(manifest) is dict else manifest)
)
if type(manifest) is dict:
if arch is "amd64":
manifest = manifest["linux/amd64"]
elif arch is "arm64":
manifest = manifest["linux/arm64"]
else:
continue
metadata = json.loads(manifest)

total_size = sum([layer["size"] for layer in metadata["layers"]])
docker_images[docker_image].append(
Expand Down

0 comments on commit 6ddf470

Please sign in to comment.