Skip to content

Avoid artifact upload collisions between benchmark jobs - #487

Open
savannahostrowski wants to merge 2 commits into
python:mainfrom
savannahostrowski:fix/benchmark-artifact-names
Open

savannahostrowski wants to merge 2 commits into
python:mainfrom
savannahostrowski:fix/benchmark-artifact-names

Conversation

@savannahostrowski

Copy link
Copy Markdown
Member

Another cherry-pick as I upstream fixes from my fork :)

This PR avoids artifact upload collisions between benchmark jobs by including the machine nickname and flags in artifact names. Currently, all jobs upload under the name benchmark, so concurrent uploads can race and fail even with overwrite: true.

uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0
with:
name: benchmark
name: benchmark-${{ env.BENCHMARK_MACHINE_NICKNAME }}-${{ env.flags }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not sure what happens here, but _benchmark is called twice:

https://github.com/python/bench_runner/blob/main/bench_runner/templates/benchmark.src.yml#L75-L87

Does it mean reusing or ovewriting? I worry it's the latter

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah yeah, good catch. _benchmark can run for both head and base when “Also benchmark the base of this commit” is selected on a benchmark run, so machine and flags alone aren’t enough. I think I can just suffix the artifact names with job.check_run_id, which is unique to each job execution, and apply the same naming to perf artifacts too.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants