Skip to content

Commit 7b19e92

Browse files
authored
Merge pull request #1169 from flatcar/krnowak/image-changes
Generate reports for OEM and base sysext images, allow reports against last nightly
2 parents 3882897 + 3d4ddf8 commit 7b19e92

File tree

6 files changed

+665
-209
lines changed

6 files changed

+665
-209
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
sudo rm /bin/sh
5656
sudo ln -s /bin/bash /bin/sh
5757
sudo apt-get update
58-
sudo apt-get install -y ca-certificates curl git gnupg lsb-release python3 qemu-user-static zstd
58+
sudo apt-get install -y ca-certificates curl git gnupg lsb-release python3 python3-packaging qemu-user-static zstd
5959
sudo mkdir -p /etc/apt/keyrings
6060
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
6161
echo \
@@ -187,56 +187,6 @@ jobs:
187187
--output_root="${CI_CONTAINER_ARTIFACT_ROOT}" \
188188
prodtar container
189189
190-
- name: Generate reports
191-
shell: bash
192-
run: |
193-
set -euo pipefail
194-
set -x
195-
196-
source ci-automation/image_changes.sh
197-
198-
channel=alpha
199-
vernum=$(source sdk_container/.repo/manifests/version.txt; echo "${FLATCAR_VERSION}")
200-
board="${arch}-usr"
201-
202-
package_diff_env=(
203-
"FROM_B=file://${PWD}/artifacts/${arch}-usr/latest"
204-
# BOARD_B and CHANNEL_B are unused.
205-
)
206-
package_diff_params_b=(
207-
# The package-diff script appends version to the file
208-
# URL, but the directory with the image has no version
209-
# component at its end, so we use . as a version.
210-
'.'
211-
)
212-
size_changes_env=(
213-
# Nothing to add.
214-
)
215-
size_changes_params_b=(
216-
"local:${PWD}/artifacts/${arch}-usr/latest"
217-
)
218-
show_changes_env=(
219-
# Nothing to add.
220-
"SCRIPTS_REPO=scripts"
221-
"COREOS_OVERLAY_REPO=coreos-overlay"
222-
"PORTAGE_STABLE_REPO=portage-stable"
223-
)
224-
show_changes_params_overrides=(
225-
# We may not have a tag handy, so we tell show-changes
226-
# to use git HEAD as a reference to new changelog
227-
# entries.
228-
'NEW_VERSION=HEAD'
229-
)
230-
231-
# Parent directory of the scripts repo, required by some other
232-
# script.
233-
work_directory='..'
234-
generate_image_changes_report \
235-
"${arch}" "${channel}" "${vernum}" 'image-changes-reports.txt' "../flatcar-build-scripts" "${work_directory}" \
236-
"${package_diff_env[@]}" --- "${package_diff_params_b[@]}" -- \
237-
"${size_changes_env[@]}" --- "${size_changes_params_b[@]}" -- \
238-
"${show_changes_env[@]}" --- "${show_changes_params_overrides[@]}"
239-
240190
- name: Build VM image(s)
241191
shell: bash
242192
run: |
@@ -283,6 +233,12 @@ jobs:
283233
mv * ../../images/
284234
)
285235
236+
- name: Generate reports against last release
237+
run: .github/workflows/image_changes.sh ${{ matrix.arch }} release
238+
239+
- name: Generate reports against last nightly
240+
run: .github/workflows/image_changes.sh ${{ matrix.arch }} nightly
241+
286242
- name: Upload binpkgs
287243
uses: actions/upload-artifact@v3
288244
with:
@@ -328,7 +284,7 @@ jobs:
328284
retention-days: 7
329285
name: ${{ matrix.arch }}-image-changes-reports
330286
path: |
331-
scripts/image-changes-reports.txt
287+
scripts/image-changes-reports*.txt
332288
333289
# Clean up what we uploaded already so the "vendor images" wildcard
334290
# works when uploading artifacts in the next step.

.github/workflows/image_changes.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
set -x
4+
set -euo pipefail
5+
6+
source ci-automation/image_changes.sh
7+
8+
# Callback invoked by run_image_changes_job, read its docs to learn
9+
# about the details about the callback.
10+
function github_ricj_callback() {
11+
package_diff_env+=(
12+
"FROM_B=file://${PWD}/artifacts/images"
13+
# BOARD_B and CHANNEL_B are unused.
14+
)
15+
package_diff_params+=(
16+
# The package-diff script appends version to the file
17+
# URL, but the directory with the image has no version
18+
# component at its end, so we use . as a version.
19+
'.'
20+
)
21+
# Nothing to add to size changes env.
22+
size_changes_params+=(
23+
"local:${PWD}/artifacts/images"
24+
)
25+
show_changes_env+=(
26+
# Override the default locations of repositories.
27+
"SCRIPTS_REPO=."
28+
"COREOS_OVERLAY_REPO=../coreos-overlay"
29+
"PORTAGE_STABLE_REPO=../portage-stable"
30+
)
31+
show_changes_params+=(
32+
# We may not have a tag handy, so we tell show-changes
33+
# to use git HEAD as a reference to new changelog
34+
# entries.
35+
'NEW_VERSION=HEAD'
36+
)
37+
}
38+
39+
arch=${1}; shift
40+
mode=${1}; shift
41+
report_file_name="image-changes-reports-${mode}.txt"
42+
43+
run_image_changes_job "${arch}" "${mode}" "${report_file_name}" '../flatcar-build-scripts' github_ricj_callback

ci-automation/base_sysexts.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Definitions of base sysexts to be built. Used by image.sh and
2+
# image_changes.sh.
3+
4+
if [[ ${1:-} = 'local' ]]; then
5+
local ciabs_base_sysexts
6+
fi
7+
8+
ciabs_base_sysexts=(
9+
'containerd-flatcar:app-containers/containerd'
10+
'docker-flatcar:app-containers/docker'
11+
)

ci-automation/image.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ function _image_build_impl() {
8686

8787
apply_local_patches
8888

89+
source ci-automation/base_sysexts.sh 'local'
90+
local base_sysexts_param
91+
base_sysexts_param=$(export IFS=,; echo "${ciabs_base_sysexts[*]}")
92+
8993
# build image and related artifacts
9094
./run_sdk_container -x ./ci-cleanup.sh -n "${image_container}" -C "${packages_image}" \
9195
-v "${vernum}" \
@@ -96,6 +100,7 @@ function _image_build_impl() {
96100
./run_sdk_container -n "${image_container}" -C "${packages_image}" \
97101
-v "${vernum}" \
98102
./build_image --board="${arch}-usr" --group="${channel}" \
103+
--base_sysexts="${base_sysexts_param}" \
99104
--output_root="${CONTAINER_IMAGE_ROOT}" \
100105
--only_store_compressed \
101106
prodtar container

0 commit comments

Comments
 (0)