airspeed-velocity / asv

Airspeed Velocity: A simple Python benchmarking tool with web-based reporting
https://asv.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
874 stars 180 forks source link

Several issues with setting machine info #944

Open thomasaarholt opened 4 years ago

thomasaarholt commented 4 years ago

I've been setting up / debugging a github action to run a benchmark on a repo, and then push the html and results to a separate repo. Since the github action runs on a fresh server instance each time, the following may be related to that:

  1. Calling asv machine --name test results in the following response when ~/.asv-machine.json does not exist. The hostname in this case is smnpc-fp58, and this happens both in PowerShell and bash. The file is created with the correct machine name. The same response occurs if I specify all other options as well.
 $ asv machine --machine test
· No information stored about machine 'smnpc-fp58'. I know about nothing.
  1. Calling asv machine --"specifying all options and setting --machine hostname results in the following error and no file generated, when ~/.asv-machine.json does not exist.
$ asv machine --machine smnpc-fp58 --os test --arch test --cpu test --num_cpu 1 --ram '1GB'

· No information stored about machine 'smnpc-fp58'. I know about nothing.

Traceback (most recent call last):
  File "c:\users\thomasaar\.conda\envs\py7\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\thomasaar\.conda\envs\py7\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\thomasaar\.conda\envs\py7\Scripts\asv.exe\__main__.py", line 7, in <module>
  File "c:\users\thomasaar\.conda\envs\py7\lib\site-packages\asv\main.py", line 38, in main
    result = args.func(args)
  File "c:\users\thomasaar\.conda\envs\py7\lib\site-packages\asv\commands\__init__.py", line 49, in run_from_args
    return cls.run_from_conf_args(conf, args)
  File "c:\users\thomasaar\.conda\envs\py7\lib\site-packages\asv\commands\machine.py", line 40, in run_from_conf_args
    return cls.run(**vars(args))
  File "c:\users\thomasaar\.conda\envs\py7\lib\site-packages\asv\commands\machine.py", line 54, in run
    use_defaults=use_defaults, **different)
  File "c:\users\thomasaar\.conda\envs\py7\lib\site-packages\asv\machine.py", line 205, in load
    machine_name = d['machine']
KeyError: 'machine'
patrick91 commented 2 years ago

@thomasaarholt did you figure this out? I'm having the same issue on github actions

thomasaarholt commented 2 years ago

Sorry, I did not. :( I don't think I learnt anything more than is written above

patrick91 commented 2 years ago

@thomasaarholt thanks for the answers, I think I worked around this by creating the ~/.asv-machine.json file by hand :)