From 974682f39e52e3d719c8d338b8f3ab32a644c313 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 12 Dec 2024 15:48:29 -0500 Subject: [PATCH] [CI] set default CRDS context to `jwst-edit` (#8987) --- .github/workflows/ci.yml | 20 +++++--------------- .github/workflows/ci_cron.yml | 18 ++++-------------- .github/workflows/contexts.yml | 26 -------------------------- .github/workflows/tests_devdeps.yml | 18 ++++-------------- 4 files changed, 13 insertions(+), 69 deletions(-) delete mode 100644 .github/workflows/contexts.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c46a1f25f..1d712bc1a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ on: type: string required: false default: '' - crds_server: - description: CRDS server + crds_server_url: + description: CRDS server URL type: string required: false default: https://jwst-crds.stsci.edu @@ -46,28 +46,18 @@ jobs: envs: | - linux: check-dependencies - linux: check-types - latest_crds_contexts: - uses: ./.github/workflows/contexts.yml - crds_context: - needs: [ latest_crds_contexts ] - runs-on: ubuntu-latest - steps: - - id: context - run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.jwst) || needs.latest_crds_contexts.outputs.jwst }} >> $GITHUB_OUTPUT - outputs: - context: ${{ steps.context.outputs.context }} test: uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 needs: [ crds_context ] with: setenv: | CRDS_PATH: /tmp/data/crds_cache - CRDS_SERVER_URL: ${{ github.event_name == 'workflow_dispatch' && inputs.crds_server || 'https://jwst-crds.stsci.edu' }} - CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }} + CRDS_SERVER_URL: ${{ inputs.crds_server_url || 'https://jwst-crds.stsci.edu' }} + CRDS_CONTEXT: ${{ inputs.crds_context || 'jwst-edit' }} CRDS_CLIENT_RETRY_COUNT: 3 CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 cache-path: /tmp/data/crds_cache - cache-key: crds-${{ needs.crds_context.outputs.context }} + cache-key: crds-${{ inputs.crds_context || 'jwst-edit' }} envs: | - linux: py310-oldestdeps-xdist-cov pytest-results-summary: true diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index c0db35ced5..3f19dbe425 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -11,8 +11,8 @@ on: type: string required: false default: '' - crds_server: - description: CRDS server + crds_server_url: + description: CRDS server URL type: string required: false default: https://jwst-crds.stsci.edu @@ -22,16 +22,6 @@ concurrency: cancel-in-progress: true jobs: - latest_crds_contexts: - uses: ./.github/workflows/contexts.yml - crds_context: - needs: [ latest_crds_contexts ] - runs-on: ubuntu-latest - steps: - - id: context - run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.jwst) || needs.latest_crds_contexts.outputs.jwst }} >> $GITHUB_OUTPUT - outputs: - context: ${{ steps.context.outputs.context }} test: if: (github.repository == 'spacetelescope/jwst' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run scheduled tests'))) uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 @@ -39,8 +29,8 @@ jobs: with: setenv: | CRDS_PATH: /tmp/crds_cache - CRDS_SERVER_URL: ${{ github.event_name == 'workflow_dispatch' && inputs.crds_server || 'https://jwst-crds.stsci.edu' }} - CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }} + CRDS_SERVER_URL: ${{ inputs.crds_server_url || 'https://jwst-crds.stsci.edu' }} + CRDS_CONTEXT: ${{ inputs.crds_context || 'jwst-edit' }} CRDS_CLIENT_RETRY_COUNT: 3 CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 cache-path: /tmp/crds_cache diff --git a/.github/workflows/contexts.yml b/.github/workflows/contexts.yml deleted file mode 100644 index b3047bdb63..0000000000 --- a/.github/workflows/contexts.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: contexts - -on: - workflow_call: - outputs: - jwst: - value: ${{ jobs.contexts.outputs.jwst }} - workflow_dispatch: - -jobs: - contexts: - name: retrieve latest CRDS contexts - runs-on: ubuntu-latest - outputs: - jwst: ${{ steps.jwst_crds_context.outputs.pmap }} - steps: - - id: jwst_crds_context - env: - OBSERVATORY: jwst - CRDS_SERVER_URL: https://jwst-crds.stsci.edu - run: > - echo "pmap=$( - curl -s -X POST -d '{"jsonrpc": "1.0", "method": "get_default_context", "params": ["${{ env.OBSERVATORY }}", null], "id": 1}' ${{ env.CRDS_SERVER_URL }}/json/ --retry 8 --connect-timeout 10 | - python -c "import sys, json; print(json.load(sys.stdin)['result'])" - )" >> $GITHUB_OUTPUT - - run: if [[ ! -z "${{ steps.jwst_crds_context.outputs.pmap }}" ]]; then echo ${{ steps.jwst_crds_context.outputs.pmap }}; else exit 1; fi diff --git a/.github/workflows/tests_devdeps.yml b/.github/workflows/tests_devdeps.yml index dda0e41f77..8db7c09c01 100644 --- a/.github/workflows/tests_devdeps.yml +++ b/.github/workflows/tests_devdeps.yml @@ -20,8 +20,8 @@ on: type: string required: false default: '' - crds_server: - description: CRDS server + crds_server_url: + description: CRDS server URL type: string required: false default: https://jwst-crds.stsci.edu @@ -31,16 +31,6 @@ concurrency: cancel-in-progress: true jobs: - latest_crds_contexts: - uses: ./.github/workflows/contexts.yml - crds_context: - needs: [ latest_crds_contexts ] - runs-on: ubuntu-latest - steps: - - id: context - run: echo context=${{ github.event_name == 'workflow_dispatch' && (inputs.crds_context != '' && inputs.crds_context || needs.latest_crds_contexts.outputs.jwst) || needs.latest_crds_contexts.outputs.jwst }} >> $GITHUB_OUTPUT - outputs: - context: ${{ steps.context.outputs.context }} test: if: (github.repository == 'spacetelescope/jwst' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'run devdeps tests'))) uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@9f1f43251dde69da8613ea8e11144f05cdea41d5 # v1.15.0 @@ -48,8 +38,8 @@ jobs: with: setenv: | CRDS_PATH: /tmp/data/crds_cache - CRDS_SERVER_URL: ${{ github.event_name == 'workflow_dispatch' && inputs.crds_server || 'https://jwst-crds.stsci.edu' }} - CRDS_CONTEXT: ${{ needs.crds_context.outputs.context }} + CRDS_SERVER_URL: ${{ inputs.crds_server_url || 'https://jwst-crds.stsci.edu' }} + CRDS_CONTEXT: ${{ inputs.crds_context || 'jwst-edit' }} CRDS_CLIENT_RETRY_COUNT: 3 CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 cache-path: /tmp/data/crds_cache