用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/coreos/chunkah --skill benchmark-packing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | benchmark-packing |
| description | Benchmark chunkah packing algorithm changes against a series of OCI images. |
This skill guides benchmarking of packing algorithm changes by chunking a series of consecutive OCI images and measuring layer reuse between them. The key tools are:
tools/chunk-image-series.py -- chunks a series of imagestools/analyze-layer-reuse.py -- compares layer sharing across
the chunked seriesAfter making code changes, build the container image:
just buildimg --no-chunk
This produces localhost/chunkah:latest.
Source images must be in containers-storage. Either:
From OCI archives:
for archive in /path/to/*.ociarchive; do
version=$(echo "${archive}" | grep -oP 'PATTERN')
skopeo copy "oci-archive:${archive}" "containers-storage:localhost/myrepo:${version}"
done
From a registry:
chunk-image-series.py can pull directly from a registry:
tools/chunk-image-series.py docker://quay.io/fedora/fedora-coreos \
--tag-filter '43.*' --limit 10 ...
tools/chunk-image-series.py containers-storage:localhost/myrepo \
--tag-filter '43.*' \
--prefix myrepo-chunked \
--chunkah-image localhost/chunkah \
--force \
-- --prune /sysroot --max-layers 128
Key flags:
--force to overwrite results from prior runs--limit N to control how many images to process--Pass all chunked images as separate positional arguments:
image_args=()
for i in $(seq 0 9); do
image_args+=("containers-storage:localhost/myrepo-chunked:${i}")
done
tools/analyze-layer-reuse.py --json "${image_args[@]}" > results.json
IMPORTANT: do NOT use brace expansion inside quotes (e.g.
"...:{0,1,2}") -- it won't expand. Always build the argument
list explicitly.
The JSON summary fields are:
avg_reuse_ratio -- fraction of data shared (0.0 to 1.0)avg_download_bytes -- average new data per updateAlways clean up chunked images after capturing results:
for i in $(seq 0 9); do
podman rmi "localhost/myrepo-chunked:${i}" 2>/dev/null || true
done
Always measure the original (un-chunked) images as a baseline:
image_args=()
for tag in $(podman images --filter reference='localhost/myrepo' \
--format '{{.Tag}}' | sort); do
image_args+=("containers-storage:localhost/myrepo:${tag}")
done
tools/analyze-layer-reuse.py --json "${image_args[@]}" > original.json
To compare a code change against the current defaults:
quay.io/coreos/chunkah:dev)localhost/chunkahThe source images and original baseline can be reused across runs.
chunk-image-series.py creates temporary localhost/tmp-chunk-src
tags during chunking. These are cleaned up on exit, but if a prior
run was interrupted, stale tags may remain and cause duplicate
entries. Before running analysis, verify tags are clean:
podman images --filter reference='localhost/myrepo' --format '{{.Tag}}' | sort
If you see duplicate tags, remove them before proceeding. A red
flag in results is min_download_bytes: 0 -- this means two
consecutive images were identical (likely duplicates).
Results can vary significantly depending on the specific time window of builds tested. Always test against multiple independent corpora (e.g. different image types, different time periods) before concluding a change is beneficial. An improvement on one sample may not generalize.
The default --max-layers is 64. Results at 64 layers vs 128
layers can differ substantially. Always compare configurations at
the same layer count.