Browse Source

Cache key wasn't taking account changes in the version of bundled software (#16985)

To optimize the CI we are trying to cache build artifacts such as all the software we build and statically bundle for static binaries (for each arch) In a nutshell the artifacts of these https://github.com/netdata/netdata/tree/master/packaging/makeself/jobs source files. With this https://github.com/netdata/netdata/blob/master/.github/scripts/get-static-cache-key.sh script we generate the keys for these cached artifacts taking into account the (source files of the jobs, version of the software, static packages bundled in the base images). The effort #16303 to make a centralized file for all the versions expanded the problem of not considering the exact versions.

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>
Tasos Katsoulas 1 year ago
parent
commit
48507277a3

+ 1 - 0
.github/scripts/get-static-cache-key.sh

@@ -8,6 +8,7 @@ docker pull --platform "${platform}" netdata/static-builder:${builder_rev}
 
 # shellcheck disable=SC2046
 cat $(find packaging/makeself/jobs -type f ! -regex '.*\(netdata\|-makeself\).*') > /tmp/static-cache-key-data
+cat packaging/makeself/bundled-packages.version >> /tmp/static-cache-key-data
 
 docker run -it --rm --platform "${platform}" netdata/static-builder:${builder_rev} sh -c 'apk list -I 2>/dev/null' >> /tmp/static-cache-key-data
 

+ 0 - 0
packaging/makeself/bundled-packages → packaging/makeself/bundled-packages.version


+ 1 - 1
packaging/makeself/jobs/20-openssl.install.sh

@@ -4,7 +4,7 @@
 # shellcheck source=packaging/makeself/functions.sh
 . "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
 # Source of truth for all the packages we bundle in static builds
-. "$(dirname "${0}")/../bundled-packages"
+. "$(dirname "${0}")/../bundled-packages.version"
 # shellcheck disable=SC2015
 [ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building OpenSSL" || true
 

+ 1 - 1
packaging/makeself/jobs/50-bash-5.1.16.install.sh

@@ -4,7 +4,7 @@
 # shellcheck source=packaging/makeself/functions.sh
 . "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
 # Source of truth for all the packages we bundle in static builds
-. "$(dirname "${0}")/../bundled-packages"
+. "$(dirname "${0}")/../bundled-packages.version"
 
 # shellcheck disable=SC2015
 [ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::building bash" || true

+ 1 - 1
packaging/makeself/jobs/50-curl.install.sh

@@ -4,7 +4,7 @@
 # shellcheck source=packaging/makeself/functions.sh
 . "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
 # Source of truth for all the packages we bundle in static builds
-. "$(dirname "${0}")/../bundled-packages"
+. "$(dirname "${0}")/../bundled-packages.version"
 
 # shellcheck disable=SC2015
 [ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building cURL" || true

+ 1 - 1
packaging/makeself/jobs/50-ioping-1.3.install.sh

@@ -4,7 +4,7 @@
 # shellcheck source=packaging/makeself/functions.sh
 . "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
 # Source of truth for all the packages we bundle in static builds
-. "$(dirname "${0}")/../bundled-packages" || exit 1
+. "$(dirname "${0}")/../bundled-packages.version" || exit 1
 
 # shellcheck disable=SC2015
 [ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::Building ioping" || true

+ 1 - 1
packaging/makeself/jobs/50-libnetfilter_acct-1.0.3.install.sh

@@ -7,7 +7,7 @@
 # shellcheck source=packaging/makeself/functions.sh
 . "$(dirname "${0}")/../functions.sh" "${@}" || exit 1
 # Source of truth for all the packages we bundle in static builds
-. "$(dirname "${0}")/../bundled-packages" || exit 1
+. "$(dirname "${0}")/../bundled-packages.version" || exit 1
 
 # shellcheck disable=SC2015
 [ "${GITHUB_ACTIONS}" = "true" ] && echo "::group::building libnetfilter_acct" || true