crossplane-contrib / provider-upjet-aws

Official AWS Provider for Crossplane by Upbound.
https://marketplace.upbound.io/providers/upbound/provider-aws
Apache License 2.0
143 stars 120 forks source link

Add a "Disk Cleanup" step as the first step in the lint job #1211

Closed ulucinar closed 6 months ago

ulucinar commented 6 months ago

Description of your changes

This PR adds a Disk Cleanup step as the first step in the lint CI job to allow for more virtual memory space during linting and limits the concurrency of both of the first analysis cache construction and the second full linting phases to 3. Previously, the second phase was run with the max available concurrency as we had observed no issues with the standard Github hosted runners (label ubuntu-22.04) but in a test PR, we had some mixed results with this phase. So we will try configuring the second phase by limiting its concurrency. Please see this comment for some further details.

Furthermore, the first phase is now always run. In the experiments we did with this PR, even there's an analysis cache hit and the cache is restored from a previous run, the second phase can run out of memory even with a concurrency of 1. With the experiment done here, running the cache construction phase again, which employs the build constraints, on top of the restored analysis cache allows the full linting phase to complete successfully. Please note that the full linting phase does not employ the build constraints, more precisely it uses the all build constraint, which effectively lints the whole code base (except the two hot spots discussed in the previous PRs). Looks like even there's cache hit, it's imperative to run the first phase with a subset of the code base (partitioned with the build constraints) is imperative for decreasing the memory needs of the second (full linting) phase.

I have:

How has this code been tested

A successful run (with a concurrency of 1) has been observed here and another successful re-run (again with a concurrency of 1) is here. This run uses a concurrency of 3 and decreases the linter runner time from ~45 min to 32 min at the expense of increased memory usage. We will continue with limiting the concurrency to 3 and we may revisit this if the linter starts failing due to high memory consumption.