Commit 6e0f3e2
Cosmos CI build optimizations (#48260)
* Optimize Cosmos CI: reduce PR matrix, increase parallelism, skip shade
1. PR-conditional emulator matrix (16 → 11 jobs):
Drops redundant JDK variants for Spark/Kafka in PR builds.
Full matrix on main merges.
Dropped for PRs (5 jobs, ~5 agent hours saved):
- Spark 3.3 Java 11 (keeping Java 8)
- Spark 3.4 Java 8 (keeping Java 11)
- Spark 3.5/Scala 2.12 Java 8 (keeping Java 17)
- Spark 4.0/Scala 2.13 Java 17 (keeping Java 21)
- Kafka Java 11 (keeping Java 17)
2. Increase BuildParallelization from 1 to 2 in all stages
(Build, TestEmulator, TestVNextEmulator).
3. Skip maven-shade-plugin for non-Spark/non-Kafka emulator jobs:
Core emulator, long emulator, and encryption jobs don't need
Spark/Kafka uber JARs. Adding -Dshade.skip=true saves ~90s of
shade plugin execution per Spark module × 5 modules = ~7-8 min
per non-Spark job (5 jobs × 7 min = ~35 min agent time saved).
4. Remove outdated comment about emulator download time.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix: also skip maven-antrun-plugin when shade is skipped
The antrun 03-repack phase expects shade output (native .jnilib/.so
files in target/tmp/). When -Dshade.skip=true, the shade output doesn't
exist and antrun fails with 'Could not find file'. Add
-Dmaven.antrun.skip=true alongside -Dshade.skip=true.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix: pass shade.skip to both build AND test steps via AdditionalArgs
The test step runs 'clean verify' which recompiles everything from
scratch, including Spark shade. Our BuildOptions only affected the
build step. Add -Dshade.skip=true -Dmaven.antrun.skip=true to
AdditionalArgs for non-Spark jobs so it flows into TestOptions too.
Keep BuildOptions for the build step as well (both steps need it).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add BuildOptions plumbing to skip shade in Build stage unit test jobs
Add BuildOptions parameter through ci.yml → ci.tests.yml → build-and-test.yml
pipeline chain. Defaults to empty string (no behavior change for other SDKs).
Cosmos Build stage sets BuildOptions to '-Dshade.skip=true -Dmaven.antrun.skip=true'
to skip Spark/Kafka uber JAR creation during unit test matrix jobs, saving ~14 min
per job. The release artifact deploy step is unaffected.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add per-job ProjectListOverride for Spark/Kafka emulator jobs
Each Spark emulator job previously compiled ALL 14 modules including
other Spark versions it doesn't test, wasting ~11 min per job on
unnecessary shade+compile.
Changes:
- generate-project-list.ps1: Check for ProjectListOverride env var
at the top. If set, use it directly and skip normal computation.
Defaults to empty (no behavior change for other SDKs).
- Emulator matrix JSONs: Add ProjectListOverride for each Spark and
Kafka job with only the modules they need (core + their specific
Spark/Kafka module).
Example: Spark 3.5/2.13 job previously built 14 modules (41 min test
step). Now builds only 6 modules, saving ~11 min per Spark job.
Estimated savings: ~11 min × 9 Spark jobs + ~5 min × 2 Kafka jobs
= ~109 min agent time per full CI run.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* No-op: trigger Cosmos CI for build optimization validation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add ProjectListOverride for emulator/encryption jobs to skip Spark compilation
Emulator, Long Emulator, and Encryption jobs were compiling all 14 cosmos
modules including 7 Spark modules (Scala compilation ~10-16 min) despite
only running core emulator tests. Add ProjectListOverride to limit these
jobs to only the modules they actually test:
- Emulator/Long Emulator: azure-cosmos, azure-cosmos-test, azure-cosmos-tests
- Encryption: adds azure-cosmos-encryption
Also reverts the no-op TestSuiteBase trigger commit.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Guard ProjectListOverride from being used in FromSource runs
FromSource runs use ClientFromSourcePom.xml to build all track 2 libraries
and rely on the computed project list for -pl/-amd test scoping. Allowing
ProjectListOverride to take effect during FromSource runs would restrict
the test scope incorrectly. Check $env:TESTFROMSOURCE and skip the
override when it is 'true'.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent aa1a3b1 commit 6e0f3e2
7 files changed
Lines changed: 221 additions & 35 deletions
File tree
- eng/pipelines
- scripts
- templates
- jobs
- stages
- sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/rx
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
7 | 30 | | |
8 | 31 | | |
9 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
| 151 | + | |
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
503 | 506 | | |
504 | 507 | | |
505 | 508 | | |
| 509 | + | |
506 | 510 | | |
507 | 511 | | |
508 | 512 | | |
| |||
Lines changed: 115 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments