From 6111decc789d39a7b98a01729d13ca65f2a05130 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:28:16 +0000 Subject: [PATCH 1/4] per dtcenter/MET#2796, update versions of actions to prevent deprecated node warnings in GHA runs - main_v5.1 --- .github/workflows/documentation.yml | 8 ++++---- .github/workflows/testing.yml | 18 +++++++++--------- .github/workflows/update_truth.yml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 6f8c9b3d45..9a492b652e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -16,8 +16,8 @@ jobs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - name: Install dependencies @@ -27,12 +27,12 @@ jobs: python -m pip install -r docs/requirements.txt - name: Build Documentation run: ./.github/jobs/build_documentation.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: METplus_documentation path: artifact/documentation - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: documentation_warnings.log diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 4c6e144e8c..450e92ec5e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -65,7 +65,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set job controls id: job_status run: .github/jobs/set_job_controls.sh @@ -88,8 +88,8 @@ jobs: needs: job_control if: ${{ needs.job_control.outputs.run_get_image == 'true' }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - name: Get METplus Image @@ -130,7 +130,7 @@ jobs: matrix: ${{fromJson(needs.job_control.outputs.matrix)}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Free disk space run: .github/jobs/free_disk_space.sh @@ -173,14 +173,14 @@ jobs: run: .github/jobs/copy_output_to_artifact.sh ${{ steps.get-artifact-name.outputs.artifact_name }} - name: Upload output data artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() && steps.run_tests.conclusion != 'skipped' && !startsWith(matrix.categories,'pytests') }} with: name: ${{ steps.get-artifact-name.outputs.artifact_name }} path: artifact/${{ steps.get-artifact-name.outputs.artifact_name }} - name: Upload error logs artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() && steps.save-errors.outputs.upload_error_logs }} with: name: error_logs @@ -188,7 +188,7 @@ jobs: if-no-files-found: ignore - name: Upload difference data artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ always() && steps.run-diff.outputs.upload_diff == 'true' }} with: name: diff-${{ steps.get-artifact-name.outputs.artifact_name }} @@ -201,8 +201,8 @@ jobs: needs: [use_case_tests] if: ${{ needs.job_control.outputs.run_save_truth_data == 'true' }} steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 - run: .github/jobs/create_output_data_volumes.sh env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} diff --git a/.github/workflows/update_truth.yml b/.github/workflows/update_truth.yml index cf9734e449..4b8c310dd7 100644 --- a/.github/workflows/update_truth.yml +++ b/.github/workflows/update_truth.yml @@ -26,7 +26,7 @@ jobs: fi echo ERROR: Branch is $branch_name - must be develop or match main_vX.Y exit 1 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Checkout repository with: fetch-depth: 0 From 8bfe29a7ef88ba29ba54be23543e583526ff8b3d Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:34:12 +0000 Subject: [PATCH 2/4] fix ReadTheDocs requirements to include pillow which is a dependency of sphinx-gallery: see https://blog.readthedocs.com/defaulting-latest-build-tools/ for more info on why this was necessary --- docs/requirements.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 9e01ed25f1..6bbf0dbad2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,5 @@ -sphinx-gallery==0.11.1 sphinx==5.3.0 -sphinx-rtd-theme==1.2.0 +pillow==10.0.1 +sphinx-gallery==0.14.0 +sphinx-rtd-theme==1.3.0 sphinx-design==0.3.0 From 1193dfa5af7977289e821fb38e6ffdf74b3e5468 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:54:36 +0000 Subject: [PATCH 3/4] install python packages via apk instead of pip to prevent GHA failures that were fixed in develop but not in main_v5.1 --- .github/actions/run_tests/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/actions/run_tests/Dockerfile b/.github/actions/run_tests/Dockerfile index f76b50ffae..8e4636d235 100644 --- a/.github/actions/run_tests/Dockerfile +++ b/.github/actions/run_tests/Dockerfile @@ -3,8 +3,6 @@ FROM alpine:latest COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh -RUN apk add --update --no-cache docker python3 py3-pip bash - -RUN pip3 install python-dateutil requests +RUN apk add --update --no-cache docker python3 py3-pip bash py3-dateutil py3-requests ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file From 50a8bf423972cfa14d30f0737043b074c5faae7b Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:13:22 -0700 Subject: [PATCH 4/4] per dtcenter/MET#2796, fix error log merging for main_v5.1 same as develop --- .github/workflows/testing.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 450e92ec5e..6d7398599e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -183,7 +183,7 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ always() && steps.save-errors.outputs.upload_error_logs }} with: - name: error_logs + name: error_logs-${{ steps.get-artifact-name.outputs.artifact_name }} path: artifact/error_logs if-no-files-found: ignore @@ -195,6 +195,33 @@ jobs: path: artifact/diff-${{ steps.get-artifact-name.outputs.artifact_name }} if-no-files-found: ignore + merge_error_logs: + name: Merge Error Logs + runs-on: ubuntu-latest + needs: use_case_tests + if: ${{ always() && needs.use_case_tests.result == 'failure' }} + steps: + - uses: actions/checkout@v4 + - name: Check for error logs + id: check-for-error-logs + run: | + json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs") + error_log_jobs=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("Use Case Tests")) | .steps[] | select(.name | startswith("Save error logs")) | select(.conclusion | startswith("success"))')) + # save output variable to merge error logs if any error logs were created + if [ ! -z "${error_log_jobs}" ]; then + echo "has_error_logs=true" >> $GITHUB_OUTPUT + else + echo "has_error_logs=false" >> $GITHUB_OUTPUT + fi + - name: Merge Artifacts + if: ${{ always() && steps.check-for-error-logs.outputs.has_error_logs == 'true' }} + uses: actions/upload-artifact/merge@v4 + with: + name: error_logs + pattern: error_logs-* + delete-merged: true + create_output_data_volumes: name: Create Output Docker Data Volumes runs-on: ubuntu-latest