teuthology 1.0.0__py3-none-any.whl → 1.2.0__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 (172) hide show
  1. scripts/describe.py +1 -0
  2. scripts/dispatcher.py +62 -0
  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/run.py +4 -0
  9. scripts/schedule.py +4 -0
  10. scripts/suite.py +61 -16
  11. scripts/supervisor.py +44 -0
  12. scripts/update_inventory.py +10 -4
  13. scripts/wait.py +31 -0
  14. teuthology/__init__.py +24 -21
  15. teuthology/beanstalk.py +4 -3
  16. teuthology/config.py +17 -6
  17. teuthology/contextutil.py +18 -14
  18. teuthology/describe_tests.py +25 -18
  19. teuthology/dispatcher/__init__.py +365 -0
  20. teuthology/dispatcher/supervisor.py +374 -0
  21. teuthology/exceptions.py +54 -0
  22. teuthology/exporter.py +347 -0
  23. teuthology/kill.py +76 -75
  24. teuthology/lock/cli.py +16 -7
  25. teuthology/lock/ops.py +276 -70
  26. teuthology/lock/query.py +61 -44
  27. teuthology/ls.py +9 -18
  28. teuthology/misc.py +152 -137
  29. teuthology/nuke/__init__.py +12 -351
  30. teuthology/openstack/__init__.py +4 -3
  31. teuthology/openstack/openstack-centos-7.0-user-data.txt +1 -1
  32. teuthology/openstack/openstack-centos-7.1-user-data.txt +1 -1
  33. teuthology/openstack/openstack-centos-7.2-user-data.txt +1 -1
  34. teuthology/openstack/openstack-debian-8.0-user-data.txt +1 -1
  35. teuthology/openstack/openstack-opensuse-42.1-user-data.txt +1 -1
  36. teuthology/openstack/openstack-teuthology.cron +0 -1
  37. teuthology/orchestra/cluster.py +51 -9
  38. teuthology/orchestra/connection.py +23 -16
  39. teuthology/orchestra/console.py +111 -50
  40. teuthology/orchestra/daemon/cephadmunit.py +23 -5
  41. teuthology/orchestra/daemon/state.py +10 -3
  42. teuthology/orchestra/daemon/systemd.py +10 -8
  43. teuthology/orchestra/opsys.py +32 -11
  44. teuthology/orchestra/remote.py +369 -152
  45. teuthology/orchestra/run.py +21 -12
  46. teuthology/packaging.py +54 -15
  47. teuthology/provision/__init__.py +30 -10
  48. teuthology/provision/cloud/openstack.py +12 -6
  49. teuthology/provision/cloud/util.py +1 -2
  50. teuthology/provision/downburst.py +83 -29
  51. teuthology/provision/fog.py +68 -20
  52. teuthology/provision/openstack.py +5 -4
  53. teuthology/provision/pelagos.py +13 -5
  54. teuthology/repo_utils.py +91 -44
  55. teuthology/report.py +57 -35
  56. teuthology/results.py +5 -3
  57. teuthology/run.py +21 -15
  58. teuthology/run_tasks.py +114 -40
  59. teuthology/schedule.py +4 -3
  60. teuthology/scrape.py +28 -22
  61. teuthology/suite/__init__.py +75 -46
  62. teuthology/suite/build_matrix.py +34 -24
  63. teuthology/suite/fragment-merge.lua +105 -0
  64. teuthology/suite/matrix.py +31 -2
  65. teuthology/suite/merge.py +175 -0
  66. teuthology/suite/placeholder.py +8 -8
  67. teuthology/suite/run.py +204 -102
  68. teuthology/suite/util.py +67 -211
  69. teuthology/task/__init__.py +1 -1
  70. teuthology/task/ansible.py +101 -31
  71. teuthology/task/buildpackages.py +2 -2
  72. teuthology/task/ceph_ansible.py +13 -6
  73. teuthology/task/cephmetrics.py +2 -1
  74. teuthology/task/clock.py +33 -14
  75. teuthology/task/exec.py +18 -0
  76. teuthology/task/hadoop.py +2 -2
  77. teuthology/task/install/__init__.py +51 -22
  78. teuthology/task/install/bin/adjust-ulimits +16 -0
  79. teuthology/task/install/bin/daemon-helper +114 -0
  80. teuthology/task/install/bin/stdin-killer +263 -0
  81. teuthology/task/install/deb.py +24 -4
  82. teuthology/task/install/redhat.py +36 -32
  83. teuthology/task/install/rpm.py +41 -14
  84. teuthology/task/install/util.py +48 -22
  85. teuthology/task/internal/__init__.py +69 -11
  86. teuthology/task/internal/edit_sudoers.sh +10 -0
  87. teuthology/task/internal/lock_machines.py +3 -133
  88. teuthology/task/internal/redhat.py +48 -28
  89. teuthology/task/internal/syslog.py +31 -8
  90. teuthology/task/kernel.py +155 -147
  91. teuthology/task/lockfile.py +1 -1
  92. teuthology/task/mpi.py +10 -10
  93. teuthology/task/pcp.py +1 -1
  94. teuthology/task/selinux.py +17 -8
  95. teuthology/task/ssh_keys.py +6 -6
  96. teuthology/task/tests/__init__.py +137 -77
  97. teuthology/task/tests/test_fetch_coredumps.py +116 -0
  98. teuthology/task/tests/test_run.py +4 -4
  99. teuthology/timer.py +3 -3
  100. teuthology/util/loggerfile.py +19 -0
  101. teuthology/util/scanner.py +159 -0
  102. teuthology/util/sentry.py +52 -0
  103. teuthology/util/time.py +52 -0
  104. teuthology-1.2.0.data/scripts/adjust-ulimits +16 -0
  105. teuthology-1.2.0.data/scripts/daemon-helper +114 -0
  106. teuthology-1.2.0.data/scripts/stdin-killer +263 -0
  107. teuthology-1.2.0.dist-info/METADATA +89 -0
  108. teuthology-1.2.0.dist-info/RECORD +174 -0
  109. {teuthology-1.0.0.dist-info → teuthology-1.2.0.dist-info}/WHEEL +1 -1
  110. {teuthology-1.0.0.dist-info → teuthology-1.2.0.dist-info}/entry_points.txt +5 -2
  111. scripts/nuke.py +0 -45
  112. scripts/worker.py +0 -37
  113. teuthology/nuke/actions.py +0 -456
  114. teuthology/openstack/test/__init__.py +0 -0
  115. teuthology/openstack/test/openstack-integration.py +0 -286
  116. teuthology/openstack/test/test_config.py +0 -35
  117. teuthology/openstack/test/test_openstack.py +0 -1695
  118. teuthology/orchestra/test/__init__.py +0 -0
  119. teuthology/orchestra/test/integration/__init__.py +0 -0
  120. teuthology/orchestra/test/integration/test_integration.py +0 -94
  121. teuthology/orchestra/test/test_cluster.py +0 -240
  122. teuthology/orchestra/test/test_connection.py +0 -106
  123. teuthology/orchestra/test/test_console.py +0 -217
  124. teuthology/orchestra/test/test_opsys.py +0 -404
  125. teuthology/orchestra/test/test_remote.py +0 -185
  126. teuthology/orchestra/test/test_run.py +0 -286
  127. teuthology/orchestra/test/test_systemd.py +0 -54
  128. teuthology/orchestra/test/util.py +0 -12
  129. teuthology/sentry.py +0 -18
  130. teuthology/test/__init__.py +0 -0
  131. teuthology/test/fake_archive.py +0 -107
  132. teuthology/test/fake_fs.py +0 -92
  133. teuthology/test/integration/__init__.py +0 -0
  134. teuthology/test/integration/test_suite.py +0 -86
  135. teuthology/test/task/__init__.py +0 -205
  136. teuthology/test/task/test_ansible.py +0 -624
  137. teuthology/test/task/test_ceph_ansible.py +0 -176
  138. teuthology/test/task/test_console_log.py +0 -88
  139. teuthology/test/task/test_install.py +0 -337
  140. teuthology/test/task/test_internal.py +0 -57
  141. teuthology/test/task/test_kernel.py +0 -243
  142. teuthology/test/task/test_pcp.py +0 -379
  143. teuthology/test/task/test_selinux.py +0 -35
  144. teuthology/test/test_config.py +0 -189
  145. teuthology/test/test_contextutil.py +0 -68
  146. teuthology/test/test_describe_tests.py +0 -316
  147. teuthology/test/test_email_sleep_before_teardown.py +0 -81
  148. teuthology/test/test_exit.py +0 -97
  149. teuthology/test/test_get_distro.py +0 -47
  150. teuthology/test/test_get_distro_version.py +0 -47
  151. teuthology/test/test_get_multi_machine_types.py +0 -27
  152. teuthology/test/test_job_status.py +0 -60
  153. teuthology/test/test_ls.py +0 -48
  154. teuthology/test/test_misc.py +0 -368
  155. teuthology/test/test_nuke.py +0 -232
  156. teuthology/test/test_packaging.py +0 -763
  157. teuthology/test/test_parallel.py +0 -28
  158. teuthology/test/test_repo_utils.py +0 -204
  159. teuthology/test/test_report.py +0 -77
  160. teuthology/test/test_results.py +0 -155
  161. teuthology/test/test_run.py +0 -238
  162. teuthology/test/test_safepath.py +0 -55
  163. teuthology/test/test_schedule.py +0 -45
  164. teuthology/test/test_scrape.py +0 -167
  165. teuthology/test/test_timer.py +0 -80
  166. teuthology/test/test_vps_os_vers_parameter_checking.py +0 -84
  167. teuthology/test/test_worker.py +0 -303
  168. teuthology/worker.py +0 -339
  169. teuthology-1.0.0.dist-info/METADATA +0 -76
  170. teuthology-1.0.0.dist-info/RECORD +0 -210
  171. {teuthology-1.0.0.dist-info → teuthology-1.2.0.dist-info}/LICENSE +0 -0
  172. {teuthology-1.0.0.dist-info → teuthology-1.2.0.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 ADDED
@@ -0,0 +1,62 @@
1
+ import argparse
2
+ import sys
3
+
4
+ import teuthology.dispatcher.supervisor
5
+
6
+ from .supervisor import parse_args as parse_supervisor_args
7
+
8
+
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)
45
+
46
+
47
+ def main():
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/run.py CHANGED
@@ -23,6 +23,10 @@ optional arguments:
23
23
  --name NAME name for this teuthology run
24
24
  --suite-path SUITE_PATH Location of ceph-qa-suite on disk. If not specified,
25
25
  it will be fetched
26
+ --interactive-on-error drop to a python shell on failure, which will
27
+ halt the job; developer can then ssh to targets
28
+ and examine cluster state.
29
+
26
30
  """
27
31
  import docopt
28
32
 
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,13 @@ 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'
119
+ --rocketchat <rocketchat> Comma separated list of Rocket.Chat channels where
120
+ to send a message when tests finished or time out.
121
+ To be used with --sleep-before-teardown option.
112
122
  -N <num>, --num <num> Number of times to run/queue the job
113
123
  [default: 1]
114
124
  -l <jobs>, --limit <jobs> Queue at most this many jobs
@@ -118,7 +128,8 @@ Scheduler arguments:
118
128
  contain each facet at least once) and schedule
119
129
  piece <index>. Scheduling 0/<outof>, 1/<outof>,
120
130
  2/<outof> ... <outof>-1/<outof> will schedule all
121
- 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.
122
133
  -p <priority>, --priority <priority>
123
134
  Job priority (lower is sooner)
124
135
  [default: 1000]
@@ -154,20 +165,53 @@ Scheduler arguments:
154
165
  using the same logic as --filter.
155
166
  Of all the flags that were passed when scheduling
156
167
  the original run, the resulting one will only
157
- inherit the suite value. Any others must be
158
- passed as normal while scheduling with this
159
- feature. For random tests involving facet whose
160
- path ends with '$' operator, you might want to
161
- 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).
162
174
  -R, --rerun-statuses <statuses>
163
175
  A comma-separated list of statuses to be used
164
176
  with --rerun. Supported statuses are: 'dead',
165
177
  'fail', 'pass', 'queued', 'running', 'waiting'
166
178
  [default: fail,dead]
167
179
  --seed SEED An random number mostly useful when used along
168
- with --rerun argument. This number can be found
169
- in the output of teuthology-suite command. -1
170
- 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].
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
+ +-----------------+-----------------------------------------------------------------+
171
215
 
172
216
  """.format(
173
217
  default_machine_type=config.default_machine_type,
@@ -176,7 +220,8 @@ Scheduler arguments:
176
220
  config.get_ceph_git_url()),
177
221
  default_suite_repo=defaults('--suite-repo',
178
222
  config.get_ceph_qa_suite_git_url()),
179
- default_ceph_branch=defaults('--ceph-branch', 'master'),
223
+ default_ceph_branch=defaults('--ceph-branch', 'main'),
224
+ default_job_threshold=config.job_threshold,
180
225
  )
181
226
 
182
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)
scripts/wait.py ADDED
@@ -0,0 +1,31 @@
1
+ import docopt
2
+ import sys
3
+
4
+ import logging
5
+
6
+ import teuthology
7
+ import teuthology.suite
8
+ from teuthology.config import config
9
+
10
+ doc = """
11
+ usage: teuthology-wait --help
12
+ teuthology-wait [-v] --run <name>
13
+
14
+ Wait until run is finished. Returns exit code 0 on success, otherwise 1.
15
+
16
+ Miscellaneous arguments:
17
+ -h, --help Show this help message and exit
18
+ -v, --verbose Be more verbose
19
+
20
+ Standard arguments:
21
+ -r, --run <name> Run name to watch.
22
+ """
23
+
24
+
25
+ def main(argv=sys.argv[1:]):
26
+ args = docopt.docopt(doc, argv=argv)
27
+ if args.get('--verbose'):
28
+ teuthology.log.setLevel(logging.DEBUG)
29
+ name = args.get('--run')
30
+ return teuthology.suite.wait(name, config.max_job_time, None)
31
+
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,20 +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.0.0'
36
-
37
- # do our best, but if it fails, continue with above
38
-
39
- try:
40
- __version__ += '-' + str(subprocess.check_output(
41
- 'git rev-parse --short HEAD'.split(),
42
- cwd=os.path.dirname(os.path.realpath(__file__))
43
- ).decode()).strip()
44
- except Exception as e:
45
- # before logging; should be unusual
46
- print("Can't get version from git rev-parse %s" % e, file=sys.stderr)
47
47
 
48
48
  # If we are running inside a virtualenv, ensure we have its 'bin' directory in
49
49
  # our PATH. This doesn't happen automatically if scripts are called without
@@ -58,6 +58,9 @@ logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(
58
58
  # if requests doesn't bundle it, shut it up anyway
59
59
  logging.getLogger('urllib3.connectionpool').setLevel(
60
60
  logging.WARN)
61
+ # We also don't need the "Converted retries value" messages
62
+ logging.getLogger('urllib3.util.retry').setLevel(
63
+ logging.WARN)
61
64
 
62
65
  logging.basicConfig(
63
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: