cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30k stars 3.79k forks source link

teamcity: excessive number of full builds during each CI run #64263

Open knz opened 3 years ago

knz commented 3 years ago

I just noticed that every CI runs compiles the entire crdb binary, including all web assets etc, a minimum of 7 times:

We could shave some time on the entire CI run (as well as disk space, time collecting artifacts etc) by only building the linux executable just one time as pre-requisite for other CI targets.

I would recommend using verify archive as a starting point, since we also want to assert that the code can be built from a downloadable source archive.

cc @jlinder for triage

Epic CRDB-10439

Jira issue: CRDB-6973

knz commented 3 years ago

Another reason why it would be desirable to have a build target as prereq for the other targets: in case the source doesn't build, we would only hog 1 agent to report that error and abort the entire CI pipeline, instead of spawning 8 agents upfront.

knz commented 3 years ago

Here's a sketch of a dep tree:

  1. new variant of "verify archive" which extracts the source then runs builder.sh mkrelease linux-gnu (instead of make install), then stores the produced binary somewhere where the other targets can find it. Possibly also runs make install separately to ensure the binary produced by mkrelease can be installed.
  2. depending on (1): "compile builds" but exclude the linux binary, since it was already built in (1)
  3. depending on (1): roachtest, and remove the "make build" step from the script
  4. depending on (1): acceptance, and remove the "mkrelease" step from the script

Then we can remove the "Build test binary" step altogether.

Since the CI config change and the script updates are not atomic, we'll need to have a "transition phase" where the scripts work in both configurations. For this we can modify the scripts to expect a pre-built executable in a fixed path, and use if ! test -e path/to/executable; then ...build...; fi to build it on demand if it's not there yet.

github-actions[bot] commented 1 year ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!