diff --git a/Justfile b/Justfile index 256881c6..323fb0ea 100644 --- a/Justfile +++ b/Justfile @@ -345,70 +345,6 @@ rechunk $image=default_image $tag=default_tag $flavor=default_flavor: CHUNKED_IMAGE="$(podman pull "oci:${CHUNKAH_OUTPUT_DIR}/chunked")" podman tag "${CHUNKED_IMAGE}" "${image_name}:${tag}" -# build-chunked-oci -[arg("flavor", long="flavor", short="f")] -[arg("ghcr", long="ghcr", value="true")] -[arg("image", long="image", short="i")] -[arg("previous_build", long="previous-build", value="true")] -[arg("tag", long="tag", short="t")] -[group('Image')] -ostree-rechunk $image=default_image $tag=default_tag $flavor=default_flavor $ghcr="false" $previous_build="false": - #!/usr/bin/env bash - set -eoux pipefail - - {{ just }} validate --image "${image}" --tag "${tag}" --flavor "${flavor}" - image_name=$({{ just }} image_name --image "${image}" --tag "${tag}" --flavor "${flavor}") - fedora_version=$({{ just }} fedora_version --image "${image}" --tag "${tag}" --flavor "${flavor}") - - if [[ "{{ ghcr }}" == "false" ]]; then - {{ just }} load-rootful --image "${image}" --tag "${tag}" --flavor "${flavor}" - fi - - # TODO: Redo everything here with --previous-build in rpm-ostree 2026.1+ - # so we don't have to pull an old image + rename it - if [[ "${previous_build}" == "true" ]]; then - PREVIOUS_IMAGE=ghcr.io/{{ repo_organization }}/"${image_name}":"${tag}" - - # https://github.com/coreos/rpm-ostree/blob/7e2f2065a4aa4d5965b4537bb7d74e0b2898650e/rust/src/compose.rs#L522-L529 - if skopeo inspect docker://"${PREVIOUS_IMAGE}" | jq -e '.LayersData[1:] | all(.Annotations?["ostree.components"]?)'; then - ${SUDOIF} ${PODMAN} pull ${PREVIOUS_IMAGE} - else - echo "${PREVIOUS_IMAGE} doesn't exist. Making a fresh layer Plan instead." - fi - fi - - if [[ "${ghcr}" == "true" ]]; then - CHUNKED_IMAGE="${image_name}:${tag}" - if [[ "${previous_build}" == "true" ]]; then - CHUNKED_IMAGE="${PREVIOUS_IMAGE}" - fi - else - # keep the original unrechunked image for local builds - CHUNKED_IMAGE="${image_name}:${tag}-chunked" - fi - - # 96 layers, conservative default, same what ci-test is using - # one layer is secretly being added for the ostree export - # 499 is podman run limit - # 128 is docker pull limit - ${SUDOIF} ${PODMAN} run --rm \ - --privileged \ - -v "/var/lib/containers:/var/lib/containers" \ - --entrypoint /usr/bin/rpm-ostree \ - "${base_image_org}/${base_image_name}:${fedora_version}" \ - compose build-chunked-oci \ - --max-layers 127 \ - --format-version=2 \ - --bootc \ - --from "localhost/${image_name}:${tag}" \ - --output containers-storage:${CHUNKED_IMAGE} - - # rename the image to localhost - if [[ "${ghcr}" == "true" && "${previous_build}" == "true" ]]; then - ${SUDOIF} ${PODMAN} tag ${CHUNKED_IMAGE} "${image_name}:${tag}" - ${SUDOIF} ${PODMAN} image rm -f ${CHUNKED_IMAGE} - fi - # For Privileged operations [arg("flavor", long="flavor", short="f")] [arg("image", long="image", short="i")]