Skip to content

Commit 6477522

Browse files
author
lina-bh
committed
rechunk doesn't work. don't even pretend lad
1 parent ce6305c commit 6477522

File tree

2 files changed

+12
-54
lines changed

2 files changed

+12
-54
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4040

4141
# This is optional, but if you see that your builds are way too big for the runners, you can enable this by uncommenting the following lines:
42-
- name: Maximize build space
43-
uses: ublue-os/remove-unwanted-software@517622d6452028f266b7ba4cc9a123b5f58a6b53 # v7
44-
with:
45-
remove-codeql: true
42+
# - name: Maximize build space
43+
# uses: ublue-os/remove-unwanted-software@517622d6452028f266b7ba4cc9a123b5f58a6b53 # v7
44+
# with:
45+
# remove-codeql: true
4646

4747
- name: Setup just
4848
uses: extractions/setup-just@v3
@@ -125,15 +125,10 @@ jobs:
125125
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
126126
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
127127
id: push
128-
env:
129-
REGISTRY_USER: ${{ github.actor }}
130-
REGISTRY_PASSWORD: ${{ github.token }}
131128
with:
132129
registry: ${{ steps.registry_case.outputs.lowercase }}
133130
image: ${{ steps.image_case.outputs.lowercase }}
134131
tags: ${{ steps.metadata.outputs.tags }}
135-
username: ${{ env.REGISTRY_USER }}
136-
password: ${{ env.REGISTRY_PASSWORD }}
137132
extra-args: |
138133
--compression-format=zstd
139134

Justfile

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -106,59 +106,22 @@ sudoif command *args:
106106
# Build the image using the specified parameters
107107
build $target_image=image_name $tag=default_tag $dx="0" $hwe="0" $gdx="0":
108108
#!/usr/bin/env bash
109-
110-
# Get Version
111-
ver="${tag}-${centos_version}.$(date +%Y%m%d)"
109+
set -eo pipefail
112110

113111
BUILD_ARGS=()
114-
BUILD_ARGS+=("--build-arg" "MAJOR_VERSION=${centos_version}")
115-
BUILD_ARGS+=("--build-arg" "IMAGE_NAME=${target_image}")
116-
BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR=${repo_organization}")
117-
BUILD_ARGS+=("--build-arg" "ENABLE_DX=${dx}")
118-
BUILD_ARGS+=("--build-arg" "ENABLE_HWE=${hwe}")
119-
BUILD_ARGS+=("--build-arg" "ENABLE_GDX=${gdx}")
120-
if [[ -z "$(git status -s)" ]]; then
121-
BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)")
122-
fi
112+
while IFS=$'\n' read -r label; do
113+
BUILD_ARGS+=("--label" "$label")
114+
done <<< $GENERATED_LABELS && unset label
123115

124116
podman build \
117+
"${BUILD_ARGS[@]}" \
125118
--pull=newer \
126-
--tag "${target_image}:unchunked" \
119+
--tag "${target_image}:${tag}" \
127120
--cache-from "ghcr.io/${repo_organization}/${target_image}" \
128121
.
129-
130-
tmp="$(mktemp -d)"
131-
cleanup_tmp() {
132-
rm -r "$tmp"
133-
podman rm -fiv rechunk
134-
}
135-
trap cleanup_tmp EXIT
136-
137-
podman run \
138-
--rm \
139-
--mount=type=image,src="${target_image}":unchunked,target=/var/tree,rw=true \
140-
--mount=type=volume,target=/var/ostree \
141-
--mount=type=bind,src="$tmp",target=/workspace \
142-
--security-opt=label=disable \
143-
--user 0:0 \
144-
--env TREE=/var/tree \
145-
--env INIT_REPO=1 \
146-
--env REPO=/var/ostree/repo \
147-
--env PREV_REF="ghcr.io/${repo_organization}/${target_image}:latest" \
148-
--env OUT_NAME="${target_image}" \
149-
--env OUT_REF="oci-archive:/workspace/image.tar" \
150-
--env SKIP_COMPRESSION=1 \
151-
--env LABELS="$GENERATED_LABELS" \
152-
--env RESET_TIMESTAMP="$RESET_TIMESTAMP" \
153-
--name rechunk \
154-
ghcr.io/hhd-dev/rechunk:latest \
155-
sh -c '/sources/rechunk/1_prune.sh && /sources/rechunk/2_create.sh && touch $OUT_NAME.changelog.txt && /sources/rechunk/3_chunk.sh'
156-
podman rmi -f "${target_image}:unchunked"
157-
chunked_img="$(podman image import -c LABEL=containers.bootc=1 --message imported "${tmp}/image.tar")"
158-
podman tag "$chunked_img" "${target_image}:latest"
159122
test -n "$GENERATED_TAGS" && for tag in $GENERATED_TAGS; do
160-
podman tag "$chunked_img" "${target_image}:${tag}"
161-
done
123+
podman tag "${target_image}:${tag}" "${target_image}:${tag}"
124+
done || :
162125

163126
# Command: _rootful_load_image
164127
# Description: This script checks if the current user is root or running under sudo. If not, it attempts to resolve the image tag using podman inspect.

0 commit comments

Comments
 (0)