squidient 2.2.0__tar.gz → 2.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. {squidient-2.2.0 → squidient-2.4.0}/.gitignore +1 -0
  2. {squidient-2.2.0 → squidient-2.4.0}/PKG-INFO +1 -1
  3. {squidient-2.2.0 → squidient-2.4.0}/pyproject.toml +1 -1
  4. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/builds/benchmarkbuilder.py +1 -3
  5. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/builds/builder.py +50 -44
  6. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/cli.py +22 -23
  7. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/codecoverage/codecoverage.py +2 -3
  8. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/codecoverage/gcovrcodecoverage.py +7 -7
  9. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/codecoverage/intelcodecoverage.py +14 -18
  10. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/connection/job.py +4 -5
  11. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/git.py +2 -1
  12. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/init.py +2 -1
  13. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/monitor/monitor.py +26 -37
  14. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/monitor/monitordb.py +4 -7
  15. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/sqreport/squidientbasereport.py +3 -2
  16. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/sqreport/squidientcasereport.py +4 -3
  17. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/sqreport/squidientdetailedreport.py +6 -5
  18. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/sqreport/squidientfullreport.py +2 -1
  19. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/squidient.py +54 -54
  20. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/squidientmonitor.py +22 -20
  21. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/staging/staging.py +78 -105
  22. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/platform.py +2 -1
  23. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/queuetester.py +7 -7
  24. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/terraform/terraform.py +16 -18
  25. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/benchmarktester.py +8 -15
  26. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/instance.py +3 -2
  27. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/test.py +2 -2
  28. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/tester.py +53 -50
  29. squidient-2.4.0/src/squidient/utils/message.py +157 -0
  30. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/utils/watchdog.py +7 -8
  31. squidient-2.2.0/.ci-cd/python-ci/README.md +0 -2
  32. squidient-2.2.0/src/squidient/utils/message.py +0 -64
  33. {squidient-2.2.0 → squidient-2.4.0}/LICENSE.txt +0 -0
  34. {squidient-2.2.0 → squidient-2.4.0}/README.md +0 -0
  35. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/__init__.py +0 -0
  36. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/builds/benchmarkbuild.py +0 -0
  37. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/builds/build.py +0 -0
  38. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/builds/executablebuild.py +0 -0
  39. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/builds/predefinedbuild.py +0 -0
  40. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/compare.py +0 -0
  41. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/comparewithdifftable.py +0 -0
  42. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/absolute.py +0 -0
  43. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/close.py +0 -0
  44. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/diff.py +0 -0
  45. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/l1norm.py +0 -0
  46. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/l1relative.py +0 -0
  47. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/l2norm.py +0 -0
  48. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/l2relative.py +0 -0
  49. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/linfnorm.py +0 -0
  50. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/linfrelative.py +0 -0
  51. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/power.py +0 -0
  52. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/relative.py +0 -0
  53. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/scalartolerance.py +0 -0
  54. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/tolerance.py +0 -0
  55. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compare/methods/vectortolerance.py +0 -0
  56. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/compilation/cmakeoptions.py +0 -0
  57. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/configure.py +0 -0
  58. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/connection/buildlock.py +0 -0
  59. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/connection/ssh.py +0 -0
  60. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/connection/sshconfigchecker.py +0 -0
  61. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/.squidient-initialized +0 -0
  62. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-alamak.json +0 -0
  63. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-chemint.json +0 -0
  64. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-clang.json +0 -0
  65. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-commdom.json +0 -0
  66. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-gnu.json +0 -0
  67. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-intel.json +0 -0
  68. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-mumps.json +0 -0
  69. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-nvhpc.json +0 -0
  70. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/alya-config/cmake-talp.json +0 -0
  71. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/benchmarks/benchmarks.json +0 -0
  72. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/builds/builds.json +0 -0
  73. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/builds/cc.json +0 -0
  74. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/builds/defaults.json +0 -0
  75. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/builds/predefined-old.json +0 -0
  76. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/builds/predefined.json +0 -0
  77. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/configurations/projects.json +0 -0
  78. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/configurations/systems.json +0 -0
  79. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/configurations/tests.json +0 -0
  80. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/email/report.html +0 -0
  81. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/icons/big.png +0 -0
  82. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/icons/small.png +0 -0
  83. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/index.html +0 -0
  84. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/.gitignore +0 -0
  85. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small/.gitignore +0 -0
  86. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small/t3.small/cloud-init-slurm-fedora.sh +0 -0
  87. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small/t3.small/t3.small.tf +0 -0
  88. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small/t3.small/terraform.tfvars +0 -0
  89. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/.gitignore +0 -0
  90. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/cloud-init-slurm-fedora.sh +0 -0
  91. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/replace-var.sh +0 -0
  92. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/t3.small.tf +0 -0
  93. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/terraform.tfvars +0 -0
  94. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/.gitignore +0 -0
  95. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/cloud-init-slurm-fedora.sh +0 -0
  96. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/t3.small.tf +0 -0
  97. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/terraform.tfvars +0 -0
  98. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/version/version.json +0 -0
  99. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/bb.html +0 -0
  100. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/benchmarks.html +0 -0
  101. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/btest.html +0 -0
  102. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/btests.html +0 -0
  103. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/builds.html +0 -0
  104. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/cc-gcovr.html +0 -0
  105. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/cc-intel.html +0 -0
  106. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/files.html +0 -0
  107. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/canceled.png +0 -0
  108. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/created.png +0 -0
  109. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/failed.png +0 -0
  110. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/failed_black.png +0 -0
  111. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/failed_green.png +0 -0
  112. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/file_cloud.png +0 -0
  113. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/file_config.png +0 -0
  114. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/file_ko.png +0 -0
  115. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/file_ok.png +0 -0
  116. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/skipped.png +0 -0
  117. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/squidient_logo.png +0 -0
  118. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/success.png +0 -0
  119. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/success_black.png +0 -0
  120. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/timeout.png +0 -0
  121. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/tolerance.png +0 -0
  122. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/warning.png +0 -0
  123. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/warning_black.png +0 -0
  124. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/png/warning_green.png +0 -0
  125. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/canceled.svg +0 -0
  126. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/created.svg +0 -0
  127. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/failed.svg +0 -0
  128. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/failed_black.svg +0 -0
  129. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/failed_green.svg +0 -0
  130. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/manual.svg +0 -0
  131. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/running.svg +0 -0
  132. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/skipped.svg +0 -0
  133. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/success.svg +0 -0
  134. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/success_black.svg +0 -0
  135. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/warning.svg +0 -0
  136. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/warning_black.svg +0 -0
  137. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/img/svg/warning_green.svg +0 -0
  138. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/index.html +0 -0
  139. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/jquery.dynatable.css +0 -0
  140. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/jquery.dynatable.js +0 -0
  141. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/perf.html +0 -0
  142. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/test.html +0 -0
  143. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/tests.html +0 -0
  144. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/testsuite.css +0 -0
  145. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/data/web/testsuite.js +0 -0
  146. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/definitions.py +0 -0
  147. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/deployment/modulegenerator.py +0 -0
  148. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/reports/monitorreport.py +0 -0
  149. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/reports/report.py +0 -0
  150. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/sqreport/__init__.py +0 -0
  151. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/partition.py +0 -0
  152. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/qos.py +0 -0
  153. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/reservation.py +0 -0
  154. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/system.py +0 -0
  155. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/systems/systemmanager.py +0 -0
  156. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/benchmarkinstance.py +0 -0
  157. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/benchmarktest.py +0 -0
  158. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/testing/instancemerger.py +0 -0
  159. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/timers/__init__.py +0 -0
  160. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/timers/timer.py +0 -0
  161. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/utils/arguments.py +0 -0
  162. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/utils/lock.py +0 -0
  163. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/utils/log.py +0 -0
  164. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/utils/package.py +0 -0
  165. {squidient-2.2.0 → squidient-2.4.0}/src/squidient/utils/utils.py +0 -0
@@ -51,6 +51,7 @@ dist
51
51
  /email/
52
52
  /icons/
53
53
  /terraform/
54
+ /timers/
54
55
  /version/
55
56
  /web/
56
57
  /sqreport/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: squidient
3
- Version: 2.2.0
3
+ Version: 2.4.0
4
4
  Summary: CI/CD framework for alya
5
5
  Project-URL: Homepage, https://alya.gitlab.bsc.es/alya/ci-cd/squidient
6
6
  Project-URL: Bug Tracker, https://alya.gitlab.bsc.es/alya/ci-cd/squidient/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "squidient"
7
- version = "2.2.0"
7
+ version = "2.4.0"
8
8
  authors = [
9
9
  { name="Damien Dosimont", email="damien.dosimont@gmail.com" },
10
10
  ]
@@ -50,9 +50,7 @@ class BenchmarkBuilder(Builder):
50
50
  db=self._db)
51
51
 
52
52
  def build_report(self):
53
- jump()
54
- print("Building monitor build report")
55
- print_line()
53
+ console.section("Building monitor build report")
56
54
  report = {}
57
55
  for b in self._builds:
58
56
  self._builds[b].build_report()
@@ -27,6 +27,7 @@ import time
27
27
 
28
28
  from ..definitions import *
29
29
  from ..timers import Timer
30
+ from ..utils.message import LiveOutput, console
30
31
 
31
32
  logger = logging.getLogger(logging_context)
32
33
 
@@ -53,6 +54,7 @@ class Builder:
53
54
  self._report_dir = ""
54
55
  self.set_report_dir()
55
56
  self._p = ""
57
+ self._build_status_printed = False
56
58
 
57
59
  def timer(self, name, local=True, system="", platform="", comment=""):
58
60
  return Timer.scope(name, local=local, system=system, platform=platform, comment=comment)
@@ -122,9 +124,7 @@ class Builder:
122
124
  def terminate_builds(self):
123
125
  with self.timer("builds.wait", local=False):
124
126
  finished = False
125
- jump()
126
- print("Waiting for builds to finish:")
127
- print_line()
127
+ console.section("Waiting for builds to finish")
128
128
  while not finished:
129
129
  finished = self.check_builds()
130
130
  return self.get_status()
@@ -145,14 +145,19 @@ class Builder:
145
145
  def get_total(self):
146
146
  return len(self._builds)
147
147
 
148
- def next_valid_build(self, _print=True, oneprint=False, stop_on_error=False):
149
- __print = _print
148
+ def next_valid_build(self, show_progress=True, single_snapshot=None, stop_on_error=False):
149
+ display_status = show_progress
150
150
  while len(self._pending_builds) == 0:
151
- if self.check_builds(__print, __print, False):
151
+ if self.check_builds(
152
+ show_progress=display_status,
153
+ show_elapsed=display_status,
154
+ rewind=False,
155
+ single_snapshot=single_snapshot):
152
156
  if self.get_failed() > 1 and stop_on_error:
153
157
  return None
154
158
  break
155
- __print = __print and not oneprint
159
+ if single_snapshot is True:
160
+ display_status = False
156
161
  build = None
157
162
  for b in self._pending_builds:
158
163
  build = b
@@ -185,9 +190,7 @@ class Builder:
185
190
 
186
191
  def build_report(self):
187
192
  with self.timer("builds.report"):
188
- jump()
189
- print("Building build report")
190
- print_line()
193
+ console.section("Building build report")
191
194
  report = {}
192
195
  for b in self._builds:
193
196
  if b in self._finished_builds:
@@ -209,11 +212,13 @@ class Builder:
209
212
  status = self._builds[build].check_build_status()
210
213
  return status
211
214
 
212
- def check_builds(self, _print=True, minutes=True, back=True):
213
- count = len(self._builds) + 1
214
- if not minutes:
215
- count -= 1
216
- count = str(count)
215
+ def check_builds(self, show_progress=True, show_elapsed=True, rewind=True, single_snapshot=None):
216
+ line_count = len(self._builds) + (1 if show_elapsed else 0)
217
+ live = LiveOutput(
218
+ line_count,
219
+ enabled=show_progress,
220
+ single_snapshot=single_snapshot if single_snapshot is not None else not rewind,
221
+ printed=self._build_status_printed)
217
222
  check = True
218
223
  time.sleep(1)
219
224
  status = {}
@@ -234,7 +239,7 @@ class Builder:
234
239
  status["status"] = "Success"
235
240
  self._finished_builds[b] = True
236
241
  self._pending_builds[b] = True
237
- one_success = not back
242
+ one_success = not rewind
238
243
  else:
239
244
  status["status"] = "Failed"
240
245
  self._finished_builds[b] = False
@@ -242,18 +247,24 @@ class Builder:
242
247
  else:
243
248
  test = False
244
249
  check = check and test
245
- if _print:
246
- print('{:<35}{:>16}'.format("- " + b[:31] + ": ", status["status"]))
247
- if _print and minutes:
248
- print("Elapsed time: ", int((time.time() - self._start_time) / 60), "minutes")
249
- if (not check) and _print and not one_success:
250
- print("\033[" + count + "A", end='')
250
+ if live.should_print():
251
+ console.status(b, status["status"])
252
+ if live.should_print() and show_elapsed:
253
+ console.write("Elapsed time: {} minutes".format(int((time.time() - self._start_time) / 60)))
254
+ live.printed()
255
+ self._build_status_printed = True
256
+ elif live.should_print():
257
+ live.printed()
258
+ self._build_status_printed = True
259
+ if check:
260
+ self._build_status_printed = False
261
+ if (not check) and not one_success:
262
+ live.rewind()
251
263
  time.sleep(1)
252
264
  return check
253
265
 
254
266
  def get_alya(self, fetch=True, force_https=False):
255
267
  with self.timer("builds.get_alya", comment="fetch={}".format(fetch)):
256
- jump()
257
268
  self._alya_repository = Git(git_ssh=self._config["alyaGitRepository"]["ssh"],
258
269
  git_https=self._config["alyaGitRepository"]["https"],
259
270
  user=self._config["alyaGitRepository"]["user"],
@@ -262,18 +273,16 @@ class Builder:
262
273
  password=self._password,
263
274
  force_https=force_https)
264
275
  if fetch:
265
- print("Cloning/Updating the alya git repository...")
276
+ console.section("Cloning or updating the alya git repository")
266
277
  self._alya_repository.clone_or_update_tests()
267
- print_line()
268
278
  self._revision = self._alya_repository.revision_short()
269
279
  self._revision_long = self._alya_repository.revision_long()
270
280
  return self._alya_repository
271
281
 
272
282
  def download_alamak(self, user="", token=""):
273
283
  with self.timer("builds.download_alamak"):
274
- jump()
275
284
  if self._config["alamak"]["enable"]:
276
- print("Cloning alamak")
285
+ console.section("Cloning alamak")
277
286
  self.cd_push(self._config["alamak"]["path"])
278
287
  critical_command("./alamak.sh --clean")
279
288
  if self._config["alamak"]["revision"] is not None:
@@ -288,34 +297,32 @@ class Builder:
288
297
  try:
289
298
  critical_command(alamak_command, silent=True)
290
299
  except:
291
- print("The cloning of alamak has failed. Showing the error and terminating...")
300
+ console.error("The cloning of alamak has failed")
292
301
  command("./alamak.sh --clean")
293
- print(command(alamak_command, silent=True).stdout)
302
+ console.write(command(alamak_command, silent=True).stdout)
294
303
  raise Exception
295
304
  self.cd_pop()
296
- print_line()
297
305
 
298
306
  def get_alya_repository(self):
299
307
  return self._alya_repository
300
308
 
301
309
  def send_alya(self):
302
310
  with self.timer("builds.send_alya", local=False):
303
- jump()
311
+ console.section("Uploading alya")
304
312
  for system in self._systemManager.get_systems():
305
313
  with self.timer("builds.send_alya.system", local=False, system=system):
306
- print("System: " + system)
307
- print("Cleaning the remote build directory...")
314
+ console.step("System " + system)
315
+ console.step("Cleaning the remote build directory")
308
316
  self._ssh.rmdir(system=system, path=remote_bin_dir, server_path=True)
309
317
  if self._config["clean"]:
310
318
  self._ssh.rmdir(system=system, path=remote_build_dir, server_path=True)
311
319
  self._ssh.rmdir(system=system, path=remote_cc_dir, server_path=True)
312
- print("Creating the remote build directory infrastructure...")
320
+ console.step("Creating the remote build directory infrastructure")
313
321
  self._ssh.mkdir(system=system, path=remote_bin_dir, server_path=True)
314
322
  self._ssh.mkdir(system=system, path=remote_build_dir, server_path=True)
315
323
  self._ssh.mkdir(system=system, path=remote_cc_dir, server_path=True)
316
- print("Uploading alya...")
324
+ console.step("Uploading alya source tree")
317
325
  self._ssh.rsync_send(system=system, local=alya_dir, options="--exclude .git/", delete=True, server_path=True, critical=True)
318
- print_line()
319
326
 
320
327
  def create_build(self, build):
321
328
  return ExecutableBuild(systemManager=self._systemManager, hash=self._hash, build_id=build, job=self._job, ssh=self._ssh,
@@ -323,14 +330,13 @@ class Builder:
323
330
 
324
331
  def init_build(self, build):
325
332
  with self.timer("builds.prepare_build", comment=build):
326
- jump()
327
- print("Build: " + build)
333
+ console.section("Preparing build " + build)
328
334
  b = self.create_build(build)
329
- print("\tGenerating alya configuration file...")
335
+ console.step("Generating alya configuration file")
330
336
  b.generate_configuration()
331
- print("\tGenerating job file...")
337
+ console.step("Generating job file")
332
338
  b.generate_job()
333
- print("\tUploading files...")
339
+ console.step("Uploading files")
334
340
  with self.timer("builds.prepare_build.upload", local=False, system=b.get_system(), platform=b.get_platform(), comment=build):
335
341
  b.send_files()
336
342
  return b
@@ -338,12 +344,12 @@ class Builder:
338
344
  def run_build(self, b):
339
345
  with self.timer("builds.submit_job", local=False, system=b.get_system(), platform=b.get_platform(), comment=b.get_build_id()):
340
346
  time.sleep(5)
341
- print("\tSubmitting job...")
347
+ console.step("Submitting job")
342
348
  job_id = b.launch_job()
343
349
  if job_id == -1:
344
- print("\tJob submission has failed!")
350
+ console.error("Job submission has failed")
345
351
  else:
346
- print("\tJob id: " + str(job_id))
352
+ console.success("Job id: " + str(job_id))
347
353
 
348
354
  def get_builds(self):
349
355
  return self._builds
@@ -21,7 +21,7 @@ import sys
21
21
 
22
22
  from .configure import configure_help as chelp
23
23
  from .init import copy_packaged_tree, init_squidient
24
- from .utils.message import jump
24
+ from .utils.message import console
25
25
  from .squidient import help as shelp
26
26
  from .squidientmonitor import help as mhelp
27
27
  from .configure import main as cmain
@@ -30,35 +30,34 @@ from .squidientmonitor import main as mmain
30
30
  from .utils.package import check_latest_package_any_index
31
31
 
32
32
  def help():
33
- print("squidient [option]")
34
- jump()
35
- print("\tsquidient help Print this help")
36
- jump()
37
- print("\tIntialization options:")
38
- print("\tsquidient init [directory] Initialize the directory")
39
- jump()
40
- print("\tConfiguration options:")
41
- print("\tsquidient configure [options] Configure squidient")
33
+ console.write("squidient [option]")
34
+ console.blank()
35
+ console.write("\tsquidient help Print this help")
36
+ console.blank()
37
+ console.write("\tInitialization options:")
38
+ console.write("\tsquidient init [directory] Initialize the directory")
39
+ console.blank()
40
+ console.write("\tConfiguration options:")
41
+ console.write("\tsquidient configure [options] Configure squidient")
42
42
  chelp()
43
- jump()
44
- print("\tBuild and test options:")
45
- print("\tsquidient run [options]")
43
+ console.blank()
44
+ console.write("\tBuild and test options:")
45
+ console.write("\tsquidient run [options]")
46
46
  shelp()
47
- jump()
48
- print("\tsquidient monitor [options]")
47
+ console.blank()
48
+ console.write("\tsquidient monitor [options]")
49
49
  mhelp()
50
50
 
51
51
  def main():
52
52
  info = check_latest_package_any_index("squidient")
53
53
 
54
54
  if not info["up_to_date"]:
55
- print(
56
- f"? squidient {info['installed']} is outdated. "
57
- f"Latest is {info['latest']} on {info['latest_index']}."
55
+ console.warning(
56
+ f"squidient {info['installed']} is older than "
57
+ f"{info['latest']} on {info['latest_index']}."
58
58
  )
59
- print("Please update to the last version running python3 -m pip install --user -U squidient")
60
59
  else:
61
- print(
60
+ console.success(
62
61
  f"squidient {info['installed']} is up to date "
63
62
  f"(checked: {info['checked']})"
64
63
  )
@@ -91,10 +90,10 @@ def main():
91
90
  return 1
92
91
 
93
92
  except Exception as e:
94
- print(e)
95
- print("Exception")
93
+ console.error(str(e))
94
+ console.error("Exception")
96
95
  return 1
97
96
 
98
97
 
99
98
  if __name__ == "__main__":
100
- sys.exit(main())
99
+ sys.exit(main())
@@ -92,13 +92,12 @@ class CodeCoverage(ABC):
92
92
  pass
93
93
 
94
94
  @abstractmethod
95
- def postprocess(self, _print):
95
+ def postprocess(self, show_details):
96
96
  pass
97
97
 
98
98
  def build_report(self):
99
99
  with self.timer("code_coverage.report", comment=self._tool):
100
- print("Building code coverage report")
101
- print_line()
100
+ console.section("Building code coverage report")
102
101
  f = cc_report_dir + "/cc.json"
103
102
  save_json(self._report, f)
104
103
  json2js("cc", f)
@@ -35,7 +35,7 @@ def read_base_xml(filename):
35
35
 
36
36
  def create_package_file(cobertura, package, destination_path):
37
37
  filename = "cobertura-{}.xml".format(package.attrib['name'])
38
- print("\t\tCreating package file {}".format(filename))
38
+ console.step("Creating package file {}".format(filename))
39
39
  xml_to_write = copy.deepcopy(cobertura)
40
40
  packages_node = xml_to_write.find('packages')
41
41
 
@@ -64,17 +64,17 @@ class GcovrCodeCoverage(CodeCoverage):
64
64
 
65
65
  def process(self):
66
66
  with self.platform_timer("code_coverage.process", comment=self._tool):
67
- print("\tGenerating code coverage file...")
67
+ console.step("Generating code coverage file")
68
68
  if not self._ssh.ssh(system=self._system, platform=self._platform,
69
69
  cmd=self.gcovr(),
70
70
  server_path=True, path=remote_cc_dir):
71
71
  return False
72
- print("\tGenerating cobertura report...")
72
+ console.step("Generating cobertura report")
73
73
  if not self._ssh.ssh(system=self._system, platform=self._platform,
74
74
  cmd=self.cobertura(),
75
75
  server_path=True, path=remote_cc_dir):
76
76
  return False
77
- print("\tGenerating detailed html report...")
77
+ console.step("Generating detailed html report")
78
78
  if not self._ssh.ssh(system=self._system, platform=self._platform,
79
79
  cmd=self.html(),
80
80
  server_path=True, path=remote_cc_dir):
@@ -107,11 +107,11 @@ class GcovrCodeCoverage(CodeCoverage):
107
107
  server_path=True, critical=True):
108
108
  raise Exception
109
109
 
110
- def postprocess(self, _print):
110
+ def postprocess(self, show_details):
111
111
  with self.timer("code_coverage.postprocess", comment=self._tool):
112
- print("\tComputing code coverage")
112
+ console.step("Computing code coverage")
113
113
  self.cc_finding()
114
- print("\tSplitting cobertura files...")
114
+ console.step("Splitting cobertura files")
115
115
  self.cobertura_split()
116
116
 
117
117
  def cc_finding(self):
@@ -105,17 +105,13 @@ class IntelCodeCoverage(CodeCoverage):
105
105
 
106
106
  def process(self):
107
107
  with self.platform_timer("code_coverage.process", comment=self._tool):
108
- print("\tMerging code coverage files...")
108
+ console.step("Merging code coverage files")
109
109
  if not self.merge():
110
- jump()
111
- print("\tMerging has failed!")
112
- print_line()
110
+ console.error("Merging has failed")
113
111
  return False
114
- print("\tGenerating code coverage html files...")
112
+ console.step("Generating code coverage html files")
115
113
  if not self.codecov():
116
- jump()
117
- print("\tCode coverage has failed!")
118
- print_line()
114
+ console.error("Code coverage has failed")
119
115
  return False
120
116
  return True
121
117
 
@@ -160,14 +156,14 @@ class IntelCodeCoverage(CodeCoverage):
160
156
  local=cc_report_dir, delete=True, server_path=True, critical=True):
161
157
  raise Exception
162
158
 
163
- def postprocess(self, _print):
159
+ def postprocess(self, show_details):
164
160
  with self.timer("code_coverage.postprocess", comment=self._tool):
165
- print("\tSetting up input file list...")
161
+ console.step("Setting up input file list")
166
162
  self.set_html_files()
167
- print("\tBuilding code coverage summary...")
163
+ console.step("Building code coverage summary")
168
164
  self.summary()
169
- self.details(True, _print=_print)
170
- self.details(False, _print=_print)
165
+ self.details(True, show_details=show_details)
166
+ self.details(False, show_details=show_details)
171
167
 
172
168
  def set_html_files(self):
173
169
  files = []
@@ -196,13 +192,13 @@ class IntelCodeCoverage(CodeCoverage):
196
192
  d.append(c)
197
193
  self._report["summary"] = d
198
194
 
199
- def details(self, covered, _print=True):
195
+ def details(self, covered, show_details=True):
200
196
  with self.timer("code_coverage.intel.details", comment="covered={}".format(covered)):
201
197
  if covered:
202
- print("Building code coverage details (covered files)...")
198
+ console.step("Building code coverage details for covered files")
203
199
  input = self._covered
204
200
  else:
205
- print("Building code coverage details (uncovered files)...")
201
+ console.step("Building code coverage details for uncovered files")
206
202
  input = self._uncovered
207
203
 
208
204
  rows = _source_rows(input)
@@ -213,8 +209,8 @@ class IntelCodeCoverage(CodeCoverage):
213
209
  if rows[i]["file"] == "":
214
210
  continue
215
211
  f["name"] = rows[i]["file"]
216
- if _print:
217
- print("File: " + f["name"])
212
+ if show_details:
213
+ console.step("File " + f["name"])
218
214
  path = rows[i]["path"].split("alya/", 1)[1]
219
215
  f["path"] = path
220
216
  realPath = self.alya_realpath(path)
@@ -110,7 +110,7 @@ class JobThread (threading.Thread):
110
110
  #job_number = int(self._ssh.ssh("squeue | wc -l", system=self._system, platform=self._platform).stdout.strip()) - 1
111
111
  job_number = max(len(self._ssh.ssh("squeue", system=self._system, platform=self._platform).stdout.split("\n")) - 2, 0)
112
112
  except:
113
- print("Cannot determine running jobs")
113
+ console.warning("Cannot determine running jobs")
114
114
  logger.warning("Cannot determine job number")
115
115
  logger.debug("Job number of " + self._platform + " retrieved with squeue: " + str(job_number))
116
116
  return job_number
@@ -152,7 +152,7 @@ class Job:
152
152
  dep = ""
153
153
  if key_lock != "":
154
154
  if asynchronous:
155
- print("You cannot launch an asynchronous job with a dependency!")
155
+ console.error("You cannot launch an asynchronous job with a dependency")
156
156
  raise Exception
157
157
  lock_id = self._build_lock.get_lock(key_lock)
158
158
  if lock_id != -1:
@@ -162,7 +162,7 @@ class Job:
162
162
  self._output_queues[system][platform] = queue.Queue()
163
163
  self._job_threads[system][platform] = []
164
164
  if self._thread_number[system][platform] < 1:
165
- print("Thread number must be greater than 0!")
165
+ console.error("Thread number must be greater than 0")
166
166
  raise Exception
167
167
  for i in range(self._thread_number[system][platform]):
168
168
  self._job_threads[system][platform].append(JobThread(self._ssh, system, platform,
@@ -287,12 +287,11 @@ class Job:
287
287
  return job_id
288
288
 
289
289
  def kill_all(self):
290
- jump()
291
290
  for system in self._job_threads:
292
291
  for platform in self._job_threads[system]:
293
292
  self._ssh.ssh(cmd="scancel --name=" + jtitle + self._hash, system=system, platform=platform)
294
293
  self._jobs.clear()
295
- print()
294
+ console.blank()
296
295
 
297
296
  def job_list(self, force=False):
298
297
  timet = time.time()
@@ -24,6 +24,7 @@ import os.path
24
24
  import shutil
25
25
 
26
26
  from .utils.utils import *
27
+ from .utils.message import console
27
28
  import getpass
28
29
 
29
30
  logger = logging.getLogger(logging_context)
@@ -255,7 +256,7 @@ class Git:
255
256
  if not self.clone_https():
256
257
  logger.info("HTTPS clone failed")
257
258
  raise RuntimeError("Git repository cannot be cloned")
258
- print("Switching git directory to branch " + self._branch + "...")
259
+ console.step("Switching git directory to branch " + self._branch)
259
260
  if not self.branch():
260
261
  raise RuntimeError("Cannot switch to " + self._branch + " and rebase it!")
261
262
 
@@ -5,6 +5,7 @@ import shutil
5
5
  from pathlib import Path
6
6
  from typing import Union
7
7
  import squidient
8
+ from .utils.message import console
8
9
 
9
10
  try:
10
11
  from importlib.resources import files as ir_files
@@ -83,4 +84,4 @@ def init_squidient(dist_dir: str=".") -> None:
83
84
 
84
85
  if __name__ == "__main__":
85
86
  init_squidient()
86
- print("OK: copied squidient/data/* into current directory")
87
+ console.success("Copied squidient/data/* into current directory")