submit_azureml_pytest_6.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. def create_arg_parser():
  2. """
  3. Many of the argument defaults are used as arg_parser makes it easy to
  4. use defaults. The user has many options they can select.
  5. """
  6. parser = argparse.ArgumentParser(description='Process some inputs')
  7. # script to run pytest
  8. parser.add_argument("--test",
  9. action="store",
  10. default="./tests/ci/run_pytest.py",
  11. help="location of script to run pytest")
  12. # test folder
  13. parser.add_argument("--testfolder",
  14. action="store",
  15. default="./tests/unit",
  16. help="folder where tests are stored")
  17. # pytest test markers
  18. parser.add_argument("--testmarkers",
  19. action="store",
  20. default="not notebooks and not spark and not gpu",
  21. help="pytest markers indicate tests to run")
  22. # test summary file
  23. parser.add_argument("--junitxml",
  24. action="store",
  25. default="reports/test-unit.xml",
  26. help="file for returned test results")
  27. # max num nodes in Azure cluster
  28. parser.add_argument("--maxnodes",
  29. action="store",
  30. default=4,
  31. help="specify the maximum number of nodes for the run")
  32. # Azure resource group
  33. parser.add_argument("--rg",
  34. action="store",
  35. default="recommender",
  36. help="Azure Resource Group")
  37. # AzureML workspace Name
  38. parser.add_argument("--wsname",
  39. action="store",
  40. default="RecoWS",
  41. help="AzureML workspace name")
  42. # AzureML clustername
  43. parser.add_argument("--clustername",
  44. action="store",
  45. default="amlcompute",
  46. help="Set name of Azure cluster")
  47. # Azure VM size
  48. parser.add_argument("--vmsize",
  49. action="store",
  50. default="STANDARD_D3_V2",
  51. help="Set the size of the VM either STANDARD_D3_V2")
  52. # cpu or gpu
  53. parser.add_argument("--dockerproc",
  54. action="store",
  55. default="cpu",
  56. help="Base image used in docker container")
  57. # Azure subscription id, when used in a pipeline, it is stored in keyvault
  58. parser.add_argument("--subid",
  59. action="store",
  60. default="123456",
  61. help="Azure Subscription ID")
  62. # ./reco.yaml is created in the azure devops pipeline.
  63. # Not recommended to change this.
  64. parser.add_argument("--condafile",
  65. action="store",
  66. default="./reco.yaml",
  67. help="file with environment variables")
  68. # AzureML experiment name
  69. parser.add_argument("--expname",
  70. action="store",
  71. default="persistentAML",
  72. help="experiment name on Azure")
  73. # Azure datacenter location
  74. parser.add_argument("--location",
  75. default="EastUS",
  76. help="Azure location")
  77. # github repo, stored in AzureML experiment for info purposes
  78. parser.add_argument("--reponame",
  79. action="store",
  80. default="--reponame MyGithubRepo",
  81. help="GitHub repo being tested")
  82. # github branch, stored in AzureML experiment for info purposes
  83. parser.add_argument("--branch",
  84. action="store",
  85. default="--branch MyGithubBranch",
  86. help=" Identify the branch test test is run on")
  87. # github pull request, stored in AzureML experiment for info purposes
  88. parser.add_argument("--pr",
  89. action="store",
  90. default="--pr PRTestRun",
  91. help="If a pr triggered the test, list it here")
  92. args = parser.parse_args()
  93. return args