Skip to content

Add support to opt-in enable cross-os caching on windows #1056

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 7 commits into from
Jan 5, 2023

Conversation

Phantsure
Copy link
Contributor

Description

Enabling cross os support as an opt-in feature on windows. Previously it was given as default in #1049. And fixing symlink issue pointed out in here: #1010

Motivation and Context

This change is done to allow using saving and restoring cache on Windows which can be restored or is saved on Linux or Mac runners as opt-in feature rather than default. This also bring a fix for symlink issue pointed out by a customer here: #1010.

Types of changes

It would invalidate previous caches present on windows runners due to version mismatch.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Phantsure Phantsure marked this pull request as ready for review January 4, 2023 09:57
@Phantsure Phantsure requested a review from a team as a code owner January 4, 2023 09:57
action.yml Outdated
@@ -14,6 +14,10 @@ inputs:
upload-chunk-size:
description: 'The chunk size used to split up large files during upload, in bytes'
required: false
enableCrossOsArchive:
description: 'An optional boolean enabled to save and restore cache on windows which could be restored and saved on any platform'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion for description: Optional boolean when enabled, allows windows to restore caches created on other platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
description: 'An optional boolean enabled to save and restore cache on windows which could be restored and saved on any platform'
description: 'An optional boolean when enabled, allows to save and restore caches on windows restored and saved on other platforms'

This sound better? We need to have save and restore both

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: 'An optional boolean enabled to save and restore cache on windows which could be restored and saved on any platform'
description: 'An optional boolean when enabled, allows windows runners to save/restore caches that can be restored/saved respectively on other platforms'

True, we need save/restore both. How about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bishal-pdMSFT Does this sound better or this #1056 (comment) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good. The word "respectively" does not seem right fit as we are using /. But I will agree my english is not so good.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove respectively, I'm also not too sure if this would be grammatically correct.

save/action.yml Outdated
@@ -11,6 +11,10 @@ inputs:
upload-chunk-size:
description: 'The chunk size used to split up large files during upload, in bytes'
required: false
enableCrossOsArchive:
description: 'An optional boolean enabled to save cache on windows which could be restored on any platform'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: 'An optional boolean enabled to save cache on windows which could be restored on any platform'
description: 'An optional boolean to enable saving a cache on Windows which may be restored later on another platform'

@lvpx lvpx removed the request for review from pallavx January 5, 2023 06:31
@@ -11,6 +11,10 @@ inputs:
restore-keys:
description: 'An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
required: false
enableCrossOsArchive:
description: 'An optional boolean to enable restoring a cache on Windows which was created on another platform'
Copy link
Contributor

Choose a reason for hiding this comment

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

This should change according to the one used for top level action

save/action.yml Outdated
@@ -11,6 +11,10 @@ inputs:
upload-chunk-size:
description: 'The chunk size used to split up large files during upload, in bytes'
required: false
enableCrossOsArchive:
description: 'An optional boolean to enable saving a cache on Windows which may be restored later on another platform'
Copy link
Contributor

Choose a reason for hiding this comment

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

This should change according to the one used for top level action

@Phantsure Phantsure merged commit 6fd2d45 into main Jan 5, 2023
SaschaMann added a commit to julia-actions/cache that referenced this pull request Jan 9, 2023
See actions/cache#1056.

Fixes #44 

---

As pointed out in the upstream actions, symlinks may lead to breakage. I don't think that affects the cached directories, does it?

I moved the compiled caching to its own steps, that way we enable people to benefit from cross-OS caching where possible while still caching compiled.
IanButterworth pushed a commit to IanButterworth/cache that referenced this pull request Jul 27, 2023
See actions/cache#1056.

Fixes julia-actions#44

---

As pointed out in the upstream actions, symlinks may lead to breakage. I don't think that affects the cached directories, does it?

I moved the compiled caching to its own steps, that way we enable people to benefit from cross-OS caching where possible while still caching compiled.
Dakshjain1 pushed a commit to SvavaCapital/cache that referenced this pull request Apr 19, 2024
* Add support to opt-in enable cross-os caching on windows

* Fix tests

* Address review comments and update tests

* Fix tests

* Address review comments

* Address review comments
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.

5 participants