Skip to content

BUILD-7780: Use monthly cache for orchestrator #596

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

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

jayadeep-km-sonarsource
Copy link
Contributor

@jayadeep-km-sonarsource jayadeep-km-sonarsource commented Mar 20, 2025

BUILD-7780

Part of https://sonarsource.atlassian.net/browse/BUILD-7780

This PR introduces caching of artifacts downloaded by orchestrator in the pipeline. It is necessary to reduce bandwidth consumption from repox.

@jayadeep-km-sonarsource jayadeep-km-sonarsource requested a review from a team March 20, 2025 10:14
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-7780-orchestrator-cache branch 2 times, most recently from 34f0654 to 0ead6ed Compare March 20, 2025 10:54
@jayadeep-km-sonarsource jayadeep-km-sonarsource marked this pull request as draft March 20, 2025 10:55
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-7780-orchestrator-cache branch 8 times, most recently from 67a5e9a to 955f164 Compare March 20, 2025 15:50
@jayadeep-km-sonarsource jayadeep-km-sonarsource marked this pull request as ready for review March 20, 2025 16:01
@jayadeep-km-sonarsource jayadeep-km-sonarsource force-pushed the feat/jd/BUILD-7780-orchestrator-cache branch 2 times, most recently from f6d0959 to f800aa2 Compare March 21, 2025 11:07
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Member

@Godin Godin left a comment

Choose a reason for hiding this comment

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

Looking at https://cirrus-ci.com/task/5138860197281792

Seems that cache is always reuploaded because it contains plugin whose build number changes with every build:

Cache orchestrator has changed!
List of changes for cache folders (/tmp/cirrus-ci-build/orchestrator/LATEST_RELEASE/March):
created: cache/6ed2bf71b59fdbfdb2a7588213dddc61/sonar-kotlin-plugin-3.1.0.6960.jar
orchestrator cache size is 1014Mb.
Uploading cache orchestrator...

And this task lacs execution of clean-orchestrator-cache.sh

@julien-carsique-sonarsource julien-carsique-sonarsource marked this pull request as draft April 1, 2025 14:48
@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/jd/BUILD-7780-orchestrator-cache branch 6 times, most recently from 32eccf2 to dc8699e Compare April 3, 2025 16:08
@Godin
Copy link
Member

Godin commented Apr 4, 2025

@julien-carsique-sonarsource AFAICS in addition to sonar-application you're trying to preserve at least one sonar-kotlin-plugin in cache, but this means that cache will be uploaded every time sonar-kotlin-plugin build number changes ie every PR, which is ~40 seconds to transfer ~1GB. To avoid this and if we wanna avoid downloading sonar-kotlin-plugin from Repox, then we can simply pass it from task that produces it into task that consumes it - see for example https://github.com/SonarSource/sonar-cpp/blob/6.65.0.81949/.cirrus.yml#L371-L381 and https://github.com/SonarSource/sonar-dart/blob/1.1.0.2133/.cirrus.yml#L175
If you wanna you can leave this PR in a state when only sonar-application is cached, then I can take it over from there and add transfer of sonar-kotlin-plugin between tasks. Hope this helps.

@Godin
Copy link
Member

Godin commented Apr 4, 2025

@julien-carsique-sonarsource IMO this will also simplify script logic that you've been trying to debug.

@julien-carsique-sonarsource julien-carsique-sonarsource force-pushed the feat/jd/BUILD-7780-orchestrator-cache branch from dc8699e to f37e318 Compare April 7, 2025 09:01
Copy link

sonarqube-next bot commented Apr 7, 2025

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@julien-carsique-sonarsource
Copy link
Contributor

@Godin actually, I was fixing a Windows issue with interpreting the shell script.
It is now working as expected with keeping only the last version for sonar-application and no sonar-kotlin-plugin:

.cirrus/clean-orchestrator-cache.sh
File that will not be deleted:
./cache/5dd55d105f71c91a8572d3e3c7201bbd/sonar-application-25.3.0.104237.zip
Files that will be deleted:
./cache/8cb4c419cdd6d1dbff80e331d241b6cb/sonar-kotlin-plugin-3.1.0.7068.jar

That makes the cache efficient without the continuous update due to sonar-kotlin-plugin.

The suggested improvement, from task to task, will also save the Repox bandwidth and totally makes sense.
Yes, please, can you merge the current PR and take over it for the following improvements?

@julien-carsique-sonarsource julien-carsique-sonarsource marked this pull request as ready for review April 7, 2025 15:08
@Godin Godin merged commit 72d3ee7 into master Apr 9, 2025
14 checks passed
@Godin Godin deleted the feat/jd/BUILD-7780-orchestrator-cache branch April 9, 2025 20:07
@Godin
Copy link
Member

Godin commented Apr 10, 2025

The suggested improvement, from task to task, will also save the Repox bandwidth and totally makes sense.
Yes, please, can you merge the current PR and take over it for the following improvements?

See #609

@Godin
Copy link
Member

Godin commented Apr 11, 2025

For the record part implemented here seems buggy

https://cirrus-ci.com/task/6105864098021376?logs=cleanup_orchestrator_cache#L0

.cirrus/clean-orchestrator-cache.sh
File that will not be deleted:
./cache/de6977a0463613ee1be7bdeff2bc18b9/sonar-application-25.5.0.106048.zip
Files that will be deleted:
./cache/8e5f056686be87b900e12b5467e97f70/sonar-application-25.5.0.106089.zip
./cache/970fbd85cdd43d384304a9dab63fb233/sonar-kotlin-plugin-3.2.0.7099.jar

removed sonar-application-25.5.0.106089.zip is newer than kept sonar-application-25.5.0.106048.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants