teuthology 1.1.0__py3-none-any.whl → 1.2.1__py3-none-any.whl

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 (170) hide show
  1. scripts/describe.py +1 -0
  2. scripts/dispatcher.py +55 -26
  3. scripts/exporter.py +18 -0
  4. scripts/lock.py +1 -1
  5. scripts/node_cleanup.py +58 -0
  6. scripts/openstack.py +9 -9
  7. scripts/results.py +12 -11
  8. scripts/schedule.py +4 -0
  9. scripts/suite.py +57 -16
  10. scripts/supervisor.py +44 -0
  11. scripts/update_inventory.py +10 -4
  12. teuthology/__init__.py +24 -26
  13. teuthology/beanstalk.py +4 -3
  14. teuthology/config.py +16 -6
  15. teuthology/contextutil.py +18 -14
  16. teuthology/describe_tests.py +25 -18
  17. teuthology/dispatcher/__init__.py +210 -35
  18. teuthology/dispatcher/supervisor.py +140 -58
  19. teuthology/exceptions.py +43 -0
  20. teuthology/exporter.py +347 -0
  21. teuthology/kill.py +76 -81
  22. teuthology/lock/cli.py +3 -3
  23. teuthology/lock/ops.py +135 -61
  24. teuthology/lock/query.py +61 -44
  25. teuthology/ls.py +1 -1
  26. teuthology/misc.py +61 -75
  27. teuthology/nuke/__init__.py +12 -353
  28. teuthology/openstack/__init__.py +4 -3
  29. teuthology/openstack/openstack-centos-7.0-user-data.txt +1 -1
  30. teuthology/openstack/openstack-centos-7.1-user-data.txt +1 -1
  31. teuthology/openstack/openstack-centos-7.2-user-data.txt +1 -1
  32. teuthology/openstack/openstack-debian-8.0-user-data.txt +1 -1
  33. teuthology/openstack/openstack-opensuse-42.1-user-data.txt +1 -1
  34. teuthology/openstack/openstack-teuthology.cron +0 -1
  35. teuthology/orchestra/cluster.py +49 -7
  36. teuthology/orchestra/connection.py +17 -4
  37. teuthology/orchestra/console.py +111 -50
  38. teuthology/orchestra/daemon/cephadmunit.py +15 -2
  39. teuthology/orchestra/daemon/state.py +8 -1
  40. teuthology/orchestra/daemon/systemd.py +4 -4
  41. teuthology/orchestra/opsys.py +30 -11
  42. teuthology/orchestra/remote.py +405 -338
  43. teuthology/orchestra/run.py +3 -3
  44. teuthology/packaging.py +19 -16
  45. teuthology/provision/__init__.py +30 -10
  46. teuthology/provision/cloud/openstack.py +12 -6
  47. teuthology/provision/cloud/util.py +1 -2
  48. teuthology/provision/downburst.py +4 -3
  49. teuthology/provision/fog.py +68 -20
  50. teuthology/provision/openstack.py +5 -4
  51. teuthology/provision/pelagos.py +1 -1
  52. teuthology/repo_utils.py +43 -13
  53. teuthology/report.py +57 -35
  54. teuthology/results.py +5 -3
  55. teuthology/run.py +13 -14
  56. teuthology/run_tasks.py +27 -43
  57. teuthology/schedule.py +4 -3
  58. teuthology/scrape.py +28 -22
  59. teuthology/suite/__init__.py +74 -45
  60. teuthology/suite/build_matrix.py +34 -24
  61. teuthology/suite/fragment-merge.lua +105 -0
  62. teuthology/suite/matrix.py +31 -2
  63. teuthology/suite/merge.py +175 -0
  64. teuthology/suite/placeholder.py +6 -9
  65. teuthology/suite/run.py +175 -100
  66. teuthology/suite/util.py +64 -218
  67. teuthology/task/__init__.py +1 -1
  68. teuthology/task/ansible.py +101 -32
  69. teuthology/task/buildpackages.py +2 -2
  70. teuthology/task/ceph_ansible.py +13 -6
  71. teuthology/task/cephmetrics.py +2 -1
  72. teuthology/task/clock.py +33 -14
  73. teuthology/task/exec.py +18 -0
  74. teuthology/task/hadoop.py +2 -2
  75. teuthology/task/install/__init__.py +29 -7
  76. teuthology/task/install/bin/adjust-ulimits +16 -0
  77. teuthology/task/install/bin/daemon-helper +114 -0
  78. teuthology/task/install/bin/stdin-killer +263 -0
  79. teuthology/task/install/deb.py +1 -1
  80. teuthology/task/install/rpm.py +17 -5
  81. teuthology/task/install/util.py +3 -3
  82. teuthology/task/internal/__init__.py +41 -10
  83. teuthology/task/internal/edit_sudoers.sh +10 -0
  84. teuthology/task/internal/lock_machines.py +2 -9
  85. teuthology/task/internal/redhat.py +31 -1
  86. teuthology/task/internal/syslog.py +31 -8
  87. teuthology/task/kernel.py +152 -145
  88. teuthology/task/lockfile.py +1 -1
  89. teuthology/task/mpi.py +10 -10
  90. teuthology/task/pcp.py +1 -1
  91. teuthology/task/selinux.py +16 -8
  92. teuthology/task/ssh_keys.py +4 -4
  93. teuthology/timer.py +3 -3
  94. teuthology/util/loggerfile.py +19 -0
  95. teuthology/util/scanner.py +159 -0
  96. teuthology/util/sentry.py +52 -0
  97. teuthology/util/time.py +52 -0
  98. teuthology-1.2.1.data/scripts/adjust-ulimits +16 -0
  99. teuthology-1.2.1.data/scripts/daemon-helper +114 -0
  100. teuthology-1.2.1.data/scripts/stdin-killer +263 -0
  101. teuthology-1.2.1.dist-info/METADATA +88 -0
  102. teuthology-1.2.1.dist-info/RECORD +168 -0
  103. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/WHEEL +1 -1
  104. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/entry_points.txt +3 -2
  105. scripts/nuke.py +0 -47
  106. scripts/worker.py +0 -37
  107. teuthology/lock/test/__init__.py +0 -0
  108. teuthology/lock/test/test_lock.py +0 -7
  109. teuthology/nuke/actions.py +0 -456
  110. teuthology/openstack/test/__init__.py +0 -0
  111. teuthology/openstack/test/openstack-integration.py +0 -286
  112. teuthology/openstack/test/test_config.py +0 -35
  113. teuthology/openstack/test/test_openstack.py +0 -1695
  114. teuthology/orchestra/test/__init__.py +0 -0
  115. teuthology/orchestra/test/integration/__init__.py +0 -0
  116. teuthology/orchestra/test/integration/test_integration.py +0 -94
  117. teuthology/orchestra/test/test_cluster.py +0 -240
  118. teuthology/orchestra/test/test_connection.py +0 -106
  119. teuthology/orchestra/test/test_console.py +0 -217
  120. teuthology/orchestra/test/test_opsys.py +0 -404
  121. teuthology/orchestra/test/test_remote.py +0 -185
  122. teuthology/orchestra/test/test_run.py +0 -286
  123. teuthology/orchestra/test/test_systemd.py +0 -54
  124. teuthology/orchestra/test/util.py +0 -12
  125. teuthology/task/tests/__init__.py +0 -110
  126. teuthology/task/tests/test_locking.py +0 -25
  127. teuthology/task/tests/test_run.py +0 -40
  128. teuthology/test/__init__.py +0 -0
  129. teuthology/test/fake_archive.py +0 -107
  130. teuthology/test/fake_fs.py +0 -92
  131. teuthology/test/integration/__init__.py +0 -0
  132. teuthology/test/integration/test_suite.py +0 -86
  133. teuthology/test/task/__init__.py +0 -205
  134. teuthology/test/task/test_ansible.py +0 -624
  135. teuthology/test/task/test_ceph_ansible.py +0 -176
  136. teuthology/test/task/test_console_log.py +0 -88
  137. teuthology/test/task/test_install.py +0 -337
  138. teuthology/test/task/test_internal.py +0 -57
  139. teuthology/test/task/test_kernel.py +0 -243
  140. teuthology/test/task/test_pcp.py +0 -379
  141. teuthology/test/task/test_selinux.py +0 -35
  142. teuthology/test/test_config.py +0 -189
  143. teuthology/test/test_contextutil.py +0 -68
  144. teuthology/test/test_describe_tests.py +0 -316
  145. teuthology/test/test_email_sleep_before_teardown.py +0 -81
  146. teuthology/test/test_exit.py +0 -97
  147. teuthology/test/test_get_distro.py +0 -47
  148. teuthology/test/test_get_distro_version.py +0 -47
  149. teuthology/test/test_get_multi_machine_types.py +0 -27
  150. teuthology/test/test_job_status.py +0 -60
  151. teuthology/test/test_ls.py +0 -48
  152. teuthology/test/test_misc.py +0 -391
  153. teuthology/test/test_nuke.py +0 -290
  154. teuthology/test/test_packaging.py +0 -763
  155. teuthology/test/test_parallel.py +0 -28
  156. teuthology/test/test_repo_utils.py +0 -225
  157. teuthology/test/test_report.py +0 -77
  158. teuthology/test/test_results.py +0 -155
  159. teuthology/test/test_run.py +0 -239
  160. teuthology/test/test_safepath.py +0 -55
  161. teuthology/test/test_schedule.py +0 -45
  162. teuthology/test/test_scrape.py +0 -167
  163. teuthology/test/test_timer.py +0 -80
  164. teuthology/test/test_vps_os_vers_parameter_checking.py +0 -84
  165. teuthology/test/test_worker.py +0 -303
  166. teuthology/worker.py +0 -354
  167. teuthology-1.1.0.dist-info/METADATA +0 -76
  168. teuthology-1.1.0.dist-info/RECORD +0 -213
  169. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/LICENSE +0 -0
  170. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/top_level.txt +0 -0
scripts/describe.py CHANGED
@@ -70,6 +70,7 @@ options only for describing combinations represented by a suite:
70
70
  operator, where negative value used for
71
71
  a random seed
72
72
  [default: -1]
73
+ --no-nested-subset Disable nested subsets
73
74
  """
74
75
 
75
76
 
scripts/dispatcher.py CHANGED
@@ -1,33 +1,62 @@
1
- """
2
- usage: teuthology-dispatcher --help
3
- teuthology-dispatcher --supervisor [-v] --bin-path BIN_PATH --job-config COFNFIG --archive-dir DIR
4
- teuthology-dispatcher [-v] [--archive-dir DIR] --log-dir LOG_DIR --tube TUBE
1
+ import argparse
2
+ import sys
5
3
 
6
- Start a dispatcher for the specified tube. Grab jobs from a beanstalk
7
- queue and run the teuthology tests they describe as subprocesses. The
8
- subprocess invoked is a teuthology-dispatcher command run in supervisor
9
- mode.
4
+ import teuthology.dispatcher.supervisor
10
5
 
11
- Supervisor mode: Supervise the job run described by its config. Reimage
12
- target machines and invoke teuthology command. Unlock the target machines
13
- at the end of the run.
6
+ from .supervisor import parse_args as parse_supervisor_args
14
7
 
15
- standard arguments:
16
- -h, --help show this help message and exit
17
- -v, --verbose be more verbose
18
- -t, --tube TUBE which beanstalk tube to read jobs from
19
- -l, --log-dir LOG_DIR path in which to store logs
20
- -a DIR, --archive-dir DIR path to archive results in
21
- --supervisor run dispatcher in job supervisor mode
22
- --bin-path BIN_PATH teuthology bin path
23
- --job-config CONFIG file descriptor of job's config file
24
- """
25
8
 
26
- import docopt
27
-
28
- import teuthology.dispatcher
9
+ def parse_args(argv):
10
+ parser = argparse.ArgumentParser(
11
+ description="Start a dispatcher for the specified tube. Grab jobs from a beanstalk queue and run the teuthology tests they describe as subprocesses. The subprocess invoked is teuthology-supervisor."
12
+ )
13
+ parser.add_argument(
14
+ "-v",
15
+ "--verbose",
16
+ action="store_true",
17
+ help="be more verbose",
18
+ )
19
+ parser.add_argument(
20
+ "-a",
21
+ "--archive-dir",
22
+ type=str,
23
+ help="path to archive results in",
24
+ )
25
+ parser.add_argument(
26
+ "-t",
27
+ "--tube",
28
+ type=str,
29
+ help="which beanstalk tube to read jobs from",
30
+ required=True,
31
+ )
32
+ parser.add_argument(
33
+ "-l",
34
+ "--log-dir",
35
+ type=str,
36
+ help="path in which to store the dispatcher log",
37
+ required=True,
38
+ )
39
+ parser.add_argument(
40
+ "--exit-on-empty-queue",
41
+ action="store_true",
42
+ help="if the queue is empty, exit",
43
+ )
44
+ return parser.parse_args(argv)
29
45
 
30
46
 
31
47
  def main():
32
- args = docopt.docopt(__doc__)
33
- teuthology.dispatcher.main(args)
48
+ if "--supervisor" in sys.argv:
49
+ # This is for transitional compatibility, so the old dispatcher can
50
+ # invoke the new supervisor. Once old dispatchers are phased out,
51
+ # this block can be as well.
52
+ sys.argv.remove("--supervisor")
53
+ sys.argv[0] = "teuthology-supervisor"
54
+ sys.exit(teuthology.dispatcher.supervisor.main(
55
+ parse_supervisor_args(sys.argv[1:])
56
+ ))
57
+ else:
58
+ sys.exit(teuthology.dispatcher.main(parse_args(sys.argv[1:])))
59
+
60
+
61
+ if __name__ == "__main__":
62
+ main()
scripts/exporter.py ADDED
@@ -0,0 +1,18 @@
1
+ import docopt
2
+
3
+ import teuthology.exporter
4
+
5
+ doc = """
6
+ usage: teuthology-exporter --help
7
+ teuthology-exporter [--interval INTERVAL]
8
+
9
+ optional arguments:
10
+ -h, --help show this help message and exit
11
+ --interval INTERVAL update metrics this often, in seconds
12
+ [default: 60]
13
+ """
14
+
15
+
16
+ def main():
17
+ args = docopt.docopt(doc)
18
+ teuthology.exporter.main(args)
scripts/lock.py CHANGED
@@ -27,8 +27,8 @@ def parse_args(argv):
27
27
  teuthology-lock --lock-many 1 --machine-type vps
28
28
  teuthology-lock --lock -t target.yaml
29
29
  teuthology-lock --list-targets plana01
30
- teuthology-lock --list --brief --owner user@host
31
30
  teuthology-lock --brief
31
+ teuthology-lock --brief --owner user@host
32
32
  teuthology-lock --update --status down --desc testing plana01
33
33
  '''),
34
34
  formatter_class=argparse.RawTextHelpFormatter)
@@ -0,0 +1,58 @@
1
+ import argparse
2
+ import logging
3
+ import sys
4
+
5
+ import teuthology
6
+ from teuthology.lock import query, ops
7
+
8
+ def main():
9
+ args = parse_args(sys.argv[1:])
10
+ if args.verbose:
11
+ teuthology.log.setLevel(logging.DEBUG)
12
+ log = logging.getLogger(__name__)
13
+ stale = query.find_stale_locks(args.owner)
14
+ if not stale:
15
+ return
16
+ by_owner = {}
17
+ for node in stale:
18
+ if args.owner and node['locked_by'] != args.owner:
19
+ log.warning(
20
+ f"Node {node['name']} expected to be locked by {args.owner} "
21
+ f"but found {node['locked_by']} instead"
22
+ )
23
+ continue
24
+ by_owner.setdefault(node['locked_by'], []).append(node)
25
+ if args.dry_run:
26
+ log.info("Would attempt to unlock:")
27
+ for owner, nodes in by_owner.items():
28
+ for node in nodes:
29
+ log.info(f"{node['name']}\t{node['description']}")
30
+ else:
31
+ for owner, nodes in by_owner.items():
32
+ ops.unlock_safe([node["name"] for node in nodes], owner)
33
+
34
+ def parse_args(argv):
35
+ parser = argparse.ArgumentParser(
36
+ description="Find and unlock nodes that are still locked by jobs that are no "
37
+ "longer active",
38
+ )
39
+ parser.add_argument(
40
+ '-v', '--verbose',
41
+ action='store_true',
42
+ default=False,
43
+ help='Be more verbose',
44
+ )
45
+ parser.add_argument(
46
+ '--dry-run',
47
+ action='store_true',
48
+ default=False,
49
+ help="List nodes that would be unlocked if the flag were omitted",
50
+ )
51
+ parser.add_argument(
52
+ '--owner',
53
+ help='Optionally, find nodes locked by a specific user',
54
+ )
55
+ return parser.parse_args(argv)
56
+
57
+ if __name__ == "__main__":
58
+ main()
scripts/openstack.py CHANGED
@@ -49,7 +49,7 @@ def get_suite_parser():
49
49
  parser.add_argument(
50
50
  '-c', '--ceph',
51
51
  help='The ceph branch to run against',
52
- default=os.getenv('TEUTH_CEPH_BRANCH', 'master'),
52
+ default=os.getenv('TEUTH_CEPH_BRANCH', 'main'),
53
53
  )
54
54
  parser.add_argument(
55
55
  '-k', '--kernel',
@@ -58,9 +58,9 @@ def get_suite_parser():
58
58
  )
59
59
  parser.add_argument(
60
60
  '-f', '--flavor',
61
- help=("The kernel flavor to run against: ('basic',"
62
- "'gcov', 'notcmalloc')"),
63
- default='basic',
61
+ help=("The ceph packages shaman flavor to run with:"
62
+ "('default', 'crimson', 'notcmalloc', 'jaeger')"),
63
+ default='default',
64
64
  )
65
65
  parser.add_argument(
66
66
  '-d', '--distro',
@@ -69,7 +69,7 @@ def get_suite_parser():
69
69
  parser.add_argument(
70
70
  '--suite-branch',
71
71
  help='Use this suite branch instead of the ceph branch',
72
- default=os.getenv('TEUTH_SUITE_BRANCH', 'master'),
72
+ default=os.getenv('TEUTH_SUITE_BRANCH', 'main'),
73
73
  )
74
74
  parser.add_argument(
75
75
  '-e', '--email',
@@ -251,8 +251,8 @@ def get_openstack_parser():
251
251
  )
252
252
  parser.add_argument(
253
253
  '--teuthology-branch',
254
- help="use this teuthology branch instead of master",
255
- default=os.getenv('TEUTH_BRANCH', 'master'),
254
+ help="use this teuthology branch instead of main",
255
+ default=os.getenv('TEUTH_BRANCH', 'main'),
256
256
  )
257
257
  parser.add_argument(
258
258
  '--ceph-workbench-git-url',
@@ -260,8 +260,8 @@ def get_openstack_parser():
260
260
  )
261
261
  parser.add_argument(
262
262
  '--ceph-workbench-branch',
263
- help="use this ceph-workbench branch instead of master",
264
- default='master',
263
+ help="use this ceph-workbench branch instead of main",
264
+ default='main',
265
265
  )
266
266
  parser.add_argument(
267
267
  '--upload',
scripts/results.py CHANGED
@@ -1,19 +1,20 @@
1
1
  """
2
- usage: teuthology-results [-h] [-v] [--dry-run] [--email EMAIL] [--timeout TIMEOUT] --archive-dir DIR --name NAME [--subset SUBSET] [--seed SEED]
2
+ usage: teuthology-results [-h] [-v] [--dry-run] [--email EMAIL] [--timeout TIMEOUT] --archive-dir DIR --name NAME [--subset SUBSET] [--seed SEED] [--no-nested-subset]
3
3
 
4
4
  Email teuthology suite results
5
5
 
6
6
  optional arguments:
7
- -h, --help show this help message and exit
8
- -v, --verbose be more verbose
9
- --dry-run Instead of sending the email, just print it
10
- --email EMAIL address to email test failures to
11
- --timeout TIMEOUT how many seconds to wait for all tests to finish
12
- [default: 0]
13
- --archive-dir DIR path under which results for the suite are stored
14
- --name NAME name of the suite
15
- --subset SUBSET subset passed to teuthology-suite
16
- --seed SEED random seed used in teuthology-suite
7
+ -h, --help show this help message and exit
8
+ -v, --verbose be more verbose
9
+ --dry-run Instead of sending the email, just print it
10
+ --email EMAIL address to email test failures to
11
+ --timeout TIMEOUT how many seconds to wait for all tests to finish
12
+ [default: 0]
13
+ --archive-dir DIR path under which results for the suite are stored
14
+ --name NAME name of the suite
15
+ --subset SUBSET subset passed to teuthology-suite
16
+ --seed SEED random seed used in teuthology-suite
17
+ --no-nested-subset disable nested subsets used in teuthology-suite
17
18
  """
18
19
  import docopt
19
20
  import teuthology.results
scripts/schedule.py CHANGED
@@ -12,6 +12,7 @@ Schedule ceph integration tests
12
12
 
13
13
  positional arguments:
14
14
  <conf_file> Config file to read
15
+ "-" indicates read stdin.
15
16
 
16
17
  optional arguments:
17
18
  -h, --help Show this help message and exit
@@ -46,6 +47,9 @@ optional arguments:
46
47
  Only applies to the last job in a suite.
47
48
  --subset <subset> The subset option passed to teuthology-suite.
48
49
  Only applies to the last job in a suite.
50
+ --no-nested-subset The no-nested-subset option passed to
51
+ teuthology-suite.
52
+ Only applies to the last job in a suite.
49
53
  --dry-run Instead of scheduling, just output the
50
54
  job config.
51
55
 
scripts/suite.py CHANGED
@@ -7,8 +7,8 @@ from teuthology.config import config
7
7
 
8
8
  doc = """
9
9
  usage: teuthology-suite --help
10
- teuthology-suite [-v | -vv ] --machine-type <type> --suite <suite> [options] [<config_yaml>...]
11
- teuthology-suite [-v | -vv ] --machine-type <type> --rerun <name> [options] [<config_yaml>...]
10
+ teuthology-suite [-v | -vv ] --suite <suite> [options] [<config_yaml>...]
11
+ teuthology-suite [-v | -vv ] --rerun <name> [options] [<config_yaml>...]
12
12
 
13
13
  Run a suite of ceph integration tests. A suite is a directory containing
14
14
  facets. A facet is a directory containing config snippets. Running a suite
@@ -49,9 +49,9 @@ Standard arguments:
49
49
  use 'none' to bypass kernel task.
50
50
  [default: distro]
51
51
  -f <flavor>, --flavor <flavor>
52
- The kernel flavor to run against: ('basic',
53
- 'gcov', 'notcmalloc')
54
- [default: basic]
52
+ The ceph packages shaman flavor to run with:
53
+ ('default', 'crimson', 'notcmalloc', 'jaeger')
54
+ [default: default]
55
55
  -t <branch>, --teuthology-branch <branch>
56
56
  The teuthology branch to run against.
57
57
  Default value is determined in the next order.
@@ -60,7 +60,7 @@ Standard arguments:
60
60
  the suite repo and contains non-empty string.
61
61
  There is `teuthology_branch` present in one of
62
62
  the user or system `teuthology.yaml` configuration
63
- files respectively, otherwise use `master`.
63
+ files respectively, otherwise use `main`.
64
64
  -m <type>, --machine-type <type>
65
65
  Machine type [default: {default_machine_type}]
66
66
  -d <distro>, --distro <distro>
@@ -86,6 +86,9 @@ Standard arguments:
86
86
  --validate-sha1 <bool>
87
87
  Validate that git SHA1s passed to -S exist.
88
88
  [default: true]
89
+ --kdb <bool>
90
+ Enable/disable kdb in kernel
91
+ [default: true]
89
92
  --sleep-before-teardown <seconds>
90
93
  Number of seconds to sleep before teardown.
91
94
  Use with care, as this applies to all jobs in the
@@ -109,6 +112,10 @@ Scheduler arguments:
109
112
  When tests finish or time out, send an email
110
113
  here. May also be specified in ~/.teuthology.yaml
111
114
  as 'results_email'
115
+ --expire <datetime> Do not execute jobs in the run if they have not
116
+ completed by this time. Valid formats include
117
+ ISO 8601, and relative offsets like '90s', '30m',
118
+ '1h', '3d', or '1w'
112
119
  --rocketchat <rocketchat> Comma separated list of Rocket.Chat channels where
113
120
  to send a message when tests finished or time out.
114
121
  To be used with --sleep-before-teardown option.
@@ -121,7 +128,8 @@ Scheduler arguments:
121
128
  contain each facet at least once) and schedule
122
129
  piece <index>. Scheduling 0/<outof>, 1/<outof>,
123
130
  2/<outof> ... <outof>-1/<outof> will schedule all
124
- jobs in the suite (many more than once).
131
+ jobs in the suite (many more than once). If specified,
132
+ this value can be found in results.log.
125
133
  -p <priority>, --priority <priority>
126
134
  Job priority (lower is sooner)
127
135
  [default: 1000]
@@ -157,21 +165,53 @@ Scheduler arguments:
157
165
  using the same logic as --filter.
158
166
  Of all the flags that were passed when scheduling
159
167
  the original run, the resulting one will only
160
- inherit the suite value. Any others must be
161
- passed as normal while scheduling with this
162
- feature. For random tests involving facet whose
163
- path ends with '$' operator, you might want to
164
- use --seed argument to repeat them.
168
+ inherit the --suite value. Any other arguments
169
+ must be passed again while scheduling. By default,
170
+ 'seed' and 'subset' will be taken from results.log,
171
+ but can be overide if passed again.
172
+ This is important for tests involving random facet
173
+ (path ends with '$' operator).
165
174
  -R, --rerun-statuses <statuses>
166
175
  A comma-separated list of statuses to be used
167
176
  with --rerun. Supported statuses are: 'dead',
168
177
  'fail', 'pass', 'queued', 'running', 'waiting'
169
178
  [default: fail,dead]
170
179
  --seed SEED An random number mostly useful when used along
171
- with --rerun argument. This number can be found
172
- in the output of teuthology-suite command. -1
173
- for a random seed [default: -1].
180
+ with --rerun argument to rerun the exact
181
+ same jobs that can only be picked at random.
182
+ This number can be found in the output of
183
+ teuthology-suite command or in results.log.
184
+ Pass -1 for a random seed [default: -1].
174
185
  --force-priority Skip the priority check.
186
+ --job-threshold <threshold> Do not allow to schedule the run if the number
187
+ of jobs exceeds <threshold>. Use 0 to allow
188
+ any number [default: {default_job_threshold}].
189
+ --no-nested-subset Do not perform nested suite subsets [default: false].
190
+
191
+ +=================+=================================================================+
192
+ | Priority | Explanation |
193
+ +=================+=================================================================+
194
+ | N < 10 | Use this if the sky is falling and some group of tests |
195
+ | | must be run ASAP. |
196
+ +-----------------+-----------------------------------------------------------------+
197
+ | 10 <= N < 50 | Use this if your tests are urgent and blocking other |
198
+ | | important development. |
199
+ +-----------------+-----------------------------------------------------------------+
200
+ | 50 <= N < 75 | Use this if you are testing a particular feature/fix |
201
+ | | and running fewer than about 25 jobs. This range is also |
202
+ | | used for urgent release testing. |
203
+ +-----------------+-----------------------------------------------------------------+
204
+ | 75 <= N < 100 | Tech Leads regularly schedule integration tests with this |
205
+ | | priority to verify pull requests against main. |
206
+ +-----------------+-----------------------------------------------------------------+
207
+ | 100 <= N < 150 | This priority is used for QE validation of point releases. |
208
+ +-----------------+-----------------------------------------------------------------+
209
+ | 150 <= N < 200 | Use this priority for 100 jobs or fewer that test a particular |
210
+ | | feature or fix. Results are available in about 24 hours. |
211
+ +-----------------+-----------------------------------------------------------------+
212
+ | 200 <= N < 1000 | Use this priority for large test runs. Results are available |
213
+ | | in about a week. |
214
+ +-----------------+-----------------------------------------------------------------+
175
215
 
176
216
  """.format(
177
217
  default_machine_type=config.default_machine_type,
@@ -180,7 +220,8 @@ Scheduler arguments:
180
220
  config.get_ceph_git_url()),
181
221
  default_suite_repo=defaults('--suite-repo',
182
222
  config.get_ceph_qa_suite_git_url()),
183
- default_ceph_branch=defaults('--ceph-branch', 'master'),
223
+ default_ceph_branch=defaults('--ceph-branch', 'main'),
224
+ default_job_threshold=config.job_threshold,
184
225
  )
185
226
 
186
227
 
scripts/supervisor.py ADDED
@@ -0,0 +1,44 @@
1
+ import argparse
2
+ import sys
3
+
4
+ import teuthology.dispatcher.supervisor
5
+
6
+
7
+ def parse_args(argv):
8
+ parser = argparse.ArgumentParser(
9
+ description="Supervise and run a teuthology job; normally only run by the dispatcher",
10
+ )
11
+ parser.add_argument(
12
+ "-v",
13
+ "--verbose",
14
+ action="store_true",
15
+ help="be more verbose",
16
+ )
17
+ parser.add_argument(
18
+ "-a",
19
+ "--archive-dir",
20
+ type=str,
21
+ help="path in which to store the job's logfiles",
22
+ required=True,
23
+ )
24
+ parser.add_argument(
25
+ "--bin-path",
26
+ type=str,
27
+ help="teuthology bin path",
28
+ required=True,
29
+ )
30
+ parser.add_argument(
31
+ "--job-config",
32
+ type=str,
33
+ help="file descriptor of job's config file",
34
+ required=True,
35
+ )
36
+ return parser.parse_args(argv)
37
+
38
+
39
+ def main():
40
+ sys.exit(teuthology.dispatcher.supervisor.main(parse_args(sys.argv[1:])))
41
+
42
+
43
+ if __name__ == "__main__":
44
+ main()
@@ -10,14 +10,16 @@ import logging
10
10
 
11
11
  doc = """
12
12
  usage: teuthology-update-inventory -h
13
- teuthology-update-inventory [-v] REMOTE [REMOTE ...]
13
+ teuthology-update-inventory [-v] [-m type] REMOTE [REMOTE ...]
14
14
 
15
15
  Update the given nodes' inventory information on the lock server
16
16
 
17
17
 
18
- -h, --help show this help message and exit
19
- -v, --verbose be more verbose
20
- REMOTE hostnames of machines whose information to update
18
+ -h, --help show this help message and exit
19
+ -v, --verbose be more verbose
20
+ -m <type>, --machine-type <type> optionally specify a machine type when
21
+ submitting nodes for the first time
22
+ REMOTE hostnames of machines whose information to update
21
23
 
22
24
  """
23
25
 
@@ -27,9 +29,13 @@ def main():
27
29
  if args['--verbose']:
28
30
  teuthology.log.setLevel(logging.DEBUG)
29
31
 
32
+ machine_type = args.get('--machine-type')
30
33
  remotes = args.get('REMOTE')
31
34
  for rem_name in remotes:
32
35
  rem_name = teuthology.misc.canonicalize_hostname(rem_name)
33
36
  remote = teuthology.orchestra.remote.Remote(rem_name)
37
+ remote.connect()
34
38
  inventory_info = remote.inventory_info
39
+ if machine_type:
40
+ inventory_info['machine_type'] = machine_type
35
41
  teuthology.lock.ops.update_inventory(inventory_info)
teuthology/__init__.py CHANGED
@@ -1,5 +1,11 @@
1
1
  from __future__ import print_function
2
- import os
2
+ import os, sys
3
+ try:
4
+ import importlib.metadata as importlib_metadata
5
+ except ImportError:
6
+ import importlib_metadata
7
+
8
+ __version__ = importlib_metadata.version("teuthology")
3
9
 
4
10
  # Tell gevent not to patch os.waitpid() since it is susceptible to race
5
11
  # conditions. See:
@@ -8,17 +14,25 @@ os.environ['GEVENT_NOWAITPID'] = 'true'
8
14
 
9
15
  # Use manhole to give us a way to debug hung processes
10
16
  # https://pypi.python.org/pypi/manhole
11
- import manhole
12
- manhole.install(
13
- verbose=False,
14
- # Listen for SIGUSR1
15
- oneshot_on="USR1"
16
- )
17
+ try:
18
+ import manhole
19
+ manhole.install(
20
+ verbose=False,
21
+ # Listen for SIGUSR1
22
+ oneshot_on="USR1"
23
+ )
24
+ except ImportError:
25
+ pass
17
26
  from gevent import monkey
27
+ patch_threads=True
28
+ for arg in sys.argv:
29
+ if "teuthology_api" in arg:
30
+ patch_threads=False
18
31
  monkey.patch_all(
19
32
  dns=False,
20
33
  # Don't patch subprocess to avoid http://tracker.ceph.com/issues/14990
21
34
  subprocess=False,
35
+ thread=patch_threads,
22
36
  )
23
37
  import sys
24
38
  from gevent.hub import Hub
@@ -30,25 +44,6 @@ from teuthology.orchestra import monkey
30
44
  monkey.patch_all()
31
45
 
32
46
  import logging
33
- import subprocess
34
-
35
- __version__ = '1.1.0'
36
-
37
- # do our best, but if it fails, continue with above
38
-
39
- try:
40
- teuthology_dir = os.path.dirname(os.path.realpath(__file__))
41
- site_dir = os.path.dirname(teuthology_dir)
42
- git_dir = os.path.join(site_dir, '.git')
43
- # make sure we use git repo otherwise it is a released version
44
- if os.path.exists(git_dir):
45
- __version__ += '-' + str(subprocess.check_output(
46
- 'git rev-parse --short HEAD'.split(),
47
- cwd=site_dir
48
- ).decode()).strip()
49
- except Exception as e:
50
- # before logging; should be unusual
51
- print("Can't get version from git rev-parse %s" % e, file=sys.stderr)
52
47
 
53
48
  # If we are running inside a virtualenv, ensure we have its 'bin' directory in
54
49
  # our PATH. This doesn't happen automatically if scripts are called without
@@ -63,6 +58,9 @@ logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(
63
58
  # if requests doesn't bundle it, shut it up anyway
64
59
  logging.getLogger('urllib3.connectionpool').setLevel(
65
60
  logging.WARN)
61
+ # We also don't need the "Converted retries value" messages
62
+ logging.getLogger('urllib3.util.retry').setLevel(
63
+ logging.WARN)
66
64
 
67
65
  logging.basicConfig(
68
66
  level=logging.INFO,
teuthology/beanstalk.py CHANGED
@@ -1,12 +1,13 @@
1
1
  import beanstalkc
2
+ import json
2
3
  import yaml
3
4
  import logging
4
5
  import pprint
5
6
  import sys
6
7
  from collections import OrderedDict
7
8
 
8
- from teuthology.config import config
9
9
  from teuthology import report
10
+ from teuthology.config import config
10
11
 
11
12
  log = logging.getLogger(__name__)
12
13
 
@@ -18,7 +19,7 @@ def connect():
18
19
  raise RuntimeError(
19
20
  'Beanstalk queue information not found in {conf_path}'.format(
20
21
  conf_path=config.teuthology_yaml))
21
- return beanstalkc.Connection(host=host, port=port)
22
+ return beanstalkc.Connection(host=host, port=port, parse_yaml=yaml.safe_load)
22
23
 
23
24
 
24
25
  def watch_tube(connection, tube_name):
@@ -196,7 +197,7 @@ def main(args):
196
197
  # it is not needed for pausing tubes
197
198
  watch_tube(connection, machine_type)
198
199
  if status:
199
- print(stats_tube(connection, machine_type))
200
+ print(json.dumps(stats_tube(connection, machine_type)))
200
201
  elif pause_duration:
201
202
  pause_tube(connection, machine_type, pause_duration)
202
203
  elif delete: