Improve CI stability: make kubeconform schema validation resilient to transient download failures - #705
Merged
Conversation
… transient download failures The chart-testing lint job intermittently fails when kubeconform cannot download schemas from raw.githubusercontent.com (throttling of GitHub Actions runners). Each kubeconform invocation re-downloaded the same schemas, ~21 values files x 10 k8s versions per run. - cache downloaded schemas with kubeconform's -cache option so each schema is downloaded at most once per run - persist the schema cache across runs with actions/cache - retry kubeconform up to 5 times when the failure is a schema download error; cached schemas are not re-downloaded on retry, and genuine validation failures fail immediately without retrying - render helm template output to a file so validation can be retried without re-running helm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
chart-testing lintjob on master is failing intermittently because kubeconform cannot download JSON schemas from raw.githubusercontent.com:Two consecutive attempts of https://github.com/apache/pulsar-helm-chart/actions/runs/28790178682 failed this way (different schema files each time), while all actual chart validation passed (
Invalid: 0). The root cause is likely throttling of GitHub Actions runner requests to raw.githubusercontent.com, aggravated by the fact that each kubeconform invocation re-downloads the same schemas: the lint job validates ~21 values files × 10 k8s versions, so the same schema files get downloaded hundreds of times per run.Modifications
-cacheoption (newhack::kubeconform_with_retrieshelper inhack/common.sh), so each schema is downloaded at most once per run.actions/cache(restore + save split so the cache is saved even when validation fails, avoiding re-downloads on the next attempt).helm templateoutput to a file so the kubeconform validation can be retried without re-running helm.Verification
Tested locally:
-strictviolation): fails immediately with no retries