ominfra 0.0.0.dev153__py3-none-any.whl → 0.0.0.dev155__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. ominfra/manage/bootstrap.py +4 -0
  2. ominfra/manage/bootstrap_.py +5 -0
  3. ominfra/manage/commands/inject.py +8 -11
  4. ominfra/manage/commands/{execution.py → local.py} +1 -5
  5. ominfra/manage/commands/ping.py +23 -0
  6. ominfra/manage/commands/types.py +8 -0
  7. ominfra/manage/deploy/apps.py +72 -0
  8. ominfra/manage/deploy/config.py +8 -0
  9. ominfra/manage/deploy/git.py +136 -0
  10. ominfra/manage/deploy/inject.py +21 -0
  11. ominfra/manage/deploy/paths.py +81 -28
  12. ominfra/manage/deploy/types.py +13 -0
  13. ominfra/manage/deploy/venvs.py +66 -0
  14. ominfra/manage/inject.py +20 -4
  15. ominfra/manage/main.py +15 -27
  16. ominfra/manage/remote/_main.py +1 -1
  17. ominfra/manage/remote/config.py +0 -2
  18. ominfra/manage/remote/connection.py +7 -24
  19. ominfra/manage/remote/execution.py +1 -1
  20. ominfra/manage/remote/inject.py +3 -14
  21. ominfra/manage/system/commands.py +22 -2
  22. ominfra/manage/system/config.py +3 -1
  23. ominfra/manage/system/inject.py +16 -6
  24. ominfra/manage/system/packages.py +33 -7
  25. ominfra/manage/system/platforms.py +72 -0
  26. ominfra/manage/targets/__init__.py +0 -0
  27. ominfra/manage/targets/connection.py +150 -0
  28. ominfra/manage/targets/inject.py +42 -0
  29. ominfra/manage/targets/targets.py +87 -0
  30. ominfra/scripts/journald2aws.py +24 -7
  31. ominfra/scripts/manage.py +1880 -438
  32. ominfra/scripts/supervisor.py +187 -25
  33. ominfra/supervisor/configs.py +163 -18
  34. {ominfra-0.0.0.dev153.dist-info → ominfra-0.0.0.dev155.dist-info}/METADATA +3 -3
  35. {ominfra-0.0.0.dev153.dist-info → ominfra-0.0.0.dev155.dist-info}/RECORD +40 -29
  36. ominfra/manage/system/types.py +0 -5
  37. /ominfra/manage/{commands → deploy}/interp.py +0 -0
  38. {ominfra-0.0.0.dev153.dist-info → ominfra-0.0.0.dev155.dist-info}/LICENSE +0 -0
  39. {ominfra-0.0.0.dev153.dist-info → ominfra-0.0.0.dev155.dist-info}/WHEEL +0 -0
  40. {ominfra-0.0.0.dev153.dist-info → ominfra-0.0.0.dev155.dist-info}/entry_points.txt +0 -0
  41. {ominfra-0.0.0.dev153.dist-info → ominfra-0.0.0.dev155.dist-info}/top_level.txt +0 -0
@@ -1726,8 +1726,6 @@ def async_cached_nullary(fn): # ta.Callable[..., T]) -> ta.Callable[..., T]:
1726
1726
  """
1727
1727
  TODO:
1728
1728
  - def maybe(v: lang.Maybe[T])
1729
- - patch / override lite.check ?
1730
- - checker interface?
1731
1729
  """
1732
1730
 
1733
1731
 
@@ -3789,6 +3787,20 @@ def attr_setting(obj, attr, val, *, default=None): # noqa
3789
3787
  setattr(obj, attr, orig)
3790
3788
 
3791
3789
 
3790
+ ##
3791
+
3792
+
3793
+ class aclosing(contextlib.AbstractAsyncContextManager): # noqa
3794
+ def __init__(self, thing):
3795
+ self.thing = thing
3796
+
3797
+ async def __aenter__(self):
3798
+ return self.thing
3799
+
3800
+ async def __aexit__(self, *exc_info):
3801
+ await self.thing.aclose()
3802
+
3803
+
3792
3804
  ########################################
3793
3805
  # ../../../omlish/lite/inject.py
3794
3806
 
@@ -4957,7 +4969,8 @@ def configure_standard_logging(
4957
4969
  """
4958
4970
  TODO:
4959
4971
  - pickle stdlib objs? have to pin to 3.8 pickle protocol, will be cross-version
4960
- - nonstrict toggle
4972
+ - namedtuple
4973
+ - literals
4961
4974
  """
4962
4975
 
4963
4976
 
@@ -5247,14 +5260,18 @@ class ObjMarshalerManager:
5247
5260
  ) -> ObjMarshaler:
5248
5261
  if isinstance(ty, type):
5249
5262
  if abc.ABC in ty.__bases__:
5250
- return PolymorphicObjMarshaler.of([ # type: ignore
5263
+ impls = [ity for ity in deep_subclasses(ty) if abc.ABC not in ity.__bases__] # type: ignore
5264
+ if all(ity.__qualname__.endswith(ty.__name__) for ity in impls):
5265
+ ins = {ity: snake_case(ity.__qualname__[:-len(ty.__name__)]) for ity in impls}
5266
+ else:
5267
+ ins = {ity: ity.__qualname__ for ity in impls}
5268
+ return PolymorphicObjMarshaler.of([
5251
5269
  PolymorphicObjMarshaler.Impl(
5252
5270
  ity,
5253
- ity.__qualname__,
5271
+ itn,
5254
5272
  rec(ity),
5255
5273
  )
5256
- for ity in deep_subclasses(ty)
5257
- if abc.ABC not in ity.__bases__
5274
+ for ity, itn in ins.items()
5258
5275
  ])
5259
5276
 
5260
5277
  if issubclass(ty, enum.Enum):
@@ -5816,22 +5833,124 @@ class RestartUnconditionally:
5816
5833
 
5817
5834
  @dc.dataclass(frozen=True)
5818
5835
  class ProcessConfig:
5836
+ # A Python string expression that is used to compose the supervisor process name for this process. You usually don't
5837
+ # need to worry about setting this unless you change numprocs. The string expression is evaluated against a
5838
+ # dictionary that includes group_name, host_node_name, process_num, program_name, and here (the directory of the
5839
+ # supervisord config file).
5819
5840
  name: str
5841
+
5842
+ # The command that will be run when this program is started. The command can be either absolute (e.g.
5843
+ # /path/to/programname) or relative (e.g. programname). If it is relative, the supervisord's environment $PATH will
5844
+ # be searched for the executable. Programs can accept arguments, e.g. /path/to/program foo bar. The command line can
5845
+ # use double quotes to group arguments with spaces in them to pass to the program, e.g. /path/to/program/name -p
5846
+ # "foo bar". Note that the value of command may include Python string expressions, e.g. /path/to/programname
5847
+ # --port=80%(process_num)02d might expand to /path/to/programname --port=8000 at runtime. String expressions are
5848
+ # evaluated against a dictionary containing the keys group_name, host_node_name, program_name, process_num,
5849
+ # numprocs, here (the directory of the supervisord config file), and all supervisord's environment variables
5850
+ # prefixed with ENV_. Controlled programs should themselves not be daemons, as supervisord assumes it is responsible
5851
+ # for daemonizing its subprocesses
5820
5852
  command: str
5821
5853
 
5854
+ #
5855
+
5856
+ # Supervisor will start as many instances of this program as named by numprocs. Note that if numprocs > 1, the
5857
+ # process_name expression must include %(process_num)s (or any other valid Python string expression that includes
5858
+ # process_num) within it.
5859
+ num_procs: int = 1
5860
+
5861
+ # An integer offset that is used to compute the number at which process_num starts.
5862
+ num_procs_start: int = 0
5863
+
5864
+ #
5865
+
5866
+ # Instruct supervisord to use this UNIX user account as the account which runs the program. The user can only be
5867
+ # switched if supervisord is run as the root user. If supervisord can't switch to the specified user, the program
5868
+ # will not be started.
5869
+ #
5870
+ # Note: The user will be changed using setuid only. This does not start a login shell and does not change
5871
+ # environment variables like USER or HOME
5872
+ user: ta.Optional[str] = None
5822
5873
  uid: ta.Optional[int] = None
5823
- directory: ta.Optional[str] = None
5874
+
5875
+ # An octal number (e.g. 002, 022) representing the umask of the process.
5824
5876
  umask: ta.Optional[int] = None
5877
+
5878
+ #
5879
+
5880
+ # A file path representing a directory to which supervisord should temporarily chdir before exec'ing the child.
5881
+ directory: ta.Optional[str] = None
5882
+
5883
+ # A list of key/value pairs in the form KEY="val",KEY2="val2" that will be placed in the child process' environment.
5884
+ # The environment string may contain Python string expressions that will be evaluated against a dictionary
5885
+ # containing group_name, host_node_name, process_num, program_name, and here (the directory of the supervisord
5886
+ # config file). Values containing non-alphanumeric characters should be quoted (e.g. KEY="val:123",KEY2="val,456").
5887
+ # Otherwise, quoting the values is optional but recommended. Note that the subprocess will inherit the environment
5888
+ # variables of the shell used to start “supervisord” except for the ones overridden here.
5889
+ environment: ta.Optional[ta.Mapping[str, str]] = None
5890
+
5891
+ #
5892
+
5893
+ # The relative priority of the program in the start and shutdown ordering. Lower priorities indicate programs that
5894
+ # start first and shut down last at startup and when aggregate commands are used in various clients (e.g. “start
5895
+ # all”/”stop all”). Higher priorities indicate programs that start last and shut down first.
5825
5896
  priority: int = 999
5826
5897
 
5898
+ # If true, this program will start automatically when supervisord is started.
5827
5899
  auto_start: bool = True
5900
+
5901
+ # Specifies if supervisord should automatically restart a process if it exits when it is in the RUNNING state. May
5902
+ # be one of false, unexpected, or true. If false, the process will not be autorestarted. If unexpected, the process
5903
+ # will be restarted when the program exits with an exit code that is not one of the exit codes associated with this
5904
+ # process' configuration (see exitcodes). If true, the process will be unconditionally restarted when it exits,
5905
+ # without regard to its exit code.
5906
+ #
5907
+ # Note: autorestart controls whether supervisord will autorestart a program if it exits after it has successfully
5908
+ # started up (the process is in the RUNNING state). supervisord has a different restart mechanism for when the
5909
+ # process is starting up (the process is in the STARTING state). Retries during process startup are controlled by
5910
+ # startsecs and startretries.
5828
5911
  auto_restart: str = 'unexpected'
5829
5912
 
5913
+ # The total number of seconds which the program needs to stay running after a startup to consider the start
5914
+ # successful (moving the process from the STARTING state to the RUNNING state). Set to 0 to indicate that the
5915
+ # program needn't stay running for any particular amount of time.
5916
+ #
5917
+ # Note: Even if a process exits with an “expected” exit code (see exitcodes), the start will still be considered a
5918
+ # failure if the process exits quicker than startsecs.
5830
5919
  start_secs: int = 1
5920
+
5921
+ # The number of serial failure attempts that supervisord will allow when attempting to start the program before
5922
+ # giving up and putting the process into an FATAL state.
5923
+ #
5924
+ # Note: After each failed restart, process will be put in BACKOFF state and each retry attempt will take
5925
+ # increasingly more time.
5831
5926
  start_retries: int = 3
5832
5927
 
5833
- num_procs: int = 1
5834
- num_procs_start: int = 0
5928
+ # The signal used to kill the program when a stop is requested. This can be specified using the signal's name or its
5929
+ # number. It is normally one of: TERM, HUP, INT, QUIT, KILL, USR1, or USR2.
5930
+ stop_signal: int = signal.SIGTERM
5931
+
5932
+ # The number of seconds to wait for the OS to return a SIGCHLD to supervisord after the program has been sent a
5933
+ # stopsignal. If this number of seconds elapses before supervisord receives a SIGCHLD from the process, supervisord
5934
+ # will attempt to kill it with a final SIGKILL.
5935
+ stop_wait_secs: int = 10
5936
+
5937
+ # If true, the flag causes supervisor to send the stop signal to the whole process group and implies killasgroup is
5938
+ # true. This is useful for programs, such as Flask in debug mode, that do not propagate stop signals to their
5939
+ # children, leaving them orphaned.
5940
+ stop_as_group: bool = False
5941
+
5942
+ # If true, when resorting to send SIGKILL to the program to terminate it send it to its whole process group instead,
5943
+ # taking care of its children as well, useful e.g with Python programs using multiprocessing.
5944
+ kill_as_group: bool = False
5945
+
5946
+ # The list of “expected” exit codes for this program used with autorestart. If the autorestart parameter is set to
5947
+ # unexpected, and the process exits in any other way than as a result of a supervisor stop request, supervisord will
5948
+ # restart the process if it exits with an exit code that is not defined in this list.
5949
+ #
5950
+ # Note: In Supervisor versions prior to 4.0, the default was 0,2. In Supervisor 4.0, the default was changed to 0.
5951
+ exitcodes: ta.Sequence[int] = (0,)
5952
+
5953
+ #
5835
5954
 
5836
5955
  @dc.dataclass(frozen=True)
5837
5956
  class Log:
@@ -5845,18 +5964,14 @@ class ProcessConfig:
5845
5964
  stdout: Log = Log()
5846
5965
  stderr: Log = Log()
5847
5966
 
5848
- stop_signal: int = signal.SIGTERM
5849
- stop_wait_secs: int = 10
5850
- stop_as_group: bool = False
5851
-
5852
- kill_as_group: bool = False
5853
-
5854
- exitcodes: ta.Sequence[int] = (0,)
5855
-
5967
+ # If true, cause the process' stderr output to be sent back to supervisord on its stdout file descriptor (in UNIX
5968
+ # shell terms, this is the equivalent of executing /the/program 2>&1).
5969
+ #
5970
+ # Note: Do not set redirect_stderr=true in an [eventlistener:x] section. Eventlisteners use stdout and stdin to
5971
+ # communicate with supervisord. If stderr is redirected, output from stderr will interfere with the eventlistener
5972
+ # protocol.
5856
5973
  redirect_stderr: bool = False
5857
5974
 
5858
- environment: ta.Optional[ta.Mapping[str, str]] = None
5859
-
5860
5975
 
5861
5976
  @dc.dataclass(frozen=True)
5862
5977
  class ProcessGroupConfig:
@@ -5869,28 +5984,75 @@ class ProcessGroupConfig:
5869
5984
 
5870
5985
  @dc.dataclass(frozen=True)
5871
5986
  class ServerConfig:
5987
+ # Instruct supervisord to switch users to this UNIX user account before doing any meaningful processing. The user
5988
+ # can only be switched if supervisord is started as the root user.
5872
5989
  user: ta.Optional[str] = None
5990
+
5991
+ # If true, supervisord will start in the foreground instead of daemonizing.
5873
5992
  nodaemon: bool = False
5993
+
5994
+ # The umask of the supervisord process.
5874
5995
  umask: int = 0o22
5996
+
5997
+ #
5998
+
5999
+ # When supervisord daemonizes, switch to this directory. This option can include the value %(here)s, which expands
6000
+ # to the directory in which the supervisord configuration file was found.
5875
6001
  directory: ta.Optional[str] = None
5876
- logfile: str = 'supervisord.log'
5877
- logfile_max_bytes: int = 50 * 1024 * 1024
5878
- logfile_backups: int = 10
5879
- loglevel: int = logging.INFO
6002
+
6003
+ # The location in which supervisord keeps its pid file. This option can include the value %(here)s, which expands to
6004
+ # the directory in which the supervisord configuration file was found.
5880
6005
  pidfile: str = 'supervisord.pid'
6006
+
6007
+ # The identifier string for this supervisor process, used by the RPC interface.
5881
6008
  identifier: str = 'supervisor'
5882
- child_logdir: str = '/dev/null'
6009
+
6010
+ # The minimum number of file descriptors that must be available before supervisord will start successfully.
5883
6011
  min_fds: int = 1024
6012
+ # The minimum number of process descriptors that must be available before supervisord will start successfully.
5884
6013
  min_procs: int = 200
6014
+
6015
+ # Prevent supervisord from clearing any existing AUTO child log files at startup time. Useful for debugging
5885
6016
  nocleanup: bool = False
6017
+
6018
+ # Strip all ANSI escape sequences from child log files.
5886
6019
  strip_ansi: bool = False
6020
+
6021
+ #
6022
+
6023
+ # The path to the activity log of the supervisord process. This option can include the value %(here)s, which expands
6024
+ # to the directory in which the supervisord configuration file was found.
6025
+ logfile: str = 'supervisord.log'
6026
+
6027
+ # The maximum number of bytes that may be consumed by the activity log file before it is rotated (suffix multipliers
6028
+ # like “KB”, “MB”, and “GB” can be used in the value). Set this value to 0 to indicate an unlimited log size.
6029
+ logfile_max_bytes: int = 50 * 1024 * 1024
6030
+
6031
+ # The number of backups to keep around resulting from activity log file rotation. If set to 0, no backups will be
6032
+ # kept.
6033
+ logfile_backups: int = 10
6034
+
6035
+ # The logging level, dictating what is written to the supervisord activity log. One of critical, error, warn, info,
6036
+ # debug, trace, or blather. Note that at log level debug, the supervisord log file will record the stderr/stdout
6037
+ # output of its child processes and extended info about process state changes, which is useful for debugging a
6038
+ # process which isn't starting properly.
6039
+ loglevel: int = logging.INFO
6040
+
6041
+ # The directory used for AUTO child log files. This option can include the value %(here)s, which expands to the
6042
+ # directory in which the supervisord configuration file was found.
6043
+ child_logdir: str = '/dev/null'
6044
+
6045
+ # If true and not daemonized, logs will not be directed to stdout.
5887
6046
  silent: bool = False
5888
6047
 
6048
+ #
6049
+
5889
6050
  groups: ta.Optional[ta.Sequence[ProcessGroupConfig]] = None
5890
6051
 
5891
6052
  @classmethod
5892
6053
  def new(
5893
6054
  cls,
6055
+ *,
5894
6056
  umask: ta.Union[int, str] = 0o22,
5895
6057
  directory: ta.Optional[str] = None,
5896
6058
  logfile: str = 'supervisord.log',
@@ -29,22 +29,124 @@ class RestartUnconditionally:
29
29
 
30
30
  @dc.dataclass(frozen=True)
31
31
  class ProcessConfig:
32
+ # A Python string expression that is used to compose the supervisor process name for this process. You usually don't
33
+ # need to worry about setting this unless you change numprocs. The string expression is evaluated against a
34
+ # dictionary that includes group_name, host_node_name, process_num, program_name, and here (the directory of the
35
+ # supervisord config file).
32
36
  name: str
37
+
38
+ # The command that will be run when this program is started. The command can be either absolute (e.g.
39
+ # /path/to/programname) or relative (e.g. programname). If it is relative, the supervisord's environment $PATH will
40
+ # be searched for the executable. Programs can accept arguments, e.g. /path/to/program foo bar. The command line can
41
+ # use double quotes to group arguments with spaces in them to pass to the program, e.g. /path/to/program/name -p
42
+ # "foo bar". Note that the value of command may include Python string expressions, e.g. /path/to/programname
43
+ # --port=80%(process_num)02d might expand to /path/to/programname --port=8000 at runtime. String expressions are
44
+ # evaluated against a dictionary containing the keys group_name, host_node_name, program_name, process_num,
45
+ # numprocs, here (the directory of the supervisord config file), and all supervisord's environment variables
46
+ # prefixed with ENV_. Controlled programs should themselves not be daemons, as supervisord assumes it is responsible
47
+ # for daemonizing its subprocesses
33
48
  command: str
34
49
 
50
+ #
51
+
52
+ # Supervisor will start as many instances of this program as named by numprocs. Note that if numprocs > 1, the
53
+ # process_name expression must include %(process_num)s (or any other valid Python string expression that includes
54
+ # process_num) within it.
55
+ num_procs: int = 1
56
+
57
+ # An integer offset that is used to compute the number at which process_num starts.
58
+ num_procs_start: int = 0
59
+
60
+ #
61
+
62
+ # Instruct supervisord to use this UNIX user account as the account which runs the program. The user can only be
63
+ # switched if supervisord is run as the root user. If supervisord can't switch to the specified user, the program
64
+ # will not be started.
65
+ #
66
+ # Note: The user will be changed using setuid only. This does not start a login shell and does not change
67
+ # environment variables like USER or HOME
68
+ user: ta.Optional[str] = None
35
69
  uid: ta.Optional[int] = None
36
- directory: ta.Optional[str] = None
70
+
71
+ # An octal number (e.g. 002, 022) representing the umask of the process.
37
72
  umask: ta.Optional[int] = None
73
+
74
+ #
75
+
76
+ # A file path representing a directory to which supervisord should temporarily chdir before exec'ing the child.
77
+ directory: ta.Optional[str] = None
78
+
79
+ # A list of key/value pairs in the form KEY="val",KEY2="val2" that will be placed in the child process' environment.
80
+ # The environment string may contain Python string expressions that will be evaluated against a dictionary
81
+ # containing group_name, host_node_name, process_num, program_name, and here (the directory of the supervisord
82
+ # config file). Values containing non-alphanumeric characters should be quoted (e.g. KEY="val:123",KEY2="val,456").
83
+ # Otherwise, quoting the values is optional but recommended. Note that the subprocess will inherit the environment
84
+ # variables of the shell used to start “supervisord” except for the ones overridden here.
85
+ environment: ta.Optional[ta.Mapping[str, str]] = None
86
+
87
+ #
88
+
89
+ # The relative priority of the program in the start and shutdown ordering. Lower priorities indicate programs that
90
+ # start first and shut down last at startup and when aggregate commands are used in various clients (e.g. “start
91
+ # all”/”stop all”). Higher priorities indicate programs that start last and shut down first.
38
92
  priority: int = 999
39
93
 
94
+ # If true, this program will start automatically when supervisord is started.
40
95
  auto_start: bool = True
96
+
97
+ # Specifies if supervisord should automatically restart a process if it exits when it is in the RUNNING state. May
98
+ # be one of false, unexpected, or true. If false, the process will not be autorestarted. If unexpected, the process
99
+ # will be restarted when the program exits with an exit code that is not one of the exit codes associated with this
100
+ # process' configuration (see exitcodes). If true, the process will be unconditionally restarted when it exits,
101
+ # without regard to its exit code.
102
+ #
103
+ # Note: autorestart controls whether supervisord will autorestart a program if it exits after it has successfully
104
+ # started up (the process is in the RUNNING state). supervisord has a different restart mechanism for when the
105
+ # process is starting up (the process is in the STARTING state). Retries during process startup are controlled by
106
+ # startsecs and startretries.
41
107
  auto_restart: str = 'unexpected'
42
108
 
109
+ # The total number of seconds which the program needs to stay running after a startup to consider the start
110
+ # successful (moving the process from the STARTING state to the RUNNING state). Set to 0 to indicate that the
111
+ # program needn't stay running for any particular amount of time.
112
+ #
113
+ # Note: Even if a process exits with an “expected” exit code (see exitcodes), the start will still be considered a
114
+ # failure if the process exits quicker than startsecs.
43
115
  start_secs: int = 1
116
+
117
+ # The number of serial failure attempts that supervisord will allow when attempting to start the program before
118
+ # giving up and putting the process into an FATAL state.
119
+ #
120
+ # Note: After each failed restart, process will be put in BACKOFF state and each retry attempt will take
121
+ # increasingly more time.
44
122
  start_retries: int = 3
45
123
 
46
- num_procs: int = 1
47
- num_procs_start: int = 0
124
+ # The signal used to kill the program when a stop is requested. This can be specified using the signal's name or its
125
+ # number. It is normally one of: TERM, HUP, INT, QUIT, KILL, USR1, or USR2.
126
+ stop_signal: int = signal.SIGTERM
127
+
128
+ # The number of seconds to wait for the OS to return a SIGCHLD to supervisord after the program has been sent a
129
+ # stopsignal. If this number of seconds elapses before supervisord receives a SIGCHLD from the process, supervisord
130
+ # will attempt to kill it with a final SIGKILL.
131
+ stop_wait_secs: int = 10
132
+
133
+ # If true, the flag causes supervisor to send the stop signal to the whole process group and implies killasgroup is
134
+ # true. This is useful for programs, such as Flask in debug mode, that do not propagate stop signals to their
135
+ # children, leaving them orphaned.
136
+ stop_as_group: bool = False
137
+
138
+ # If true, when resorting to send SIGKILL to the program to terminate it send it to its whole process group instead,
139
+ # taking care of its children as well, useful e.g with Python programs using multiprocessing.
140
+ kill_as_group: bool = False
141
+
142
+ # The list of “expected” exit codes for this program used with autorestart. If the autorestart parameter is set to
143
+ # unexpected, and the process exits in any other way than as a result of a supervisor stop request, supervisord will
144
+ # restart the process if it exits with an exit code that is not defined in this list.
145
+ #
146
+ # Note: In Supervisor versions prior to 4.0, the default was 0,2. In Supervisor 4.0, the default was changed to 0.
147
+ exitcodes: ta.Sequence[int] = (0,)
148
+
149
+ #
48
150
 
49
151
  @dc.dataclass(frozen=True)
50
152
  class Log:
@@ -58,18 +160,14 @@ class ProcessConfig:
58
160
  stdout: Log = Log()
59
161
  stderr: Log = Log()
60
162
 
61
- stop_signal: int = signal.SIGTERM
62
- stop_wait_secs: int = 10
63
- stop_as_group: bool = False
64
-
65
- kill_as_group: bool = False
66
-
67
- exitcodes: ta.Sequence[int] = (0,)
68
-
163
+ # If true, cause the process' stderr output to be sent back to supervisord on its stdout file descriptor (in UNIX
164
+ # shell terms, this is the equivalent of executing /the/program 2>&1).
165
+ #
166
+ # Note: Do not set redirect_stderr=true in an [eventlistener:x] section. Eventlisteners use stdout and stdin to
167
+ # communicate with supervisord. If stderr is redirected, output from stderr will interfere with the eventlistener
168
+ # protocol.
69
169
  redirect_stderr: bool = False
70
170
 
71
- environment: ta.Optional[ta.Mapping[str, str]] = None
72
-
73
171
 
74
172
  @dc.dataclass(frozen=True)
75
173
  class ProcessGroupConfig:
@@ -82,28 +180,75 @@ class ProcessGroupConfig:
82
180
 
83
181
  @dc.dataclass(frozen=True)
84
182
  class ServerConfig:
183
+ # Instruct supervisord to switch users to this UNIX user account before doing any meaningful processing. The user
184
+ # can only be switched if supervisord is started as the root user.
85
185
  user: ta.Optional[str] = None
186
+
187
+ # If true, supervisord will start in the foreground instead of daemonizing.
86
188
  nodaemon: bool = False
189
+
190
+ # The umask of the supervisord process.
87
191
  umask: int = 0o22
192
+
193
+ #
194
+
195
+ # When supervisord daemonizes, switch to this directory. This option can include the value %(here)s, which expands
196
+ # to the directory in which the supervisord configuration file was found.
88
197
  directory: ta.Optional[str] = None
89
- logfile: str = 'supervisord.log'
90
- logfile_max_bytes: int = 50 * 1024 * 1024
91
- logfile_backups: int = 10
92
- loglevel: int = logging.INFO
198
+
199
+ # The location in which supervisord keeps its pid file. This option can include the value %(here)s, which expands to
200
+ # the directory in which the supervisord configuration file was found.
93
201
  pidfile: str = 'supervisord.pid'
202
+
203
+ # The identifier string for this supervisor process, used by the RPC interface.
94
204
  identifier: str = 'supervisor'
95
- child_logdir: str = '/dev/null'
205
+
206
+ # The minimum number of file descriptors that must be available before supervisord will start successfully.
96
207
  min_fds: int = 1024
208
+ # The minimum number of process descriptors that must be available before supervisord will start successfully.
97
209
  min_procs: int = 200
210
+
211
+ # Prevent supervisord from clearing any existing AUTO child log files at startup time. Useful for debugging
98
212
  nocleanup: bool = False
213
+
214
+ # Strip all ANSI escape sequences from child log files.
99
215
  strip_ansi: bool = False
216
+
217
+ #
218
+
219
+ # The path to the activity log of the supervisord process. This option can include the value %(here)s, which expands
220
+ # to the directory in which the supervisord configuration file was found.
221
+ logfile: str = 'supervisord.log'
222
+
223
+ # The maximum number of bytes that may be consumed by the activity log file before it is rotated (suffix multipliers
224
+ # like “KB”, “MB”, and “GB” can be used in the value). Set this value to 0 to indicate an unlimited log size.
225
+ logfile_max_bytes: int = 50 * 1024 * 1024
226
+
227
+ # The number of backups to keep around resulting from activity log file rotation. If set to 0, no backups will be
228
+ # kept.
229
+ logfile_backups: int = 10
230
+
231
+ # The logging level, dictating what is written to the supervisord activity log. One of critical, error, warn, info,
232
+ # debug, trace, or blather. Note that at log level debug, the supervisord log file will record the stderr/stdout
233
+ # output of its child processes and extended info about process state changes, which is useful for debugging a
234
+ # process which isn't starting properly.
235
+ loglevel: int = logging.INFO
236
+
237
+ # The directory used for AUTO child log files. This option can include the value %(here)s, which expands to the
238
+ # directory in which the supervisord configuration file was found.
239
+ child_logdir: str = '/dev/null'
240
+
241
+ # If true and not daemonized, logs will not be directed to stdout.
100
242
  silent: bool = False
101
243
 
244
+ #
245
+
102
246
  groups: ta.Optional[ta.Sequence[ProcessGroupConfig]] = None
103
247
 
104
248
  @classmethod
105
249
  def new(
106
250
  cls,
251
+ *,
107
252
  umask: ta.Union[int, str] = 0o22,
108
253
  directory: ta.Optional[str] = None,
109
254
  logfile: str = 'supervisord.log',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev153
3
+ Version: 0.0.0.dev155
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.12
14
14
  License-File: LICENSE
15
- Requires-Dist: omdev==0.0.0.dev153
16
- Requires-Dist: omlish==0.0.0.dev153
15
+ Requires-Dist: omdev==0.0.0.dev155
16
+ Requires-Dist: omlish==0.0.0.dev155
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -29,46 +29,57 @@ ominfra/journald/messages.py,sha256=zhAQswhpSBybaBPWONCt0quenYK91HMHRkuOz38mq1E,
29
29
  ominfra/journald/tailer.py,sha256=gBVtuc8dm-H13eOYC-F5fCrJLuiC3fAC3TyVdrKhnqQ,33516
30
30
  ominfra/manage/__init__.py,sha256=aykrEASTHEtJ-o97jUHRIv8oea41tO7RDHB56cQfmis,265
31
31
  ominfra/manage/__main__.py,sha256=5IeIERm-371fSI5ZvPv8eldAJBwgKwpR0R49pTsILNM,76
32
- ominfra/manage/bootstrap.py,sha256=sEWjTk6PDZOH4R5pQ9QJ_fkK7r5n8j-IRVZ4JAHD-W4,330
33
- ominfra/manage/bootstrap_.py,sha256=EGp5pK6td-Hj8i7PKdj024K8WY7rZw1voI8Wy0cYKB4,557
32
+ ominfra/manage/bootstrap.py,sha256=1RIRhVkUZjxZcZerHMg8U6xgWhhemGgPN5cDye8dQ68,446
33
+ ominfra/manage/bootstrap_.py,sha256=CYO8HfuVsw02PiVMMnyabL5jqJhexeP0b5mWz8eOtoA,652
34
34
  ominfra/manage/config.py,sha256=1y2N_8nXHBZc6YbW6BaRZoDDCTBmiHuWtTOQ7zdr5VE,184
35
- ominfra/manage/inject.py,sha256=8OSQRHAZClIrg14AtrElBlmBFFuEK64a1BZ8yYUNtG0,1585
36
- ominfra/manage/main.py,sha256=ccMRt6tp7s9k9Ov36vhAQskhy4WcODimSiUOtLk6oCg,3914
35
+ ominfra/manage/inject.py,sha256=_FVaMZUBKi-oObv14H77luWYCodxNJJD1t4pNQzckFE,2030
36
+ ominfra/manage/main.py,sha256=LrjcdTLUtbEho_LNwQ9JBK2BfE5IZuUF-wSHXujiiuY,3489
37
37
  ominfra/manage/marshal.py,sha256=WKj7IU9bo4fBMSSzT6ZMm_WFalXIJZ-V7j8oi92fNhk,305
38
38
  ominfra/manage/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  ominfra/manage/commands/base.py,sha256=LtaI0AgnplttQK7gNncNItq8yuTZQimJTaprVpZktI8,3993
40
- ominfra/manage/commands/execution.py,sha256=BJyAIOJx7dG8x4T75vIMpE_hEJCPPnfIkebXpQulSNE,618
41
- ominfra/manage/commands/inject.py,sha256=yyIR0qQaXw_BXEnl8vZZiVkfilZNyyHHbJ44AHTMUi4,3553
42
- ominfra/manage/commands/interp.py,sha256=OKkenH8YKEW_mEDR6X7_ZLxK9a1Ox6KHSwFPTHT6OzA,1029
40
+ ominfra/manage/commands/inject.py,sha256=uRw6DsllEoL6GDy0dZJdu2z9tf6I7l3YObMli-qIuIo,3426
41
+ ominfra/manage/commands/local.py,sha256=DyHIsQ03_YS6kAA8WLeMyXyGgyizkd1WZUZdATkSsZE,532
43
42
  ominfra/manage/commands/marshal.py,sha256=4DSCMPzRiRhufIB_9DPL6LrZkRZOle5ruOWU4MVlcXM,694
43
+ ominfra/manage/commands/ping.py,sha256=DVZFzL1Z_f-Bq53vxMrL3xOi0iK_nMonJE4KvQf9wsI,546
44
44
  ominfra/manage/commands/subprocess.py,sha256=J0w7WbcTNcyz6IepslkYu_UARUHFGqE-hSW2rpTaEgM,2529
45
+ ominfra/manage/commands/types.py,sha256=XFZPeqeIBAaIIQF3pdPbGxLlb-LCrz6WtlDWO2q_vz0,210
45
46
  ominfra/manage/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
+ ominfra/manage/deploy/apps.py,sha256=i0iB7vVjnsMRahlKn3nTIComQGtYEEWe2twTpRO43Mg,1747
46
48
  ominfra/manage/deploy/commands.py,sha256=YZGdpiaqj_-iMp2SMdz4hB6bTKk3UQxnHeTblGyxuuk,560
47
- ominfra/manage/deploy/inject.py,sha256=5Mi3HmNdLSc2NsTJsa0z0fHzQ9W1eTUVzRD3-t9Sd_8,501
48
- ominfra/manage/deploy/paths.py,sha256=Ad7OGERMqGUWO-0os1PXSO3sh9uGqrxxlEyT_3fYkac,3703
49
+ ominfra/manage/deploy/config.py,sha256=xBBaeDXmM6omkJHJLMbieKD3wNaxSY1KAaXDiseX7Dk,161
50
+ ominfra/manage/deploy/git.py,sha256=EC4bVVGkpp4249d6dUok6twPv88RzdZdSrVhIJ3tnP4,3820
51
+ ominfra/manage/deploy/inject.py,sha256=0_dBxMsyRYC9VH26Ue9k176IU22t9hWDmw101uIHyNE,1218
52
+ ominfra/manage/deploy/interp.py,sha256=OKkenH8YKEW_mEDR6X7_ZLxK9a1Ox6KHSwFPTHT6OzA,1029
53
+ ominfra/manage/deploy/paths.py,sha256=QZgeqESogfOw02cswGx-UcAwku-iklSjB46xaoDWJxo,5731
54
+ ominfra/manage/deploy/types.py,sha256=zW1nwi_wlBB6ekTmR3udnO2OW-p9JToyh3R27rzNEX8,264
55
+ ominfra/manage/deploy/venvs.py,sha256=o_gNcXcBmBT5qP148FKHIY1vfnXfK4aykz-X8IAFvoM,1766
49
56
  ominfra/manage/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- ominfra/manage/remote/_main.py,sha256=4BAMcbDaNBwhGO3Y5iDgvWk7xMnFooALsF-EbIXO0MI,4360
57
+ ominfra/manage/remote/_main.py,sha256=p5KoiS2WMw6QAqlDl_Zun-JybmCsy8awIfpBMLBjGMY,4356
51
58
  ominfra/manage/remote/channel.py,sha256=36xR9Ti9ZA8TUBtxmY0u7_3Lv7E6wzQTxlZl7gLR5GE,2224
52
- ominfra/manage/remote/config.py,sha256=uazjAYAXyiYOu-i0bxFwQT_hfZPluHHTXbQ5bUYDfvY,523
53
- ominfra/manage/remote/connection.py,sha256=yIx5eAwX-9dHHTCCVH5uaZiUeJHKVJlJ98_AhJMfgV0,4193
54
- ominfra/manage/remote/execution.py,sha256=5A12u02LIAs2FitaYGPrNDaVmbwaGCKH-aq3SVBaLHE,11730
55
- ominfra/manage/remote/inject.py,sha256=A-TwAIbMzs270_zCpngNU1JRsJc42OdbnP55azD4Nvs,1450
59
+ ominfra/manage/remote/config.py,sha256=zRIC7Yhh3FMfoIgyqlbDTwpL_jS23lhQXjGB2_YG4Eg,473
60
+ ominfra/manage/remote/connection.py,sha256=T4fL-GXXAfnbCbkZ3_28t8LAwwki4Td3j41eY_2qKYA,3795
61
+ ominfra/manage/remote/execution.py,sha256=_bygZi_0Uel615uIg43S14CTdmv1unEIu9TPz2mVRJ4,11738
62
+ ominfra/manage/remote/inject.py,sha256=nSNP_VInCCZOWVrUIRHBvLmnM45geFoYmMh-zqc__as,1080
56
63
  ominfra/manage/remote/payload.py,sha256=Rn-Yo26POpHEOOfUHX3jWkqcQVEAvkJ_5Bu13jwoob4,944
57
64
  ominfra/manage/remote/spawning.py,sha256=bL87ted_lLwLW6DhrYPaXLRaIq7f6VYg_u2LJoMEpoE,3205
58
65
  ominfra/manage/system/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
- ominfra/manage/system/commands.py,sha256=1jzpDdQFiOQ7iXY8c6ooBxG3xT3ZjRmOLlvFIereeqc,670
60
- ominfra/manage/system/config.py,sha256=sxjJ5dV_x1Ax2tyHvL7KaJYPaDFt9MTORFKdVXb7Y_I,158
61
- ominfra/manage/system/inject.py,sha256=Q28oFEf6wAGkm-iU521NXp9dvD_0vE5YTQjNBa-AK5I,1412
62
- ominfra/manage/system/packages.py,sha256=SjAtPBXxtYhS38YTenEOdzuSHEt_sK_zG0FCEYgpNbI,3654
63
- ominfra/manage/system/types.py,sha256=wLe-HgJ6pHZyueA0gbFNlHVzk5A5T02-O5zD65A65iQ,99
66
+ ominfra/manage/system/commands.py,sha256=XrYvsxiwTJh17buIWmoFGH8zTUIXmrXvYkLy1INtmkU,1173
67
+ ominfra/manage/system/config.py,sha256=mEVBL1cy4twO6F0bdnCI01Sm0xuLe1Z5eiAzCvbmoAc,196
68
+ ominfra/manage/system/inject.py,sha256=Ksc7Xw_Yh3lWwkTRxB2JCeOYO-nMyKj-Kssd1RDkR9g,1871
69
+ ominfra/manage/system/packages.py,sha256=D8NwkaWNXFhhEC1GFPU6dEr747-JmPwFRrF8t0aEs7E,4742
70
+ ominfra/manage/system/platforms.py,sha256=F0bgYzUzCjZ2LbWVvnEq2ya_X_LfRW406LQYFL7bG44,1202
71
+ ominfra/manage/targets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
+ ominfra/manage/targets/connection.py,sha256=j2QrVS-QFOZJ47TqwaMt8MSPg0whokysGePagjJg3Jg,4637
73
+ ominfra/manage/targets/inject.py,sha256=P4597xWM-V3I_gCt2O71OLhYQkkXtuJvkYRsIbhhMcE,1561
74
+ ominfra/manage/targets/targets.py,sha256=CFl8Uirgn3gfowO1Fn-LBK-6qYqEMFJ9snPUl0gCRuM,1753
64
75
  ominfra/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
- ominfra/scripts/journald2aws.py,sha256=jLXI4iuMN1uRtRgCeyyczjwRl1pxKEgfbz1q8CJoUjc,149453
66
- ominfra/scripts/manage.py,sha256=2v-2iIZqSVixsAvj7569_kmhwG14xVVu-9BVur1soh8,206140
67
- ominfra/scripts/supervisor.py,sha256=uPzXIfstv1J-LhDCKLx70RMUBQVA0zMkd7h4X18SAzQ,262206
76
+ ominfra/scripts/journald2aws.py,sha256=yG6WcDvQ0kGF9NCuO5nSI4oNvCHjNFqWS2RqWQJcwUk,149962
77
+ ominfra/scripts/manage.py,sha256=me9sLFSNh968xe92z3eKyH-TipNlnAJ-Oasj0HU5WCA,249347
78
+ ominfra/scripts/supervisor.py,sha256=PrRSYhPe8K6sOAmmF7-LNvCHsSBIizWDkV_GIsPL2vE,272399
68
79
  ominfra/supervisor/LICENSE.txt,sha256=yvqaMNsDhWxziHa9ien6qCW1SkZv-DQlAg96XjfSee8,1746
69
80
  ominfra/supervisor/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
70
81
  ominfra/supervisor/__main__.py,sha256=I0yFw-C08OOiZ3BF6lF1Oiv789EQXu-_j6whDhQUTEA,66
71
- ominfra/supervisor/configs.py,sha256=OPtiL5_SjBYQ9xDqMgZvjoXgpleTxv4d3C4fD1X2Dz0,3966
82
+ ominfra/supervisor/configs.py,sha256=SFn1_Cm48fqmjYsFCEx_-fvrnOXHPTIXgcRhHtUz7q8,13650
72
83
  ominfra/supervisor/dispatchers.py,sha256=zXLwQS4Vc6dWw5o9QOL04UMDt7w6CKu9wf19CjUiS2Q,1005
73
84
  ominfra/supervisor/dispatchersimpl.py,sha256=q3dEyOHWTPKm28nmAGisjgIW1BX6O3-SzbYa7nWuTEs,11349
74
85
  ominfra/supervisor/events.py,sha256=XGrtzHr1xm0dwjz329fn9eR0_Ap-LQL6Sk8LJ8eVDEo,6692
@@ -106,9 +117,9 @@ ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
106
117
  ominfra/tailscale/cli.py,sha256=h6akQJMl0KuWLHS7Ur6WcBZ2JwF0DJQhsPTnFBdGyNk,3571
107
118
  ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
119
  ominfra/tools/listresources.py,sha256=4qVg5txsb10EHhvqXXeM6gJ2jx9LbroEnPydDv1uXs0,6176
109
- ominfra-0.0.0.dev153.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
110
- ominfra-0.0.0.dev153.dist-info/METADATA,sha256=-qesY8Ito2ym0-ReRfbusxWegRC7rJmqT4oHlJrWlzg,731
111
- ominfra-0.0.0.dev153.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
112
- ominfra-0.0.0.dev153.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
113
- ominfra-0.0.0.dev153.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
114
- ominfra-0.0.0.dev153.dist-info/RECORD,,
120
+ ominfra-0.0.0.dev155.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
121
+ ominfra-0.0.0.dev155.dist-info/METADATA,sha256=dCTX8CH74yRDruk1XL4SxuS6W1Okdr0nc5v08s9Suvw,731
122
+ ominfra-0.0.0.dev155.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
123
+ ominfra-0.0.0.dev155.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
124
+ ominfra-0.0.0.dev155.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
125
+ ominfra-0.0.0.dev155.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- # ruff: noqa: UP006 UP007
2
- import typing as ta
3
-
4
-
5
- SystemPlatform = ta.NewType('SystemPlatform', str)
File without changes