Commit Graph

6 Commits

Author SHA1 Message Date
Thilo Fromm
2d5c17cb3c ci-automation/garbage_collect: add cached release artifacts
This change extends the garbage collector for the build cache server to
remove cached release artifacts. Release artifacts are copied to the
official mirrors and do not need to remain on the build cache after a
release was published.

By default, the 10 latest releases of all channels (including LTS and
previous LTS) are kept.

Also excluded from garbage collection are:
 - Emerging new major releases (i.e. major number larger than the
   latest Alpha release)
 - channel progressions (major number exists in the lists of releases to
   keep but minor is bigger than any release)
 - patch releases (major and minor exist in list of releases to keep but
   patch level is newer than in any release)
 - SDKs (tarballs and containers) of any release in the list of releases
   to keep; i.e. the SDK in <MAJOR>.0.0 for any release to keep.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2024-01-30 14:59:00 +01:00
Thilo Fromm
8bc10465e0 ci-automation/garbage_collect*: unset POSIXLY_CORRECT for awk
gensub is a GNU extension; however, POSIXLY_CORRECT is enforced in
systemd-run which triggers gawk's traditional / posix mode.
Unset it before calling gawk to make gensub available.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2024-01-30 09:49:57 +01:00
Thilo Fromm
aaf9deac28 ci-automation/garbage_collect_github_ci_sdk.sh: add min_age parameter
This change adds a min_age parameter to the github CI SDK garbage
collector. The parameter specifies a minimum age (in days) for artifacts
to be garbage collected. NOTE that this can result in more artifacts
being kept than specified via the "keep" parameter if artifacts are
younger than min_age.

The change also has garbage_collect.sh pass the min_age parameter to
garbage_collect_github_ci_sdk.sh.

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2024-01-26 15:47:54 +01:00
Thilo Fromm
4ffc9b254f garbage_collect_github_ci_sdk: add keep_tail, clean up keep var usage
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-05-22 12:21:07 +02:00
Thilo Fromm
83a85683c8
Apply suggestions from code review
Co-authored-by: Krzesimir Nowak <knowak@microsoft.com>
2023-05-22 12:14:04 +02:00
Thilo Fromm
9b3a67e72b ci-automation/garbage_collect: Add github CI SDK builds
This change adds a garbage collector script for SDK containers built via
Github actions CI automation
https://github.com/flatcar/scripts/blob/main/.github/workflows/update-sdk.yaml
These SDK container builds do not create a version tag in the scripts
repo. The garbage collector therefore retrieves versions from a
directory listing of
https://bincache.flatcar-linux.net/containers/ .

Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2023-05-09 17:29:38 +02:00