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

Reenable gradle build cache #3185

Closed
peternied opened this issue Aug 15, 2023 · 6 comments
Closed

Reenable gradle build cache #3185

peternied opened this issue Aug 15, 2023 · 6 comments
Assignees
Labels
triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.

Comments

@peternied
Copy link
Member

peternied commented Aug 15, 2023

The gradle build cache is used between github actions to speed up build times, but if the wrong cache sources are being used this can result in unexpected failures that are hard to troubleshoot.

We are disabling the remote gradle cache to while stabilizing the build infrastructure. We should revisit what the impact of not having this cache.

Task 1: Determine the best path forward for re-enabling the build cache. Should we re-instate it the same way or in a different way?
Task 2: Re-enable cache in best way.

@github-actions github-actions bot added the untriaged Require the attention of the repository maintainers and may need to be prioritized label Aug 15, 2023
peternied added a commit to peternied/security that referenced this issue Aug 15, 2023
…ndency is used

We suspect that we are seeing the snapshot build of opensearch be cached
in some circumstances and not cached in others that is creating a mix of
build failures that are hard to interpret.

Follow up issue to revisit and potentially renable this setting opensearch-project#3185

Signed-off-by: Peter Nied <[email protected]>
peternied added a commit that referenced this issue Aug 15, 2023
…ependencies (#3186)

Disable gradlew build cache to ensure most up-to-date dependencies

We suspect that we are seeing the snapshot build of opensearch be cached
in some circumstances and not cached in others that is creating a mix of
build failures that are hard to interpret.

Follow up issue to revisit and potentially renable this setting
#3185

Signed-off-by: Peter Nied <[email protected]>
peternied added a commit to peternied/security that referenced this issue Aug 15, 2023
…t up-to-date dependencies

Backport 5e8f12c from opensearch-project#3186.

Disable gradlew build cache to ensure most up-to-date dependencies

We suspect that we are seeing the snapshot build of opensearch be cached
in some circumstances and not cached in others that is creating a mix of
build failures that are hard to interpret.

Follow up issue to revisit and potentially renable this setting
opensearch-project#3185

Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit 5e8f12c)
peternied added a commit that referenced this issue Aug 15, 2023
…t up-to-date dependencies (#3187)

Backport 5e8f12c from #3186.

Disable gradlew build cache to ensure most up-to-date dependencies

We suspect that we are seeing the snapshot build of opensearch be cached
in some circumstances and not cached in others that is creating a mix of
build failures that are hard to interpret.

Follow up issue to revisit and potentially renable this setting
#3185

Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit 5e8f12c)
@peternied
Copy link
Member Author

With the cache disabled we will see more failures due to intermittent network issues when downloading dependencies. It might be a good idea to support at least for some level of dependencies

Cache is disabled: will not restore state from previous builds.
C:\Windows\system32\cmd.exe /D /S /C "D:\a\security\security\gradlew.bat ciSecurityIntegrationTest "-Dbuild.snapshot=false" -x test"
Downloading https://services.gradle.org/distributions/gradle-8.2.1-bin.zip

Error: Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
	at java.base/sun.security.ssl.SSLSocketImpl.handleEOF(SSLSocketImpl.java:1719)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1518)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)

Source https://github.com/opensearch-project/security/actions/runs/5883917137/job/15957604175?pr=3196

@peternied
Copy link
Member Author

Looks like downloading the gradle distro got interrupted and failed a run
https://github.com/opensearch-project/security/actions/runs/5907712274/job/16026096868?pr=3196

C:\Windows\system32\cmd.exe /D /S /C "D:\a\security\security\gradlew.bat ciSecurityIntegrationTest "-Dbuild.snapshot=false""
Downloading https://services.gradle.org/distributions/gradle-8.2.1-bin.zip

Error: Exception in thread "main" java.net.SocketException: An established connection was aborted by the software in your host machine
	at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:425)
	at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:445)

@stephen-crawford
Copy link
Contributor

[Triage] Hi @peternied, thank you for filing this issue. Based on the info you provided, I am marking this issue as triaged with the two tasks required for closure being determining the best way to handle the caching and then actually do that.

@stephen-crawford stephen-crawford added triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable. and removed untriaged Require the attention of the repository maintainers and may need to be prioritized labels Aug 21, 2023
@DarshitChanpura
Copy link
Member

Seems like this is a good solution for enabling gradle build cache: https://github.com/marketplace/actions/gradle-cache

i will raise a PR soon.

@DarshitChanpura
Copy link
Member

Closing this as CI is pretty fast without enabling cache. (comment)

@DarshitChanpura
Copy link
Member

Feel free to re-open if this still needs to be addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Projects
None yet
3 participants