Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: always cache maven dependencies #12424

Merged
merged 12 commits into from May 9, 2023
Merged

Conversation

oleschoenburg
Copy link
Member

@oleschoenburg oleschoenburg commented Apr 14, 2023

This PR changes how we use and cache the local maven repository. This allows us to always build Zeebe in parallel and makes caching a more reliable.
To do this, we are using a new repository layout that supports concurrent builds and that splits release and snapshot artifacts. Splitting is very useful for us because we can now ensure that we only cache released artifacts and that locally built snapshot artifacts are not reused because that would be a correctness hazard.

Caching of maven dependencies is now always enabled but we split the caches between GH- and self-hosted (because they are not compatible with each other) and we use more cache modifiers to ensure that jobs that built only part of Zeebe don't create caches that are too small, i.e. contain only a few of Zeebe's dependencies.

Latest test run is here: https://github.com/camunda/zeebe/actions/runs/4916223809

@github-actions
Copy link
Contributor

github-actions bot commented Apr 14, 2023

Test Results

1 054 files  ±  0  1 054 suites  ±0   1h 55m 34s ⏱️ - 10m 2s
8 570 tests  - 79  8 544 ✔️  - 79  26 💤 ±0  0 ±0 
8 778 runs   - 79  8 752 ✔️  - 79  26 💤 ±0  0 ±0 

Results for commit b42252d. ± Comparison against base commit fd19810.

This pull request removes 664 and adds 585 tests. Note that renamed tests count towards both.
io.camunda.zeebe.engine.processing.bpmn.activity.OutputMappingTest ‑ shouldApplyOutputMapping[0: io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@5b2c9a69]
io.camunda.zeebe.engine.processing.bpmn.activity.OutputMappingTest ‑ shouldApplyOutputMapping[1: io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@19983dd1]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=BUSINESS_RULE_TASK, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@7cd2d3b6, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=CALL_ACTIVITY, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@3c20abd6, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=END_EVENT, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@507e3e77, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=EVENT_BASED_GATEWAY, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@375682a5, variables={correlationKey=value}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=EVENT_SUB_PROCESS, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@1db7c267, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=EXCLUSIVE_GATEWAY, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@368e7d3a, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=INTERMEDIATE_CATCH_EVENT, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@516370c1, variables={correlationKey=value}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=INTERMEDIATE_THROW_EVENT, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@27563444, variables={}]]
…
io.camunda.zeebe.engine.processing.bpmn.activity.OutputMappingTest ‑ shouldApplyOutputMapping[0: io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@4a842e8a]
io.camunda.zeebe.engine.processing.bpmn.activity.OutputMappingTest ‑ shouldApplyOutputMapping[1: io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@6b909973]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=BUSINESS_RULE_TASK, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@5f0b2fe1, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=CALL_ACTIVITY, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@37c5a3c7, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=END_EVENT, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@ecc5101, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=EVENT_BASED_GATEWAY, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@13e76a91, variables={correlationKey=value}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=EVENT_SUB_PROCESS, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@1427827f, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=EXCLUSIVE_GATEWAY, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@214fe287, variables={}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=INTERMEDIATE_CATCH_EVENT, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@27015621, variables={correlationKey=value}]]
io.camunda.zeebe.engine.processing.processinstance.CreateProcessInstanceSupportedElementTest ‑ testProcessInstanceCanStartAtElementType[Scenario[type=INTERMEDIATE_THROW_EVENT, modelInstance=io.camunda.zeebe.model.bpmn.impl.BpmnModelInstanceImpl@4b6575fd, variables={}]]
…

♻️ This comment has been updated with latest results.

@oleschoenburg oleschoenburg force-pushed the os-always-cache-maven branch 4 times, most recently from f1c990b to ec81138 Compare April 14, 2023 16:47
@megglos
Copy link
Contributor

megglos commented Apr 27, 2023

@oleschoenburg what's missing for this one? recently I noticed docker checks and some smoke jobs seem to be the ones taking the most time now, I guess caching could help to reduce their duration. Shall we rebase and evaluate the effect with a couple of runs?

@oleschoenburg
Copy link
Member Author

@megglos Nothing really. I wanted to try out a dedicated caching job that runs on main so that PRs only restore a cache but really this can be a different PR if we even want to do this.

I'll rebase and start a couple of runs. Thanks for the reminder 👍

@oleschoenburg oleschoenburg marked this pull request as ready for review May 8, 2023 14:37
@npepinpe
Copy link
Member

npepinpe commented May 9, 2023

image

😄

Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

.github/actions/setup-zeebe/action.yml Outdated Show resolved Hide resolved
.github/actions/setup-zeebe/action.yml Show resolved Hide resolved
-D maven.artifact.threads=32
EOF
- name: Cache local Maven repository
if: inputs.java == 'true' && startsWith(runner.name, 'actions-runner-')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤡 Shame we can't access the labels here =/

.github/actions/setup-zeebe/action.yml Show resolved Hide resolved
@npepinpe npepinpe added backport stable/8.0 backport stable/8.2 Backport a pull request to 8.2.x labels May 9, 2023
@oleschoenburg
Copy link
Member Author

bors r+

@oleschoenburg
Copy link
Member Author

bors r-

@zeebe-bors-camunda
Copy link
Contributor

Canceled.

@oleschoenburg
Copy link
Member Author

bors merge

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 409ee4d into main May 9, 2023
32 checks passed
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the os-always-cache-maven branch May 9, 2023 14:40
@backport-action
Copy link
Collaborator

Backport failed for stable/8.0, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin stable/8.0
git worktree add -d .worktree/backport-12424-to-stable/8.0 origin/stable/8.0
cd .worktree/backport-12424-to-stable/8.0
git checkout -b backport-12424-to-stable/8.0
ancref=$(git merge-base dc94b82a91a41061fdab55d7cbfbd3d901d7d3b2 91983b025667cd72aba97087ce43ba571f10aa71)
git cherry-pick -x $ancref..91983b025667cd72aba97087ce43ba571f10aa71

@backport-action
Copy link
Collaborator

Backport failed for stable/8.1, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin stable/8.1
git worktree add -d .worktree/backport-12424-to-stable/8.1 origin/stable/8.1
cd .worktree/backport-12424-to-stable/8.1
git checkout -b backport-12424-to-stable/8.1
ancref=$(git merge-base dc94b82a91a41061fdab55d7cbfbd3d901d7d3b2 91983b025667cd72aba97087ce43ba571f10aa71)
git cherry-pick -x $ancref..91983b025667cd72aba97087ce43ba571f10aa71

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.2:

zeebe-bors-camunda bot added a commit that referenced this pull request May 9, 2023
12726: [Backport stable/8.2] ci: always cache maven dependencies r=oleschoenburg a=backport-action

# Description
Backport of #12424 to `stable/8.2`.

relates to 

Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@oleschoenburg oleschoenburg added the version:8.2.5 Marks an issue as being completely or in parts released in 8.2.5 label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable/8.2 Backport a pull request to 8.2.x version:8.2.5 Marks an issue as being completely or in parts released in 8.2.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants