Skip to content

Commit

Permalink
Merge branch 'guess_coord' of github.com:HGWright/iris into guess_coord
Browse files Browse the repository at this point in the history
* 'guess_coord' of github.com:HGWright/iris: (82 commits)
  [pre-commit.ci] auto fixes from pre-commit.com hooks
  [pre-commit.ci] pre-commit autoupdate (SciTools#5579)
  Relicense to from LGPL-3 to BSD-3 (SciTools#5577)
  Allow `add_season_year()` to optionally send spans backwards (SciTools#5573)
  Added xarray phrasebook doc page (SciTools#5564)
  fixed spacing (SciTools#5572)
  DOCS: Removed broken git links. (SciTools#5569)
  More sensible time axis and tick labels for 2D plots (SciTools#5561)
  removed now incorrect statement. (SciTools#5555)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5558)
  Exempt major release label from stalebot (SciTools#5559)
  updated link (SciTools#5556)
  Added whatsnew. (SciTools#5552)
  moved latest warning banner logic to conf.py (SciTools#5508)
  updated layout of top navbar (SciTools#5505)
  Oblique and Rotated Mercator (SciTools#5548)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5549)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5527)
  Bump scitools/workflows from 2023.09.1 to 2023.10.0 (SciTools#5540)
  nep29 drop table schedule numpy>1.21 (SciTools#5525)
  ...
  • Loading branch information
HGWright committed Nov 17, 2023
2 parents 6af7f81 + cfbe34f commit c8854d3
Show file tree
Hide file tree
Showing 660 changed files with 8,157 additions and 5,667 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/benchmarks_report.yml
@@ -0,0 +1,83 @@
# Post any reports generated by benchmarks_run.yml .
# Separated for security:
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

name: benchmarks-report
run-name: Report benchmark results

on:
workflow_run:
workflows: [benchmarks-run]
types:
- completed

jobs:
download:
runs-on: ubuntu-latest
outputs:
reports_exist: ${{ steps.unzip.outputs.reports_exist }}
steps:
- name: Download artifact
id: download-artifact
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "benchmark_reports"
})[0];
if (typeof matchArtifact != 'undefined') {
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/benchmark_reports.zip`, Buffer.from(download.data));
};
- name: Unzip artifact
id: unzip
run: |
if test -f "benchmark_reports.zip"; then
reports_exist=1
unzip benchmark_reports.zip -d benchmark_reports
else
reports_exist=0
fi
echo "reports_exist=$reports_exist" >> "$GITHUB_OUTPUT"
- name: Store artifact
uses: actions/upload-artifact@v3
with:
name: benchmark_reports
path: benchmark_reports

post_reports:
runs-on: ubuntu-latest
needs: download
if: needs.download.outputs.reports_exist == 1
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: benchmark_reports
path: .github/workflows/benchmark_reports

- name: Set up Python
# benchmarks/bm_runner.py only needs builtins to run.
uses: actions/setup-python@v4

- name: Post reports
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python benchmarks/bm_runner.py _gh_post
@@ -1,6 +1,9 @@
# Use ASV to check for performance regressions in the last 24 hours' commits.
# Use ASV to check for performance regressions, either:
# - In the last 24 hours' commits.
# - Introduced by this pull request.

name: benchmark-check
name: benchmarks-run
run-name: Run benchmarks

on:
schedule:
Expand All @@ -9,7 +12,7 @@ on:
workflow_dispatch:
inputs:
first_commit:
description: "Argument to be passed to the overnight benchmark script."
description: "First commit to benchmark (see bm_runner.py > Overnight)."
required: false
type: string
pull_request:
Expand All @@ -26,7 +29,7 @@ jobs:
env:
IRIS_TEST_DATA_LOC_PATH: benchmarks
IRIS_TEST_DATA_PATH: benchmarks/iris-test-data
IRIS_TEST_DATA_VERSION: "2.19"
IRIS_TEST_DATA_VERSION: "2.22"
# Lets us manually bump the cache to rebuild
ENV_CACHE_BUILD: "0"
TEST_DATA_CACHE_BUILD: "2"
Expand Down Expand Up @@ -74,12 +77,17 @@ jobs:
- name: Benchmark this pull request
if: ${{ github.event.label.name == 'benchmark_this' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
run: |
git checkout ${{ github.head_ref }}
python benchmarks/bm_runner.py branch origin/${{ github.base_ref }}
- name: Run overnight benchmarks
id: overnight
if: ${{ github.event_name != 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
first_commit=${{ inputs.first_commit }}
if [ "$first_commit" == "" ]
Expand All @@ -92,57 +100,27 @@ jobs:
python benchmarks/bm_runner.py overnight $first_commit
fi
- name: Create issues for performance shifts
if: ${{ github.event_name != 'pull_request' }}
- name: Warn of failure
if: >
failure() &&
steps.overnight.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -d benchmarks/.asv/performance-shifts ]
then
cd benchmarks/.asv/performance-shifts
for commit_file in *
do
commit="${commit_file%.*}"
pr_number=$(git log "$commit"^! --oneline | grep -o "#[0-9]*" | tail -1 | cut -c 2-)
author=$(gh pr view $pr_number --json author -q '.["author"]["login"]' --repo $GITHUB_REPOSITORY)
merger=$(gh pr view $pr_number --json mergedBy -q '.["mergedBy"]["login"]' --repo $GITHUB_REPOSITORY)
# Find a valid assignee from author/merger/nothing.
if curl -s https://api.github.com/users/$author | grep -q '"type": "User"'; then
assignee=$author
elif curl -s https://api.github.com/users/$merger | grep -q '"type": "User"'; then
assignee=$merger
else
assignee=""
fi
title="Performance Shift(s): \`$commit\`"
body="
Benchmark comparison has identified performance shifts at
* commit $commit (#$pr_number).
Please review the report below and \
take corrective/congratulatory action as appropriate \
:slightly_smiling_face:
title="Overnight benchmark workflow failed: \`${{ github.run_id }}\`"
body="Generated by GHA run [\`${{github.run_id}}\`](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})"
gh issue create --title "$title" --body "$body" --label "Bot" --label "Type: Performance" --repo $GITHUB_REPOSITORY
<details>
<summary>Performance shift report</summary>
\`\`\`
$(cat $commit_file)
\`\`\`
</details>
Generated by GHA run [\`${{github.run_id}}\`](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})
"
gh issue create --title "$title" --body "$body" --assignee $assignee --label "Bot" --label "Type: Performance" --repo $GITHUB_REPOSITORY
done
fi
- name: Upload any benchmark reports
if: success() || steps.overnight.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: benchmark_reports
path: .github/workflows/benchmark_reports

- name: Archive asv results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: asv-report
path: |
benchmarks/.asv/results
name: asv-raw-results
path: benchmarks/.asv/results
2 changes: 1 addition & 1 deletion .github/workflows/ci-manifest.yml
Expand Up @@ -23,4 +23,4 @@ concurrency:
jobs:
manifest:
name: "check-manifest"
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2023.05.0
uses: scitools/workflows/.github/workflows/ci-manifest.yml@2023.10.0
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Expand Up @@ -50,7 +50,7 @@ jobs:
session: "tests"

env:
IRIS_TEST_DATA_VERSION: "2.19"
IRIS_TEST_DATA_VERSION: "2.22"
ENV_NAME: "ci-tests"

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh-lockfiles.yml
Expand Up @@ -14,5 +14,5 @@ on:

jobs:
refresh_lockfiles:
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2023.05.0
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2023.10.0
secrets: inherit
14 changes: 7 additions & 7 deletions .github/workflows/stale.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
Otherwise this issue will be automatically closed in 28 days time.
# Comment on the staled prs.
stale-pr-message: |
stale-pr-message: |
In order to maintain a backlog of relevant PRs, we automatically label them as stale after 500 days of inactivity.
If this PR is still important to you, then please comment on this PR and the stale label will be removed.
Expand All @@ -43,32 +43,32 @@ jobs:
# Comment on the staled issues while closed.
close-issue-message: |
This stale issue has been automatically closed due to a lack of community activity.
If you still care about this issue, then please either:
* Re-open this issue, if you have sufficient permissions, or
* Add a comment pinging `@SciTools/iris-devs` who will re-open on your behalf.
* Add a comment stating that this is still relevant and someone will re-open it on your behalf.
# Comment on the staled prs while closed.
close-pr-message: |
This stale PR has been automatically closed due to a lack of community activity.
If you still care about this PR, then please either:
* Re-open this PR, if you have sufficient permissions, or
* Add a comment pinging `@SciTools/iris-devs` who will re-open on your behalf.
# Label to apply on staled issues.
# Label to apply on staled issues.
stale-issue-label: Stale

# Label to apply on staled prs.
stale-pr-label: Stale

# Labels on issues exempted from stale.
exempt-issue-labels:
"Status: Blocked,Status: Decision Required,Peloton 🚴‍♂️,Good First Issue"
"Status: Blocked,Status: Decision Required,Peloton 🚴‍♂️,Good First Issue, Dragon 🐉, Dragon Sub-Task 🦎, Release: Major"

# Labels on prs exempted from stale.
exempt-pr-labels:
"Status: Blocked,Status: Decision Required,Peloton 🚴‍♂️,Good First Issue"
"Status: Blocked,Status: Decision Required,Peloton 🚴‍♂️,Good First Issue, Dragon 🐉, Dragon Sub-Task 🦎, Release: Major"

# Max number of operations per run.
operations-per-run: 300
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -32,6 +32,7 @@ pip-cache
# asv data, environments, results
.asv
benchmarks/.data
.github/workflows/benchmark_reports

#Translations
*.mo
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Expand Up @@ -13,7 +13,7 @@ minimum_pre_commit_version: 1.21.0

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
# Prevent giant files from being committed.
- id: check-added-large-files
Expand All @@ -29,21 +29,21 @@ repos:
- id: no-commit-to-branch

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.4"
rev: "v2.2.6"
hooks:
- id: codespell
types_or: [asciidoc, python, markdown, rst]
additional_dependencies: [tomli]

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.11.0
hooks:
- id: black
pass_filenames: false
args: [--config=./pyproject.toml, .]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
types: [file, python]
Expand All @@ -56,7 +56,7 @@ repos:
args: [--filter-files]

- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.16.0
hooks:
- id: blacken-docs
types: [file, rst]
Expand Down

0 comments on commit c8854d3

Please sign in to comment.