File tree Expand file tree Collapse file tree 6 files changed +63
-22
lines changed Expand file tree Collapse file tree 6 files changed +63
-22
lines changed Original file line number Diff line number Diff line change 61
61
"sphinx.ext.autosectionlabel" ,
62
62
"sphinx_gallery.gen_gallery" ,
63
63
"compatibility" ,
64
+ "runopts" ,
64
65
"nbsphinx" ,
65
66
"IPython.sphinxext.ipython_console_highlighting" ,
66
67
]
Original file line number Diff line number Diff line change @@ -25,25 +25,6 @@ class CompatibilityDirective(SphinxDirective):
25
25
has_content = True
26
26
27
27
def run (self ):
28
- """
29
- targetid = "todo-%d" % self.env.new_serialno("todo")
30
- targetnode = nodes.target("", "", ids=[targetid])
31
- todo_node = todo("\n ".join(self.content))
32
- todo_node += nodes.title(_("Todo"), _("Todo"))
33
- self.state.nested_parse(self.content, self.content_offset, todo_node)
34
- if not hasattr(self.env, "todo_all_todos"):
35
- self.env.todo_all_todos = []
36
-
37
- self.env.todo_all_todos.append(
38
- {
39
- "docname": self.env.docname,
40
- "lineno": self.lineno,
41
- "todo": todo_node.deepcopy(),
42
- "target": targetnode,
43
- }
44
- )
45
- """
46
-
47
28
raw_content = "\n " .join (self .content )
48
29
args = yaml .safe_load (raw_content )
49
30
fields = COMPATIBILITY_SETS [args ["type" ]]
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ # All rights reserved.
5
+ #
6
+ # This source code is licensed under the BSD-style license found in the
7
+ # LICENSE file in the root directory of this source tree.
8
+
9
+ from pydoc import locate
10
+
11
+ import yaml
12
+ from docutils import nodes
13
+ from sphinx .util .docutils import SphinxDirective
14
+
15
+
16
+ class RunOptsDirective (SphinxDirective ):
17
+ # this enables content in the directive
18
+ has_content = True
19
+
20
+ def run (self ):
21
+ raw_content = "\n " .join (self .content )
22
+ args = yaml .safe_load (raw_content )
23
+ cls = locate (args ["class" ])
24
+
25
+ body = nodes .literal_block (text = str (cls .run_opts (None )))
26
+ return [
27
+ body ,
28
+ ]
29
+
30
+
31
+ def setup (app ):
32
+ app .add_directive ("runopts" , RunOptsDirective )
33
+
34
+ return {
35
+ "version" : "0.1" ,
36
+ "parallel_read_safe" : True ,
37
+ "parallel_write_safe" : True ,
38
+ }
Original file line number Diff line number Diff line change @@ -331,6 +331,13 @@ class KubernetesScheduler(Scheduler):
331
331
$ torchx status kubernetes://torchx_user/1234
332
332
...
333
333
334
+ **Config Options**
335
+
336
+ .. runopts::
337
+ class: torchx.schedulers.kubernetes_scheduler.KubernetesScheduler
338
+
339
+ **Compatibility**
340
+
334
341
.. compatibility::
335
342
type: scheduler
336
343
features:
Original file line number Diff line number Diff line change @@ -528,10 +528,16 @@ class LocalScheduler(Scheduler):
528
528
.. note::
529
529
The orphan cleanup only works if `LocalScheduler` is instantiated from the main thread.
530
530
531
+ **Config Options**
532
+
533
+ .. runopts::
534
+ class: torchx.schedulers.local_scheduler.LocalScheduler
535
+
536
+ **Compatibility**
537
+
531
538
.. note::
532
- Use this scheduler sparingly since an application that runs successfully
533
- on a session backed by this scheduler may not work on an actual
534
- production cluster using a different scheduler.
539
+ Due to scheduler differences jobs that run locally may not work when
540
+ using a different scheduler due to network or software dependencies.
535
541
536
542
.. compatibility::
537
543
type: scheduler
Original file line number Diff line number Diff line change @@ -224,6 +224,13 @@ class SlurmScheduler(Scheduler):
224
224
$ less slurm-1234.out
225
225
...
226
226
227
+ **Config Options**
228
+
229
+ .. runopts::
230
+ class: torchx.schedulers.slurm_scheduler.SlurmScheduler
231
+
232
+ **Compatibility**
233
+
227
234
.. compatibility::
228
235
type: scheduler
229
236
features:
@@ -233,6 +240,7 @@ class SlurmScheduler(Scheduler):
233
240
describe: |
234
241
Partial support. SlurmScheduler will return job and replica
235
242
status but does not provide the complete original AppSpec.
243
+
236
244
"""
237
245
238
246
def __init__ (self , session_name : str ) -> None :
You can’t perform that action at this time.
0 commit comments