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

use tox and set up CRDS caching when server is accessible #551

Merged
merged 23 commits into from
Nov 28, 2022

Conversation

zacharyburnett
Copy link
Collaborator

@zacharyburnett zacharyburnett commented Jul 27, 2022

This PR turns the existing dependent-workflow structure back into tox, and caches CRDS data for the same operational context, so it is not downloaded every time. This functionality is not currently useful (it is skipped currently) but will become useful when Roman CRDS becomes publicly available.

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

@zacharyburnett zacharyburnett marked this pull request as draft July 27, 2022 14:48
@zacharyburnett zacharyburnett self-assigned this Jul 27, 2022
@zacharyburnett
Copy link
Collaborator Author

zacharyburnett commented Jul 27, 2022

this should be a draft until the Roman CRDS test server is available outside the VPN (and is used in tests) see #551 (comment)

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Base: 81.83% // Head: 81.83% // No change to project coverage 👍

Coverage data is based on head (6f7ac0c) compared to base (499e9c0).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #551   +/-   ##
=======================================
  Coverage   81.83%   81.83%           
=======================================
  Files          39       39           
  Lines        1167     1167           
=======================================
  Hits          955      955           
  Misses        212      212           
Flag Coverage Δ *Carryforward flag
nightly 81.83% <ø> (ø) Carriedforward from 499e9c0
unit 46.46% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zacharyburnett zacharyburnett marked this pull request as ready for review August 1, 2022 18:38
@zacharyburnett
Copy link
Collaborator Author

zacharyburnett commented Aug 1, 2022

commit 456a3c6 skips CRDS caching if the context retrieval fails, so as soon as Roman CRDS is publicly available it should start caching

Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

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

I think that having the crds sync setup is a good idea but we might want to be a bit careful here. Doing a full crds sync can take a while (several hours?).
We might want to be more targeted and allow sync to a specific context or contexts, e.g.
crds sync --contexts roman_0001.pmap roman_0002.pmap

@zacharyburnett
Copy link
Collaborator Author

zacharyburnett commented Aug 3, 2022

Ok, right now it's using the result of crds list --operational-context (so in effect doing crds sync --contexts $(crds list --operational-context)), but is there a set list of contexts that should be used for the tests specifically?

- run: echo "CRDS_CONTEXT=$(crds list --operational-context)" >> $GITHUB_ENV
- uses: actions/[email protected]
if: env.CRDS_CONTEXT != ''
with:
path: ${{ env.CRDS_PATH }}
key: crds-${{ env.CRDS_CONTEXT }}
- run: crds sync --contexts ${{ env.CRDS_CONTEXT }}
if: env.CRDS_CONTEXT != ''

@ddavis-stsci
Copy link
Collaborator

ddavis-stsci commented Aug 3, 2022 via email

@zacharyburnett
Copy link
Collaborator Author

zacharyburnett commented Aug 3, 2022

That is why I was thinking it might be good if we could specify the context or override the defaults somehow.

Ok, I added a workflow_dispatch: input with 6b1f27d, that should allow manual run (from the website) of a workflow with a specific CRDS context as an override.

workflow_dispatch:
inputs:
crds_context:
type: string
description: CRDS context(s) to use with tests (defaults to operational context)
required: false

- run: echo "CRDS_CONTEXT=$(crds list --operational-context)" >> $GITHUB_ENV
if: github.event.inputs.crds_context == ''
- run: echo "CRDS_CONTEXT=${{ github.event.inputs.crds_context }}" >> $GITHUB_ENV
if: github.event.inputs.crds_context != ''

@zacharyburnett zacharyburnett enabled auto-merge (squash) August 3, 2022 19:59
@zacharyburnett zacharyburnett disabled auto-merge August 5, 2022 16:10
@zacharyburnett zacharyburnett force-pushed the ci_cache_crds branch 2 times, most recently from c2ca302 to b5b6a94 Compare August 12, 2022 16:01
@zacharyburnett zacharyburnett force-pushed the ci_cache_crds branch 3 times, most recently from 41b8c76 to 6875f3c Compare October 31, 2022 18:20
@zacharyburnett zacharyburnett changed the title Cache CRDS from current operational context in test workflow use tox and set up CRDS caching when server is accessible Oct 31, 2022
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Nov 1, 2022
@zacharyburnett zacharyburnett force-pushed the ci_cache_crds branch 3 times, most recently from e1f8fb4 to d027997 Compare November 1, 2022 15:16
Copy link
Collaborator

@nden nden left a comment

Choose a reason for hiding this comment

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

This looks good to me.
@ddavis-stsci Are all your concerns addressed?

The PR needs a rebase.

Copy link
Collaborator

@ddavis-stsci ddavis-stsci left a comment

Choose a reason for hiding this comment

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

Yes I'm good with the changes.

@zacharyburnett
Copy link
Collaborator Author

doing some updates to match the JWST workflow; I'll merge when tests pass

@zacharyburnett zacharyburnett merged commit 914c407 into spacetelescope:main Nov 28, 2022
@zacharyburnett zacharyburnett deleted the ci_cache_crds branch November 28, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation dependencies Pull requests that update a dependency file testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants