-
Notifications
You must be signed in to change notification settings - Fork 28
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] if latest contexts have changed, retrieve the previous contexts' test cache and then use ./setup_test_cache u
to update
#1099
Merged
zacharyburnett
merged 4 commits into
spacetelescope:master
from
zacharyburnett:ci/update_partial_cache
Nov 27, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
393f1cb
use `./setup_test_cache u` to update a previous existing cache
zacharyburnett 9189971
only clone cache test repo if cache not hit
zacharyburnett c30d031
don't uninstall crds just to install it again
zacharyburnett 58fe658
always run `./setup_test_cache` with `u`
zacharyburnett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: test cache | ||
name: download CRDS test cache | ||
|
||
on: | ||
workflow_call: | ||
|
@@ -43,7 +43,7 @@ jobs: | |
repository: spacetelescope/crds | ||
- id: key | ||
run: echo "key=test-cache-${{ needs.contexts.outputs.hst }}-${{ needs.contexts.outputs.jwst }}" >> $GITHUB_OUTPUT | ||
- id: lookup-combined-cache | ||
- id: lookup-cache | ||
name: check for existence of combined CRDS cache (`${{ steps.key.outputs.key }}`) | ||
uses: actions/cache/restore@v4 | ||
with: | ||
|
@@ -52,26 +52,22 @@ jobs: | |
${{ env.CRDS_TESTING_CACHE }} | ||
key: ${{ steps.key.outputs.key }} | ||
lookup-only: true | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
id: crds-cache-test | ||
- if: steps.lookup-cache.outputs.cache-hit != 'true' | ||
id: retrieve-previous-cache | ||
name: retrieve a previous combined CRDS cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
${{ env.CRDS_PATH }} | ||
${{ env.CRDS_TESTING_CACHE }} | ||
key: ${{ steps.key.outputs.key }} | ||
restore-keys: | | ||
test-cache- | ||
- if: steps.retrieve-previous-cache.outputs.cache-matched-key == '' | ||
run: | | ||
git clone https://github.com/spacetelescope/crds-cache-test.git | ||
mv crds-cache-test ${{ env.CRDS_TEST_ROOT }} | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
id: retrieve-hst-cache | ||
name: retrieve HST CRDS cache (`test-cache-${{ needs.contexts.outputs.hst }}`) | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.CRDS_PATH }}/**/hst* | ||
key: test-cache-${{ needs.contexts.outputs.hst }} | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
id: retrieve-jwst-cache | ||
name: retrieve JWST CRDS cache (`test-cache-${{ needs.contexts.outputs.jwst }}`) | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.CRDS_PATH }}/**/jwst* | ||
key: test-cache-${{ needs.contexts.outputs.jwst }} | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
- if: steps.lookup-cache.outputs.cache-hit != 'true' | ||
uses: mamba-org/setup-micromamba@v2 | ||
with: | ||
environment-name: crds-testing | ||
|
@@ -87,13 +83,13 @@ jobs: | |
init-shell: bash | ||
cache-environment: true | ||
cache-downloads: true | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
- if: steps.lookup-cache.outputs.cache-hit != 'true' | ||
run: ./install | ||
- if: steps.lookup-cache.outputs.cache-hit != 'true' | ||
run: pip install git+https://github.com/spacetelescope/jwst roman-datamodels | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
run: pip uninstall --yes crds && ./install && pip install . | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
run: ./setup_test_cache ${{ env.CRDS_TEST_ROOT }} ${{ (steps.retrieve-hst-cache.outputs.cache-hit == 'true' || steps.retrieve-jwst-cache.outputs.cache-hit == 'true') && 'u' || 'c' }} | ||
- if: steps.lookup-combined-cache.outputs.cache-hit != 'true' | ||
- if: steps.lookup-cache.outputs.cache-hit != 'true' | ||
run: ./setup_test_cache ${{ env.CRDS_TEST_ROOT }} u | ||
- if: steps.lookup-cache.outputs.cache-hit != 'true' | ||
Comment on lines
-94
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't ever need to run with |
||
name: save combined CRDS cache (`${{ steps.key.outputs.key }}`) | ||
uses: actions/cache/save@v4 | ||
with: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a cache with the latest contexts does not exist, attempt to retrieve a previous cache that does exist (with the intent of running
./setup_test_cache /tmp u
on it later)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure what is happening there. I know there are differences between the two contexts, but I feel like the test cache had nothing to update.