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

Regenerating an out-of-date environment json fails #36

Closed
oruebel opened this issue Mar 8, 2024 · 5 comments
Closed

Regenerating an out-of-date environment json fails #36

oruebel opened this issue Mar 8, 2024 · 5 comments
Assignees
Labels
category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users

Comments

@oruebel
Copy link
Contributor

oruebel commented Mar 8, 2024

Traceback (most recent call last):
  File "...miniforge3/envs/nwb_benchmarks/bin/nwb_benchmarks", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "...nwb_benchmarks/src/nwb_benchmarks/command_line_interface.py", line 34, in main
    ensure_machine_info_current(file_path=default_asv_machine_file_path)
  File "....nwb_benchmarks/src/nwb_benchmarks/setup/_configure_machine.py", line 115, in ensure_machine_info_current
    machine_info_from_file.pop("custom")
KeyError: 'custom'
@oruebel oruebel added category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users labels Mar 8, 2024
@oruebel oruebel self-assigned this Mar 8, 2024
@CodyCBakerPhD
Copy link
Collaborator

Would you mind copying/pasting the contents of your .asv-machine.json file (located in your home directory)? The existence of this key at that level is important I think to the rest of the process

Did this file exist from an earlier point in this projects history (such as from calling simply asv machine)? If so it, may have gotten corrupted from an earlier version - I would suggest deleting it and calling nwb_benchmarks setup fresh

If not, did you call nwb_benchmarks setup before attempting nwb_benchmarks run for the first time? I can reproduce similar errors by not having the .asv-machine.json file before trying to run the benchmarks

@oruebel
Copy link
Contributor Author

oruebel commented Mar 9, 2024

Did this file exist from an earlier point in this projects history (such as from calling simply asv machine)?

I honestly don't remember, but I do believe the previous file was generated before you had added the custom modifications.

If not, did you call nwb_benchmarks setup before attempting nwb_benchmarks run for the first time?

Yes, but nwb_benchmarks setup also failed because of the .pop calls where expected keys were missing.

Would you mind copying/pasting the contents of your .asv-machine.json file

I unfortunately don't have the original asv file any more. One way to reproduce the issue is to just remove one of the expected keys from the .asv-machine.json to trigger the issue.

The changes I made in the corresponding PR #37, in many ways just safeguard against missing keys and forces that the file is being regenerated also if expected keys are missing. So it just catches those as additional cases that should trigger a recreation of the .asv-machine.json file.

The benchmarks are working now on my labtop.

@CodyCBakerPhD
Copy link
Collaborator

Yes, but nwb_benchmarks setup also failed because of the .pop calls where expected keys were missing.

I see, I always delete the file manually before running that under the assumption it's a clean system

I think it would be a lot simpler, instead of catching any/all weird conditions it might just be worth it to regenerate the .asv-machine.json file every single time (we actually grab all the system spec anyway each time to compare to 'make sure')

I'll open a PR for that, will cut down on the amount of code

@oruebel
Copy link
Contributor Author

oruebel commented Mar 9, 2024

Sounds good. In that case we can probably just close the PR I had created

@CodyCBakerPhD
Copy link
Collaborator

fixed by #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants