diff --git a/bin/cylc-documentation b/bin/cylc-documentation index 86474566c58..114adf87c96 100755 --- a/bin/cylc-documentation +++ b/bin/cylc-documentation @@ -25,8 +25,8 @@ View documentation in browser or PDF viewer, as per Cylc global config. % cylc doc [-t TASK] SUITE View suite or task documentation, if URLs are specified in the suite. This -parses the suite definition to extract the requested URL. Note that running -suite daemons also hold suite URLs for access from the Cylc GUI. +parses the suite definition to extract the requested URL. Note that suite +server programs also hold suite URLs for access from the Cylc GUI. Arguments: [TARGET] File, URL, or suite name""" diff --git a/bin/cylc-ext-trigger b/bin/cylc-ext-trigger index 360f520294c..a76e7c185d3 100755 --- a/bin/cylc-ext-trigger +++ b/bin/cylc-ext-trigger @@ -18,8 +18,8 @@ """cylc [control] ext-trigger [OPTIONS] ARGS -Report an external event message to a suite daemon. It is expected that a -task in the suite has registered the same message as an external trigger - a +Report an external event message to a suite server program. It is expected that +a task in the suite has registered the same message as an external trigger - a special prerequisite to be satisifed by an external system, via this command, rather than by triggering off other tasks. diff --git a/bin/cylc-help b/bin/cylc-help index 6a2be30ab64..b9534567a41 100755 --- a/bin/cylc-help +++ b/bin/cylc-help @@ -388,8 +388,9 @@ comsum['monitor'] = 'An in-terminal suite monitor (see also gcylc)' comsum['get-suite-config'] = 'Print suite configuration items' comsum['get-site-config'] = 'Print site/user configuration items' comsum['get-gui-config'] = 'Print gcylc configuration items' -comsum['get-suite-contact'] = 'Print the contact information of a suite daemon' -comsum['get-suite-version'] = 'Print the cylc version of a suite daemon' +comsum['get-suite-contact'] = ( + 'Print contact information of a suite server program') +comsum['get-suite-version'] = 'Print cylc version of a suite server program' comsum['version'] = 'Print the cylc release version' comsum['gscan'] = 'Scan GUI for monitoring multiple suites' comsum['gpanel'] = 'Internal interface for GNOME 2 panel applet' diff --git a/bin/cylc-message b/bin/cylc-message index 338477d1b2b..e1db24e5741 100755 --- a/bin/cylc-message +++ b/bin/cylc-message @@ -19,7 +19,7 @@ This command is used by task jobs to automatically report success and failure. -It can also be used to send info-, warning-, or critical-priority messages +It can also be used to send info-, warning-, or critical-severity messages back, and to report registered task "message outputs" completed. Note: to abort a job script with a custom error message, use cylc__job_abort: @@ -39,17 +39,18 @@ def main(): parser = OptionParser(__doc__) parser.add_option( - "-p", "--priority", metavar="PRIORITY", type="choice", + "-s", "--severity", "-p", "--priority", + metavar="SEVERITY", type="choice", choices=['NORMAL', 'WARNING', 'CRITICAL', 'CUSTOM'], - help="message priority: NORMAL, WARNING, or CRITICAL; default NORMAL.", - action="store", dest="priority", default="NORMAL") + help="message severity: NORMAL (default), WARNING, CRITICAL or CUSTOM", + action="store", dest="severity", default="NORMAL") parser.add_option( "--env", help="Override environment variables", action="append", default=[], dest="env") parser.add_option( - "-v", "--verbose", help="Verbose output mode.", action="store_true", + "-v", "--verbose", help="Verbose output mode", action="store_true", default=False, dest="verbose") options, args = parser.parse_args() @@ -59,7 +60,7 @@ def main(): for item in options.env: key, value = item.split('=', 1) os.environ[key] = value - task_message = TaskMessage(priority=options.priority) + task_message = TaskMessage(severity=options.severity) if (task_message.env_map.get('CYLC_VERBOSE') in ["True", "true"] or options.verbose): cylc.flags.verbose = True diff --git a/bin/cylc-set-verbosity b/bin/cylc-set-verbosity index d3372f756bb..3471b78a397 100755 --- a/bin/cylc-set-verbosity +++ b/bin/cylc-set-verbosity @@ -18,8 +18,8 @@ """cylc [control] set-verbosity [OPTIONS] ARGS -Change the logging priority level of a running suite. Only messages at -or above the chosen priority level will be logged; for example, if you +Change the logging severity level of a running suite. Only messages at +or above the chosen severity level will be logged; for example, if you choose WARNING, only warnings and critical messages will be logged.""" from logging import CRITICAL, ERROR, WARNING, INFO, DEBUG @@ -57,20 +57,20 @@ def main(): (options, args) = parser.parse_args() suite = args[0] - priority_str = args[1] + severity_str = args[1] try: - priority = LOGGING_LVL_OF[priority_str] + severity = LOGGING_LVL_OF[severity_str] except KeyError: - parser.error("Illegal logging level, %s" % priority) + parser.error("Illegal logging level, %s" % severity) - prompt("Set logging level to %s in %s" % (priority_str, suite), + prompt("Set logging level to %s in %s" % (severity_str, suite), options.force) pclient = SuiteRuntimeServiceClient( suite, options.owner, options.host, options.port, options.comms_timeout, my_uuid=options.set_uuid, print_uuid=options.print_uuid) - pclient.put_command('set_verbosity', level=priority) + pclient.put_command('set_verbosity', level=severity) if __name__ == "__main__": diff --git a/bin/cylc-show b/bin/cylc-show index 49fd48246d1..e770e6dd5fb 100755 --- a/bin/cylc-show +++ b/bin/cylc-show @@ -18,8 +18,8 @@ """cylc [info] show [OPTIONS] ARGS -Interrogate a suite daemon for the suite title and description; or for the -title and description of one of its tasks; or for the current state of the +Interrogate a suite server program for the suite title and description; or for +the title and description of one of its tasks; or for the current state of the prerequisites, outputs, and clock-triggering of a specific task instance.""" import sys diff --git a/bin/cylc-stop b/bin/cylc-stop index 73e52651766..fc35d6f652e 100755 --- a/bin/cylc-stop +++ b/bin/cylc-stop @@ -18,7 +18,7 @@ """cylc [control] stop|shutdown [OPTIONS] ARGS -Tell a running suite daemon to shut down. In order to prevent failures going +Tell a suite server program to shut down. In order to prevent failures going unnoticed, suites only shut down automatically at a final cycle point if no failed tasks are present. There are several shutdown methods: diff --git a/bin/cylc-trigger b/bin/cylc-trigger index 3a25716e50d..9f972acbd53 100755 --- a/bin/cylc-trigger +++ b/bin/cylc-trigger @@ -97,8 +97,8 @@ def main(): if not success: sys.exit('ERROR: %s' % msg) - # Get the job filename from the suite daemon - the task cycle point may - # need standardising to the suite cycle point format. + # Get the job filename from the suite server program - the task cycle + # point may need standardising to the suite cycle point format. jobfile_path = pclient.get_info( 'get_task_jobfile_path', task_id=task_id) if not jobfile_path: @@ -115,7 +115,7 @@ def main(): except OSError: old_mtime = None - # Tell the suite daemon to generate the job file. + # Tell the suite server program to generate the job file. pclient.put_command('dry_run_tasks', items=[task_id]) # Wait for the new job file to be written. Use mtime because the same diff --git a/bin/cylc-version b/bin/cylc-version index 9890cba0a42..099719ffdd3 100755 --- a/bin/cylc-version +++ b/bin/cylc-version @@ -24,7 +24,7 @@ Note that "cylc -v,--version" just prints the version string from the main command interface, whereas this is a proper cylc command that can take the standard --host and --user options, etc. -For the cylc version of running a suite daemon see +For the cylc version of running a suite server program, see "cylc get-suite-version".""" import sys diff --git a/doc/src/cylc-user-guide/cug.tex b/doc/src/cylc-user-guide/cug.tex index 96350301830..3531b333916 100644 --- a/doc/src/cylc-user-guide/cug.tex +++ b/doc/src/cylc-user-guide/cug.tex @@ -459,7 +459,7 @@ \subsection{Software Bundled With Cylc} \begin{myitemize} \item {\bf cherrypy 6.0.2} (slightly modified): a pure Python HTTP framework that we use as a web server for communication between server processes - (suite daemons) and client programs (running tasks, GUIs, CLI commands). + (suite server programs) and client programs (running tasks, GUIs, CLI commands). Client communication is via the Python {\bf requests} library if available (recommended) or else pure Python via {\bf urllib2}. \newline \url{http://www.cherrypy.org/} @@ -494,8 +494,8 @@ \subsection{Installing Cylc} wrapper will attempt to invoke the Cylc version specified in \lstinline@$CYLC_VERSION@, e.g.\ \lstinline@CYLC_VERSION=7.4.0@. This variable is automatically set in task job scripts to ensure that jobs use the same Cylc -version as their parent suite daemon. It can also be set by users, manually or -in login scripts, to fix the Cylc version in their environment. +version as their parent suite server program. It can also be set by users, +manually or in login scripts, to fix the Cylc version in their environment. Installing subsequent releases is just a matter of unpacking the new tarballs next to the previous releases, running \lstinline=make= in them, and copying @@ -795,7 +795,8 @@ \subsection{Suite Passphrases} Registration (above) also generates a suite-specific passphrase file under \lstinline=.service/= in the suite run directory. It is loaded by the suite -daemon at start-up and used to authenticate connections from client programs. +server program at start-up and used to authenticate connections from client +programs. Possession of a suite's passphrase file gives full control over it. Without it, the information avaiable to a client is determined by the suite's @@ -917,8 +918,8 @@ \subsubsection{CLI} Run \lstinline=tut/oneoff/basic= using the \lstinline=cylc run= command. As a suite runs detailed timestamped information is written to a {\em suite log} and progress can be followed with cylc's suite monitoring tools (below). -By default a running suite daemonizes after printing a short message so that -you can exit the terminal or even log out without killing the suite: +By default a suite server program daemonizes after printing a short message so +that you can exit the terminal or even log out without killing the suite: \lstset{language=transcript} \begin{lstlisting} @@ -934,13 +935,13 @@ \subsubsection{CLI} *** listening on nwp-1:43027 *** -To view suite daemon contact information: +To view suite server program contact information: $ cylc get-suite-contact tut/oneoff/basic Other ways to see if the suite is still running: $ cylc scan -n '\btut/oneoff/basic\b' nwp-1 $ cylc ping -v --host=nwp-1 tut/oneoff/basic - $ ssh nwp-1 "pgrep -a -P 1 -fu $USER 'cylc-r.* \btut/oneoff/basic\b'" + $ ps h -opid,args 123456 # on nwp-1 \end{lstlisting} @@ -1021,7 +1022,7 @@ \subsection{Job Submission: How Tasks Are Executed} Task {\em job scripts} are generated by cylc to wrap the task implementation specified in the suite definition (environment, script, etc.) in error trapping code, messaging calls to report task progress back to the suite -daemon, and so forth. Job scripts are written to the {\em suite job log +server program, and so forth. Job scripts are written to the {\em suite job log directory} where they can be viewed alongside the job output logs. They can be accessed at run time by right-clicking on the task in the cylc GUI, or printed to the terminal: @@ -1105,10 +1106,10 @@ \subsection{Locating Suite And Task Output} | | | |-- job.out # task stdout log | | | `-- job.status # task status file | | `-- NN -> 01 # symlink to latest submission number -| `-- suite # suite daemon log directory -| |-- err # suite daemon stderr log (daemon mode only) -| |-- out # suite daemon stdout log (damon mode only) -| `-- log # suite daemon event log (timestamped info) +| `-- suite # suite server log directory +| |-- err # suite server stderr log (daemon mode only) +| |-- out # suite server stdout log (daemon mode only) +| `-- log # suite server event log (timestamped info) \end{lstlisting} The suite run database files, suite environment file, and task status files are used internally by cylc. Tasks execute in @@ -3739,9 +3740,9 @@ \subsubsection{Trigger Types} suite, and an ID that distinguishes this particular event instance from others (the name of the target task or its current cycle point is not required). The event ID is just an arbitary string to cylc, but it typically identifies the -filename(s) of the latest dataset in some way. When the suite daemon receives -the external event notification it will trigger the next instance of any task -waiting on that trigger (whatever its cycle point) and then broadcast +filename(s) of the latest dataset in some way. When the suite server program +receives the external event notification it will trigger the next instance of +any task waiting on that trigger (whatever its cycle point) and then broadcast (see~\ref{cylc-broadcast}) the event ID to the cycle point of the triggered task as \lstinline=$CYLC_EXT_TRIGGER_ID=. Downstream tasks with the same cycle point therefore know the new event ID too and can use it, if they need to, to @@ -4002,7 +4003,7 @@ \subsubsection{Namespace Names} Note that {\em task names need not be hardwired into task implementations} because task and suite identity can be extracted portably from the task -execution environment supplied by the suite daemon +execution environment supplied by the suite server program (\ref{TaskExecutionEnvironment}) - then to rename a task you can just change its name in the suite definition. @@ -4120,8 +4121,8 @@ \subsubsection{How Runtime Inheritance Works} \subsubsection{Task Execution Environment} \label{TaskExecutionEnvironment} -The task execution environment contains suite and task identity -variables provided by the suite daemon, and user-defined environment variables. +The task execution environment contains suite and task identity variables +provided by the suite server program, and user-defined environment variables. The environment is explicitly exported (by the task job script) prior to executing the task \lstinline=script= (see~\ref{TaskJobSubmission}). @@ -5405,37 +5406,37 @@ \subsection{Inlined Tasks} \subsection{Task Messages} -Tasks messages can be sent back to the suite daemon to report completed -outputs and arbitrary messages of different priority levels. +Tasks messages can be sent back to the suite server program to report completed +outputs and arbitrary messages of different severity levels. Some types of message - in addition to events like task failure - can -optionally trigger execution of event handlers in the suite daemon +optionally trigger execution of event handlers in the suite server program (see~\ref{EventHandling}). -Normal priority messages are printed to \lstinline=job.out= and logged by the -suite daemon: +Normal severity messages are printed to \lstinline=job.out= and logged by the +suite server program: \lstset{language=bash} \begin{lstlisting} cylc message "Hello from ${CYLC_TASK_ID}" \end{lstlisting} -CUSTOM priority messages are printed to \lstinline=job.out=, logged by the -suite daemon, and can be used to trigger {\em custom} event handlers: +CUSTOM severity messages are printed to \lstinline=job.out=, logged by the +suite server program, and can be used to trigger {\em custom} event handlers: \lstset{language=bash} \begin{lstlisting} cylc message -p CUSTOM "data available for ${CYLC_TASK_CYCLE_POINT}" \end{lstlisting} Task output messages, used for triggering other tasks, can also be sent with -custom priority if need be +custom severity if need be -WARNING priority messages are printed to \lstinline=job.err=, logged by the -suite daemon, and can be passed to {\em warning} event handlers: +WARNING severity messages are printed to \lstinline=job.err=, logged by the +suite server program, and can be passed to {\em warning} event handlers: \begin{lstlisting} cylc message -p WARNING "Uh-oh, something's not right here." \end{lstlisting} -CRITICAL priority messages are printed to \lstinline=job.err=, logged by the -suite daemon, and can be passed to {\em critical} event handlers: +CRITICAL severity messages are printed to \lstinline=job.err=, logged by the +suite server program, and can be passed to {\em critical} event handlers: \begin{lstlisting} cylc message -p CRITICAL "ERROR occurred in process X!" \end{lstlisting} @@ -5444,9 +5445,9 @@ \subsection{Aborting Job Scripts on Error} Task job scripts use \lstinline=set -x= to abort on any error, and trap ERR, EXIT, and SIGTERM to send task failed messages back to the -suite daemon before aborting. Other scripts called from job scripts should -therefore abort with standard non-zero exit status on error, to -trigger the job script error trap. +suite server program before aborting. Other scripts called from job scripts +should therefore abort with standard non-zero exit status on error, to trigger +the job script error trap. To prevent a command that is expected to generate a non-zero exit status from triggering the exit trap, protect it with a control statement such as: @@ -5469,8 +5470,8 @@ \subsubsection{Custom Failure Messages} Critical events normally warrant aborting a job script rather than just sending a message. As described just above, \lstinline=exit 1= or any failing command not protected by the surrounding scripting will cause a job script to abort and -report failure to the suite daemon, potentially triggering a {\em failed} task -event handler. +report failure to the suite server program, potentially triggering a +{\em failed} task event handler. For failures detected by the scripting you could send a critical message back before aborting, potentially triggering a {\em critical} task event handler: @@ -5528,8 +5529,8 @@ \section{Task Job Submission and Management} For the requirements a command, script, or program, must fulfill in order to function as a cylc task, see~\ref{TaskImplementation}. -This section explains how tasks are submitted by the suite daemon when they are -ready to run, and how to define new batch system handlers. +This section explains how tasks are submitted by the suite server program when +they are ready to run, and how to define new batch system handlers. When a task is ready cylc generates a job script (see~\ref{JobScripts}). The job script is submitted to run by the {\em batch system} chosen for @@ -5901,8 +5902,8 @@ \subsection{Overriding The Job Submission Command} \subsection{Job Polling} -For supported batch systems, one-way polling can be used to determine -actual job status: the suite daemon executes a process on the task host, by +For supported batch systems, one-way polling can be used to determine actual +job status: the suite server program executes a process on the task host, by non-interactive ssh, to interrogate the batch queueing system there, and to read a {\em status file} that is automatically generated by the task job script as it runs. @@ -5954,7 +5955,7 @@ \subsection{Job Polling} \subsection{Job Killing} -For supported batch systems, the suite daemon can execute a process on +For supported batch systems, the suite server program can execute a process on the task host, by non-interactive ssh, to kill a submitted or running job according to its batch system. @@ -6141,11 +6142,11 @@ \subsubsection{Warm Start} \subsubsection{Restart and Suite State Checkpoints} \label{RestartingSuites} -At restart (see \lstinline=cylc restart --help=) a suite daemon initializes its -task pool from a previously recorded checkpoint state. By default the latest -automatic checkpoint - which is updated with every task state change - is -loaded so that the suite can carry on exactly as it was just before being shut -down or killed. +At restart (see \lstinline=cylc restart --help=) a suite server program +initializes its task pool from a previously recorded checkpoint state. By +default the latest automatic checkpoint - which is updated with every task +state change - is loaded so that the suite can carry on exactly as it was just +before being shut down or killed. \lstset{language=transcript} \begin{lstlisting} @@ -6169,9 +6170,10 @@ \subsubsection{Restart and Suite State Checkpoints} \paragraph{Restart From Another Checkpoint} -Suite daemons automatically update the ``latest'' checkpoint every time a task -changes state, and at every suite restart, but you can also take checkpoints -at other times. To tell a suite daemon to checkpoint its current state: +Suite server programs automatically update the ``latest'' checkpoint every time +a task changes state, and at every suite restart, but you can also take +checkpoints at other times. To tell a suite server program to checkpoint its +current state: \lstset{language=transcript} \begin{lstlisting} $ cylc checkpoint SUITE-NAME CHECKPOINT-NAME @@ -6249,11 +6251,11 @@ \subsubsection{Restart and Suite State Checkpoints} Note that we need to \lstinline=wait= on the ``task started'' message - which is sent in the background to avoid holding tasks up in a network outage - to ensure that the checkpointer task is correctly recorded as running in the -checkpoint (at restart the suite daemon will poll to determine that that task -job finished successfully). Otherwise it may be recorded in the waiting state -and, if its upstream dependencies have already been cleaned up, it will need to -be manually reset from waiting to succeeded after the restart to avoid stalling -the suite. +checkpoint (at restart the suite server program will poll to determine that +that task job finished successfully). Otherwise it may be recorded in the +waiting state and, if its upstream dependencies have already been cleaned up, +it will need to be manually reset from waiting to succeeded after the restart +to avoid stalling the suite. \paragraph{Behaviour of Tasks on Restart} @@ -6279,7 +6281,7 @@ \subsubsection{Restart and Suite State Checkpoints} \subsection{Reloading The Suite Definition At Runtime} -The \lstinline=cylc reload= command tells a suite daemon to reload its +The \lstinline=cylc reload= command tells a suite server program to reload its suite definition at run time. This is an alternative to shutting a suite down and restarting it after making changes. @@ -6302,7 +6304,7 @@ \subsection{Task Job Access To Cylc} installed side-by-side and invoked via the central Cylc wrapper according to the value of \lstinline=$CYLC_VERSION= - see Section~\ref{InstallCylc}. Task job scripts set \lstinline=$CYLC_VERSION= to the version of the parent suite -daemon, so that the right Cylc will be invoked by jobs on the job host. +server program, so that the right Cylc will be invoked by jobs on the job host. Access to the Cylc executable (preferably the central wrapper as just described) for different job hosts can be configured using site and user @@ -6321,29 +6323,29 @@ \subsection{Task Job Access To Cylc} \subsection{The Suite Contact File} \label{The Suite Contact File} -At start-up, suite daemons write a {\em suite contact file} +At start-up, suite server programs write a {\em suite contact file} \lstinline=$HOME/cylc-run/SUITE/.service/contact= that records suite host, user, port number, process ID, Cylc version, and other information. Client commands can read this file, if they have access to it, to find the target -suite daemon. +suite server program. \subsection{Task Job Polling} \label{Task Job Polling} At any point after job submission task jobs can be {\em polled} to check that -their true state conforms to what is currently recorded by the suite daemon. -See \lstinline=cylc poll --help= for how to poll one or more tasks manually, or -right-click poll a task or family in GUI. +their true state conforms to what is currently recorded by the suite server +program. See \lstinline=cylc poll --help= for how to poll one or more tasks +manually, or right-click poll a task or family in GUI. Polling may be necessary if, for example, a task job gets killed by the untrappable SIGKILL signal (e.g.\ \lstinline=kill -9 PID=), or if a network outage prevents task success or failure messages getting through, or if the -suite daemon itself is down when tasks finish execution. +suite server program itself is down when tasks finish execution. -To poll a task job the suite daemon interrogates the batch system, and the +To poll a task job the suite server program interrogates the batch system, and the \lstinline=job.status= file, on the job host. This information is enough to determine the final task status even if the job finished while the suite -daemon was down or unreachable on the network. +server program was down or unreachable on the network. \subsubsection{Routine Polling} @@ -6363,7 +6365,7 @@ \subsection{Tracking Task State} \begin{myitemize} \item task-to-suite messaging via HTTPS \item task-to-suite messaging via non-interactive ssh to the suite host, then local HTTPS - \item regular polling by the suite daemon + \item regular polling by the suite server program \end{myitemize} These are explained in the following sections. All three can be used, on @@ -6373,7 +6375,7 @@ \subsection{Tracking Task State} to the polling method you should consider installing dedicated Cylc servers or VMs inside the HPC trust zone (where HTTPS and ssh should be allowed). -It is also possible to run Cylc suite daemons on HPC login nodes, but this is +It is also possible to run Cylc suite server programs on HPC login nodes, but this is not recommended for load, run duration, and GUI reasons. Finally, it has been suggested that {\em port forwarding} may provide another @@ -6382,14 +6384,14 @@ \subsection{Tracking Task State} \subsubsection{HTTPS Task Messaging} Task job wrappers automatically invoke \lstinline=cylc message= to report -progress back to the suite daemon when they begin executing, at normal exit +progress back to the suite server program when they begin executing, at normal exit (success) and abnormal exit (failure). By default the messaging occurs via an authenticated, HTTPS connection to the -suite daemon. This is the preferred task communications method - it is +suite server program. This is the preferred task communications method - it is efficient and direct. -Suite daemons automatically install suite contact information and credentials +Suite server programs automatically install suite contact information and credentials on job hosts. Users only need to do this manually for remote access to suites on other hosts, or suites owned by other users - see~\ref{RemoteControl}. @@ -6397,7 +6399,7 @@ \subsubsection{Ssh Task Messaging} Cylc can be configured to re-invoke task messaging commands on the suite host via non-interactive ssh (from job host to suite host). Then a local HTTPS -connection is made to the suite daemon. +connection is made to the suite server program. (User-invoked client commands (aside from the GUI, which requires HTTPS) can do the same thing with the \lstinline=--use-ssh= command option). @@ -6408,7 +6410,7 @@ \subsubsection{Ssh Task Messaging} \subsubsection{Polling to Track Job Status} \label{Polling To Track Job Status} -Finally, suite daemons can actively poll task jobs at configurable intervals, +Finally, suite server programs can actively poll task jobs at configurable intervals, via non-interactive ssh to the job host. Polling is the least efficient task communications method because task state is @@ -6518,16 +6520,16 @@ \subsection{The Suite Service Directory} At run time, the private suite run database is also written to the service directory, along with a {\em suite contact file} that records the host, user, port number, process ID, Cylc version, and other information about the -suite daemon. Client commands automatically read daemon targetting information -from the contact file, if they have access to it. +suite server program. Client commands automatically read daemon targetting +information from the contact file, if they have access to it. \subsection{File-Reading Commands} Some Cylc commands and GUI actions parse suite definitions or read other files -from the suite host account, rather than communicate with a suite daemon over -the network. In future we plan to have suite daemons serve up these files to -clients, but for the moment this functionality requires read-access to the -relevant files on the suite host. +from the suite host account, rather than communicate with a suite server +program over the network. In future we plan to have suite server program serve +up these files to clients, but for the moment this functionality requires +read-access to the relevant files on the suite host. If you are logged into the suite host account, file-reading commands will just work. @@ -6553,7 +6555,7 @@ \subsubsection{Same Host, Different User Account} \subsection{Client-Server Interaction} \label{ConnectionAuthentication} -Cylc servers (suite daemons) listen on dedicated network ports for +Cylc server programs listen on dedicated network ports for HTTPS communications from Cylc clients (task jobs, and user-invoked commands and GUIs). @@ -6561,7 +6563,7 @@ \subsection{Client-Server Interaction} scanned hosts (this lists your own suites by default, but it can show others too - see \lstinline=cylc scan --help=). -Cylc supports two kinds of access to suite daemons: +Cylc supports two kinds of access to suite server programs: \begin{myitemize} \item {\em public} (non-authenticated) - the amount of information revealed is configurable, see~\ref{PublicAccess} @@ -6573,7 +6575,7 @@ \subsubsection{Public Access - No Auth Files} \label{PublicAccess} Without a suite passphrase the amount of information revealed by a suite -daemon is determined by the public access privilege level set in global +server program is determined by the public access privilege level set in global site/user config (\ref{GlobalAuth}) and optionally overidden in suites (\ref{SuiteAuth}): \begin{myitemize} @@ -6594,18 +6596,18 @@ \subsubsection{Full Control - With Auth Files} \label{passphrases} Suite auth files (passphrase and SSL certificate) give full control. They are -loaded from the suite service directory by the suite daemon at start-up, and -used to authenticate subsequent client connections. Passphrases are used in a -secure encrypted challenge-response scheme, never sent in plain text over the -network. +loaded from the suite service directory by the suite server program at +start-up, and used to authenticate subsequent client connections. Passphrases +are used in a secure encrypted challenge-response scheme, never sent in plain +text over the network. -If two users need access to the same suite daemon, they must both possess the -passphrase file for that suite. Fine-grained access to a single suite daemon -via distinct user accounts is not currently supported. +If two users need access to the same suite server program, they must both +possess the passphrase file for that suite. Fine-grained access to a single +suite server program via distinct user accounts is not currently supported. -Suite daemons automatically install their auth and contact files to job hosts -by scp, to enable task jobs to connect back to the suite daemon for task -messaging. +Suite server programs automatically install their auth and contact files to job +hosts by scp, to enable task jobs to connect back to the suite server program +for task messaging. Client programs invoked by the suite owner automatically load the passphrase, SSL certificate, and contact file too, for automatic connection to suites. @@ -6618,7 +6620,7 @@ \subsection{GUI-to-Suite Interaction} \label{GUI-to-Suite Interaction} The gcylc GUI is mainly a network client to retrieve and display suite status -information from the suite daemon, but it can also invoke file-reading +information from the suite server program, but it can also invoke file-reading commands to view and graph the suite definition and so on. This is entirely transparent if the GUI is running on the suite host account, but full functionality for remote suites requires either a shared filesystem, or @@ -6630,9 +6632,9 @@ \subsection{GUI-to-Suite Interaction} \subsection{Remote Control} \label{RemoteControl} -Cylc client programs - command line and GUI - can interact with suite daemons -running on other accounts or hosts. How this works depends on whether or not -you have: +Cylc client programs - command line and GUI - can interact with suite server +programs running on other accounts or hosts. How this works depends on whether +or not you have: \begin{myitemize} \item a {\em shared filesystem} such that you see the same home directory on both hosts. @@ -6646,9 +6648,9 @@ \subsection{Remote Control} will automatically read the host and port from the contact file in the suite service directory. -To control suite daemons running under other user accounts or on other hosts -without a shared filesystem, the suite SSL certificate and passphrase must be -installed under your \lstinline=$HOME/.cylc/= directory: +To control suite server programs running under other user accounts or on other +hosts without a shared filesystem, the suite SSL certificate and passphrase +must be installed under your \lstinline=$HOME/.cylc/= directory: \lstset{language=transcript} \begin{lstlisting} $HOME/.cylc/auth/OWNER@HOST/SUITE/ @@ -6782,8 +6784,9 @@ \subsection{Runahead Limiting} extend out past a future trigger (see~\ref{InterCyclePointTriggers}). A high runahead limit may allow fast tasks that are not constrained by dependencies or clock-triggers to spawn far ahead of the pack, which could have -performance implications for the suite daemon when running very large suites. -Succeeded and failed tasks are ignored when computing the runahead limit. +performance implications for the suite server program when running very large +suites. Succeeded and failed tasks are ignored when computing the runahead +limit. The preferred runahead limiting mechanism restricts the number of consecutive active cycle points. The default value is three active cycle points; @@ -6892,7 +6895,7 @@ \subsection{Task Event Handling} Event handlers can be located in the suite \lstinline=bin/= directory; otherwise it is up to you to ensure their location is in \lstinline=$PATH= (in -the shell in which the suite daemon runs). They should require little +the shell in which the suite server program runs). They should require little resource and return quickly - as each event handler is invoked by a child process in a finite process pool that is also used to submit, poll and kill jobs. The child process will wait for the event handler to complete before @@ -6910,9 +6913,9 @@ \subsection{Task Event Handling} a configured delay \item `started' - the task reported commencement of execution \item `succeeded' - the task reported successful completion - \item `warning' - the task reported a WARNING priority message - \item `critical' - the task reported a CRITICAL priority message - \item `custom' - the task reported a CUSTOM priority message + \item `warning' - the task reported a WARNING severity message + \item `critical' - the task reported a CRITICAL severity message + \item `custom' - the task reported a CUSTOM severity message \item `failed' - the task failed \item `retry' - the task failed but will retry after a configured delay \item `execution timeout' - task execution timed out @@ -6949,7 +6952,7 @@ \subsection{Task Event Handling} The event handler will be called as soon as the task fails, not after the retry delay period when it is resubmitted. -{\em Note that event handlers are called by the suite daemon, not by task jobs.} +{\em Note that event handlers are called by the suite server program, not by task jobs.} If you wish to pass additional information to them use [cylc] \textrightarrow [[environment]], not task runtime environment. @@ -7370,8 +7373,8 @@ \subsection{Suite Server Logs} \subsection{Suite Run Databases} \label{Suite Run Databases} -Suite daemons maintain two \lstinline=sqlite= databases to record restart -checkpoints and various other aspects of run history: +Suite server programs maintain two \lstinline=sqlite= databases to record +restart checkpoints and various other aspects of run history: \lstset{language=transcript} \begin{lstlisting} @@ -7379,12 +7382,13 @@ \subsection{Suite Run Databases} $HOME/cylc-run/SUITE-NAME/.service/db # private suite DB \end{lstlisting} -The private DB is for use only by the suite daemon. The identical public DB is -provided for use by external commands such as \lstinline=cylc suite-state=, -\lstinline=cylc ls-checkpoints=, and \lstinline=cylc report-timings=. If the -public DB gets locked for too long by an external reader, the suite daemon -will eventually delete it and replace it with a new copy of the private DB, to -ensure that both correctly reflect the suite state. +The private DB is for use only by the suite server program. The identical +public DB is provided for use by external commands such as \lstinline=cylc +suite-state=, \lstinline=cylc ls-checkpoints=, and \lstinline=cylc +report-timings=. If the public DB gets locked for too long by an external +reader, the suite server program will eventually delete it and replace it with +a new copy of the private DB, to ensure that both correctly reflect the suite +state. You can interrogate the public DB with the \lstinline=sqlite3= command line tool, the \lstinline=sqlite3= module in the Python standard library, or any other @@ -7449,9 +7453,9 @@ \subsection{Disaster Recovery} \lstinline=rose suite-run= - which re-installs suite source files to the run directory). -The public DB is not strictly required for a restart - the suite daemon will -recreate it if need be - but it is required by \lstinline=cylc ls-checkpoints= -if you need to identify the right restart checkpoint. +The public DB is not strictly required for a restart - the suite server program +will recreate it if need be - but it is required by \lstinline=cylc +ls-checkpoints= if you need to identify the right restart checkpoint. The job status files are only needed if the restart suite state checkpoint contains active tasks that need to be polled to determine what happened to them @@ -7597,7 +7601,7 @@ \section{Cylc Development History - Major Changes} \section{Communication Method} \label{Communication} -Cylc suite daemons and clients (commands, cylc gui, task messaging) +Cylc suite server programs and clients (commands, cylc gui, task messaging) communicate via particular ports using the HTTPS protocol, secured by HTTP Digest Authentication using the suite's 20-random-character private passphrase and private SSL certificate. diff --git a/doc/src/cylc-user-guide/siterc.tex b/doc/src/cylc-user-guide/siterc.tex index 92c6886c258..8948924d3c4 100644 --- a/doc/src/cylc-user-guide/siterc.tex +++ b/doc/src/cylc-user-guide/siterc.tex @@ -570,7 +570,7 @@ \subsection{[hosts]} \paragraph[copyable environment variables]{[hosts] \textrightarrow [[HOST]] \textrightarrow copyable environment variables } A list containing the names of the environment variables that can and/or need -to be copied from the suite daemon to a job. +to be copied from the suite server program to a job. \begin{myitemize} \item {\em type:} string\_list @@ -932,8 +932,8 @@ \subsection{[cylc]} \subsection{[authentication]} \label{GlobalAuth} -Authentication of client programs with suite daemons can be configured here, and -overridden in suites if necessary (see~\ref{SuiteAuth}). +Authentication of client programs with suite server programs can be configured +here, and overridden in suites if necessary (see~\ref{SuiteAuth}). The suite-specific passphrase must be installed on a user's account to authorize full control privileges (see~\ref{tutPassphrases} diff --git a/doc/src/cylc-user-guide/suiterc.tex b/doc/src/cylc-user-guide/suiterc.tex index 0f8b2098375..9002a0cb411 100644 --- a/doc/src/cylc-user-guide/suiterc.tex +++ b/doc/src/cylc-user-guide/suiterc.tex @@ -107,8 +107,8 @@ \subsection{[cylc]} Cylc runs off the suite host's system clock by default. This item allows you to run the suite in UTC even if the system clock is set to local time. Clock-trigger tasks will trigger when the current UTC time is equal to -their cycle point date-time plus offset; other time values used, reported, -or logged by the suite daemon will usually also be in UTC. The default for +their cycle point date-time plus offset; other time values used, reported, or +logged by the suite server program will usually also be in UTC. The default for this can be set at the site level (see ~\ref{SiteUTCMode}). \begin{myitemize} @@ -246,7 +246,7 @@ \subsection{[cylc]} \subsubsection[disable automatic shutdown]{[cylc] \textrightarrow disable automatic shutdown} This has the same effect as the \lstinline{--no-auto-shutdown} flag for -the suite run commands: it prevents the suite daemon from shutting down +the suite run commands: it prevents the suite server program from shutting down normally when all tasks have finished (a suite timeout can still be used to stop the daemon after a period of inactivity, however). This option can make it easier to re-trigger tasks manually near the end of a suite run, @@ -316,7 +316,7 @@ \subsection{[cylc]} \label{SuiteEventHandling} Cylc has internal ``hooks'' to which you can attach handlers that are -called by the suite daemon whenever certain events occur. This section +called by the suite server program whenever certain events occur. This section configures suite event hooks; see~\ref{TaskEventHandling} for task event hooks. @@ -554,8 +554,8 @@ \subsection{[cylc]} \begin{myitemize} \item These variables are not passed to tasks - use task runtime variables for that. Similarly, task runtime variables are not - available to event handlers - which are executed by the suite daemon, - (not by running tasks) in response to task events. + available to event handlers - which are executed by the suite server + program, (not by running tasks) in response to task events. \item Cylc-defined environment variables such as \lstinline=$CYLC_SUITE_RUN_DIR= are not passed to task event @@ -696,7 +696,7 @@ \subsection{[cylc]} \subsubsection[{[[}authentication{]]}]{[cylc] \textrightarrow [[authentication]] } \label{SuiteAuth} -Authentication of client programs with suite daemons can be set in the +Authentication of client programs with suite server programs can be set in the global site/user config files and overridden here if necessary. See~\ref{GlobalAuth} for more information. @@ -1377,8 +1377,8 @@ \subsection{[runtime]} \subparagraph[shell]{[runtime] \textrightarrow [[\_\_NAME\_\_]] \textrightarrow [[[job]]] \textrightarrow shell} \label{JobSubShell} -Location of the command used to interpret the job script submitted by the -suite daemon when a task is ready to run. This can be set to the location of +Location of the command used to interpret the job script submitted by the suite +server program when a task is ready to run. This can be set to the location of \lstinline=bash= in the job host if the shell is not installed in the standard location. {\em Note: It has no bearing on any sub-shells that may be called by the job script.} @@ -1513,8 +1513,8 @@ \subsection{[runtime]} \subparagraph[owner]{[runtime] \textrightarrow [[\_\_NAME\_\_]] \textrightarrow [[[remote]]] \textrightarrow owner} The username of the task host account. This is (only) used in the -non-interactive ssh command invoked by the suite daemon to submit the remote task -(consequently it may be defined using local environment variables +non-interactive ssh command invoked by the suite server program to submit the +remote task (consequently it may be defined using local environment variables (i.e.\ the shell in which cylc runs, and [cylc] \textrightarrow [[environment]]). If you use dynamic host selection and have different usernames on @@ -1596,8 +1596,8 @@ \subsection{[runtime]} Event handlers can be located in the suite \lstinline=bin/= directory, otherwise it is up to you to ensure their location is in \lstinline=$PATH= (in -the shell in which the suite daemon runs). They should require little resource -to run and return quickly. +the shell in which the suite server program runs). They should require little +resource to run and return quickly. Each task event handler can be specified as a list of command lines or command line templates. They can contain any or all of the following patterns, which @@ -1660,9 +1660,9 @@ \subsection{[runtime]} \item {\bf retry} - the task failed, but cylc will resubmit it after a configured delay \item {\bf execution timeout} - the task timed out after execution commenced - \item {\bf warning} - the task reported a WARNING priority message - \item {\bf critical} - the task reported a CRITICAL priority message - \item {\bf custom} - the task reported a CUSTOM priority message + \item {\bf warning} - the task reported a WARNING severity message + \item {\bf critical} - the task reported a CRITICAL severity message + \item {\bf custom} - the task reported a CUSTOM severity message \end{myitemize} Item details: diff --git a/doc/src/suite-design-guide/general-principles.tex b/doc/src/suite-design-guide/general-principles.tex index bf8e852f429..6524ab562eb 100644 --- a/doc/src/suite-design-guide/general-principles.tex +++ b/doc/src/suite-design-guide/general-principles.tex @@ -53,8 +53,8 @@ \subsubsection{Inter-Suite Triggering} A task in one suite can explicitly trigger off of a task in another suite. The full range of possible triggering conditions is supported, including custom message triggers. Remote triggering involves repeatedly querying (``polling'') -the remote suite run database, not the suite daemon, so it works even if the -other suite is down at the time. +the remote suite run database, not the suite server program, so it works even +if the other suite is down at the time. There is special graph syntax to support triggering off of a task in another suite, or you can call the underlying \lstinline=cylc suite-state= command @@ -155,7 +155,7 @@ \subsubsection{Basic Functionality} expected location. \item Always return correct shell exit status - zero for success, non-zero for failure. This is used by Cylc job wrapper code to detect success and - failure and report it back to the suite daemon. + failure and report it back to the suite server program. \item In shell scripts use \lstinline=set -u= to abort on any reference to an undefined variable. If you really need an undefined variable to evaluate to an empty string, make it explicit: \lstinline@FOO=${FOO:-}@. diff --git a/lib/cylc/daemonize.py b/lib/cylc/daemonize.py index ecf7354d379..5511b15a360 100644 --- a/lib/cylc/daemonize.py +++ b/lib/cylc/daemonize.py @@ -26,13 +26,13 @@ SUITE_SCAN_INFO_TMPL = r""" -To view suite daemon contact information: +To view suite server program contact information: $ cylc get-suite-contact %(suite)s Other ways to see if the suite is still running: $ cylc scan -n '\b%(suite)s\b' %(host)s $ cylc ping -v --host=%(host)s %(suite)s - $ ssh %(host)s "pgrep -a -P 1 -fu $USER 'cylc-r.* \b%(suite)s\b'" + $ ps %(ps_opts)s %(pid)s # on %(host)s """ @@ -96,7 +96,7 @@ def daemonize(server): sys.stderr.write(open(log_fname).read()) sys.exit(1) except IOError: - sys.exit("Suite daemon exited") + sys.exit("Suite server program exited") except (IOError, OSError, ValueError): pass if suite_pid is None or suite_port is None: @@ -106,6 +106,7 @@ def daemonize(server): "suite": server.suite, "host": server.host, "port": suite_port, + "ps_opts": server.suite_srv_files_mgr.PS_OPTS, "pid": suite_pid, "logd": logd, }) diff --git a/lib/cylc/gui/app_gcylc.py b/lib/cylc/gui/app_gcylc.py index aa5aaf3c7a9..8e461aff6ab 100644 --- a/lib/cylc/gui/app_gcylc.py +++ b/lib/cylc/gui/app_gcylc.py @@ -1686,7 +1686,7 @@ def hold_task(self, b, task_ids, stop=True): self.put_comms_command('release_tasks', items=task_ids) def trigger_task_now(self, b, task_ids): - """Trigger task via the suite daemon's command interface.""" + """Trigger task via the suite server program's command interface.""" if not isinstance(task_ids, list): task_ids = [task_ids] @@ -1763,7 +1763,7 @@ def stopsuite_popup(self, b): window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(self.log_colors.get_color())) window.set_border_width(5) - window.set_title("Stop Suite Daemon %s" % self.cfg.suite) + window.set_title("Stop Suite Server Program %s" % self.cfg.suite) window.set_transient_for(self.window) window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) @@ -2222,13 +2222,13 @@ def poll_all(self, w): self.put_comms_command('poll_tasks') def reload_suite(self, w): - """Tell the suite daemon to reload.""" + """Tell the suite server program to reload.""" if not self.get_confirmation("Reload suite definition?"): return self.put_comms_command('reload_suite') def nudge_suite(self, w): - """Nudge the suite daemon.""" + """Nudge the suite server program.""" if not self.get_confirmation("Nudge suite?"): return self.put_comms_command('nudge') @@ -2848,7 +2848,7 @@ def create_main_menu(self): def describe_suite(self, w): """Show suite title and description.""" try: - # Interrogate the suite daemon. + # Interrogate the suite server program info = self.updater.client.get_info('get_suite_info') descr = '\n'.join( "%s: %s" % (key, val) for key, val in info.items()) @@ -3347,7 +3347,7 @@ def popup_uuid_dialog(self, w): """Pop up the client UUID info.""" info_dialog( "Client UUID %s\n" - "(this identifies a client instance to the suite daemon)" % ( + "(this identifies the client to the suite server program)" % ( self.cfg.my_uuid), self.window).inform() def popup_theme_legend(self, widget=None): diff --git a/lib/cylc/gui/updater_tree.py b/lib/cylc/gui/updater_tree.py index 9d0a80b3f49..cf2732cf9de 100644 --- a/lib/cylc/gui/updater_tree.py +++ b/lib/cylc/gui/updater_tree.py @@ -185,8 +185,11 @@ def update_gui(self): # Retrieve any user-expanded rows so that we can expand them later. # This is only really necessary for edge cases in tree reconstruction. expand_me = self._get_user_expanded_row_ids() - daemon_time_zone_info = self.updater.global_summary.get( - "daemon time zone info") + try: + time_zone_info = self.updater.global_summary.get("time zone info") + except KeyError: # Back compat <= 7.5.0 + time_zone_info = self.updater.global_summary.get( + "daemon time zone info") # Store the state, times, messages, etc for tasks and families. new_data = {} @@ -267,7 +270,7 @@ def update_gui(self): # We have to calculate it. tetc_string = get_time_string_from_unix_time( tetc_unix, - custom_time_zone_info=daemon_time_zone_info) + custom_time_zone_info=time_zone_info) self._id_tetc_cache[id_] = {tetc_unix: tetc_string} t_info['finished_time_string'] = tetc_string estimated_t_finish = True diff --git a/lib/cylc/job.sh b/lib/cylc/job.sh index 8559ab9c21f..8c4b17ad36d 100644 --- a/lib/cylc/job.sh +++ b/lib/cylc/job.sh @@ -119,7 +119,7 @@ __OUT__ # Env-Script cylc__job__run_inst_func 'env_script' # Send task started message - cylc task message 'started' & + cylc message 'started' & CYLC_TASK_MESSAGE_STARTED_PID=$! # Access to the suite bin directory if [[ -n "${CYLC_SUITE_DEF_PATH:-}" && -d "${CYLC_SUITE_DEF_PATH}/bin" ]] @@ -141,7 +141,7 @@ __OUT__ rmdir "${CYLC_TASK_WORK_DIR}" 2>'/dev/null' || true # Send task succeeded message wait "${CYLC_TASK_MESSAGE_STARTED_PID}" 2>'/dev/null' || true - cylc task message 'succeeded' || true + cylc message 'succeeded' || true trap '' EXIT exit 0 } @@ -168,14 +168,15 @@ cylc__job__run_inst_func() { # CYLC_VACATION_SIGNALS # Arguments: # signal - trapped or given signal -# priority - message priority +# severity - message severity # run_err_script - boolean, run job err script or not -# messages - (remaining arguments) messages to send back to the suite daemon +# messages - (remaining arguments) +# messages to send back to the suite server program # Returns: # exit 1 cylc__job_finish() { typeset signal="$1" - typeset priority="$2" + typeset severity="$2" typeset run_err_script="$3" shift 3 typeset signal_name= @@ -185,7 +186,7 @@ cylc__job_finish() { if [[ -n "${CYLC_TASK_MESSAGE_STARTED_PID:-}" ]]; then wait "${CYLC_TASK_MESSAGE_STARTED_PID}" 2>'/dev/null' || true fi - cylc task message -p "${priority}" "$@" || true + cylc message -s "${severity}" "$@" || true if $run_err_script; then cylc__job__run_inst_func 'err_script' "${signal}" >&2 fi diff --git a/lib/cylc/mp_pool.py b/lib/cylc/mp_pool.py index 0ac4923f582..e22d55ebe64 100644 --- a/lib/cylc/mp_pool.py +++ b/lib/cylc/mp_pool.py @@ -15,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -"""Process pool to execute shell commands for the suite daemon. +"""Process pool to execute shell commands for the suite server program. In debug mode, commands are printed to stdout before execution. diff --git a/lib/cylc/network/httpclient.py b/lib/cylc/network/httpclient.py index 1bd1c41f3aa..46c1338b6f9 100644 --- a/lib/cylc/network/httpclient.py +++ b/lib/cylc/network/httpclient.py @@ -240,11 +240,15 @@ def put_ext_trigger(self, event_message, event_id): self._compat('put_ext_trigger'), event_message=event_message, event_id=event_id) - def put_message(self, task_id, priority, message): + def put_message(self, task_id, severity, message): """Send task message.""" - return self._call_server( - self._compat('put_message'), - task_id=task_id, priority=priority, message=message) + func_name = self._compat('put_message') + if func_name == 'put_message': + return self._call_server( + func_name, task_id=task_id, severity=severity, message=message) + else: # pre-7.5.0 API compat + return self._call_server( + func_name, task_id=task_id, priority=severity, message=message) def reset(self): """Compat method, does nothing.""" diff --git a/lib/cylc/network/httpserver.py b/lib/cylc/network/httpserver.py index 6dfd322e844..2d9fed28b4c 100644 --- a/lib/cylc/network/httpserver.py +++ b/lib/cylc/network/httpserver.py @@ -495,9 +495,9 @@ def put_ext_trigger(self, event_message, event_id): @cherrypy.expose @cherrypy.tools.json_out() - def put_message(self, task_id, priority, message): + def put_message(self, task_id, severity, message): self._check_access_priv_and_report(PRIV_FULL_CONTROL, log_info=False) - self.schd.message_queue.put((task_id, priority, str(message))) + self.schd.message_queue.put((task_id, severity, str(message))) return (True, 'Message queued') @cherrypy.expose diff --git a/lib/cylc/option_parsers.py b/lib/cylc/option_parsers.py index 78a00557192..b0e0ba9db88 100644 --- a/lib/cylc/option_parsers.py +++ b/lib/cylc/option_parsers.py @@ -172,8 +172,8 @@ def add_std_options(self): "--print-uuid", help=( "Print the client UUID to stderr. " - "This can be matched " - "to information logged by the receiving suite daemon." + "This can be matched to information logged " + "by the receiving suite server program." ), action="store_true", default=False, dest="print_uuid") self.add_std_option( diff --git a/lib/cylc/scheduler.py b/lib/cylc/scheduler.py index 055b21cb9c1..23cce47de0a 100644 --- a/lib/cylc/scheduler.py +++ b/lib/cylc/scheduler.py @@ -295,7 +295,7 @@ def _start_print_blurb(): print logo_line, ('{0: ^%s}' % lmax).format(license_lines[i]) def configure(self): - """Configure suite daemon.""" + """Configure suite server program.""" self.profiler.log_memory("scheduler.py: start configure") # Start up essential services @@ -520,18 +520,18 @@ def process_queued_task_messages(self): task_id_messages = {} while self.message_queue.qsize(): try: - task_id, priority, message = self.message_queue.get( + task_id, severity, message = self.message_queue.get( block=False) except Empty: break self.message_queue.task_done() task_id_messages.setdefault(task_id, []) - task_id_messages[task_id].append((priority, message)) + task_id_messages[task_id].append((severity, message)) for itask in self.pool.get_tasks(): if itask.identity in task_id_messages: - for priority, message in task_id_messages[itask.identity]: + for severity, message in task_id_messages[itask.identity]: self.task_events_mgr.process_message( - itask, priority, message, + itask, severity, message, self.task_job_mgr.poll_task_jobs, is_incoming=True) def process_command_queue(self): @@ -913,7 +913,7 @@ def configure_comms_daemon(self): # Get "pid,args" process string with "ps" pid_str = str(os.getpid()) proc = Popen( - ["ps", "h", "-opid,args", pid_str], + ['ps', self.suite_srv_files_mgr.PS_OPTS, pid_str], stdin=open(os.devnull), stdout=PIPE, stderr=PIPE) out, err = proc.communicate() ret_code = proc.wait() diff --git a/lib/cylc/state_summary_mgr.py b/lib/cylc/state_summary_mgr.py index 249b0695895..3d0a0803c4a 100644 --- a/lib/cylc/state_summary_mgr.py +++ b/lib/cylc/state_summary_mgr.py @@ -119,9 +119,9 @@ def update(self, schd): else: global_summary[key] = None if cylc.flags.utc: - global_summary['daemon time zone info'] = TIME_ZONE_UTC_INFO + global_summary['time zone info'] = TIME_ZONE_UTC_INFO else: - global_summary['daemon time zone info'] = TIME_ZONE_LOCAL_INFO + global_summary['time zone info'] = TIME_ZONE_LOCAL_INFO global_summary['last_updated'] = self.update_time global_summary['run_mode'] = schd.run_mode global_summary['states'] = all_states diff --git a/lib/cylc/suite_srv_files_mgr.py b/lib/cylc/suite_srv_files_mgr.py index a38c44e69da..4903fd79a43 100644 --- a/lib/cylc/suite_srv_files_mgr.py +++ b/lib/cylc/suite_srv_files_mgr.py @@ -63,6 +63,7 @@ class SuiteSrvFilesManager(object): NO_TITLE = "No title provided" PASSPHRASE_CHARSET = ascii_letters + digits PASSPHRASE_LEN = 20 + PS_OPTS = '-opid,args' REC_TITLE = re.compile(r"^\s*title\s*=\s*(.*)\s*$") def __init__(self): @@ -134,7 +135,7 @@ def detect_old_contact_file(self, reg, check_host_port=None): # same command line as before. # Terminate command after 10 seconds to prevent hanging, etc. old_pid_str = old_proc_str.split(None, 1)[0].strip() - cmd = ["timeout", "10", "ps", "-opid,args", str(old_pid_str)] + cmd = ["timeout", "10", "ps", self.PS_OPTS, str(old_pid_str)] if is_remote_host(old_host): import shlex from cylc.cfgspec.globalcfg import GLOBAL_CFG @@ -150,8 +151,12 @@ def detect_old_contact_file(self, reg, check_host_port=None): proc.terminate() sleep(0.1) fname = self.get_contact_file(reg) - proc.wait() - for line in reversed(proc.communicate()[0].splitlines()): + ret_code = proc.wait() + out, err = proc.communicate() + if cylc.flags.debug and ret_code: + sys.stderr.write( + "%s # return %d\n%s\n" % (' '.join(cmd), ret_code, err)) + for line in reversed(out.splitlines()): if line.strip() == old_proc_str: # Suite definitely still running break diff --git a/lib/cylc/task_events_mgr.py b/lib/cylc/task_events_mgr.py index 4d63ef20dac..89d82faeea8 100644 --- a/lib/cylc/task_events_mgr.py +++ b/lib/cylc/task_events_mgr.py @@ -260,7 +260,7 @@ def _poll_to_confirm(self, itask, status_gt, poll_func): itask.state.confirming_with_poll = False return False - def process_message(self, itask, priority, message, poll_func, + def process_message(self, itask, severity, message, poll_func, poll_event_time=None, is_incoming=False): """Parse an incoming task message and update task state. @@ -287,7 +287,7 @@ def process_message(self, itask, priority, message, poll_func, itask.state.status, message_flag, message) if poll_event_time is not None: log_message += ' %s' % self.POLLED_INDICATOR - LOG.log(self.LEVELS.get(priority, INFO), log_message, itask=itask) + LOG.log(self.LEVELS.get(severity, INFO), log_message, itask=itask) # Strip the "at TIME" suffix. event_time = poll_event_time @@ -377,14 +377,14 @@ def process_message(self, itask, priority, message, poll_func, LOG.debug( '(current: %s) unhandled: %s' % (itask.state.status, message), itask=itask) - if priority in [CRITICAL, ERROR, WARNING, INFO, DEBUG]: - priority = getLevelName(priority) + if severity in [CRITICAL, ERROR, WARNING, INFO, DEBUG]: + severity = getLevelName(severity) self._db_events_insert( - itask, ("message %s" % str(priority).lower()), message) - if priority == "CUSTOM": + itask, ("message %s" % str(severity).lower()), message) + if severity == "CUSTOM": self.setup_event_handlers(itask, "custom", message) - elif priority in [TaskMessage.WARNING, TaskMessage.CRITICAL]: - self.setup_event_handlers(itask, priority.lower(), message) + elif severity in [TaskMessage.WARNING, TaskMessage.CRITICAL]: + self.setup_event_handlers(itask, severity.lower(), message) def setup_event_handlers(self, itask, event, message): """Set up handlers for a task event.""" diff --git a/lib/cylc/task_job_mgr.py b/lib/cylc/task_job_mgr.py index 916ce19b282..e076bc966e4 100644 --- a/lib/cylc/task_job_mgr.py +++ b/lib/cylc/task_job_mgr.py @@ -693,14 +693,14 @@ def _poll_task_job_message_callback(self, suite, itask, cmd_ctx, line): ctx = SuiteProcContext(self.JOBS_POLL, None) ctx.out = line try: - event_time, priority, message = line.split("|")[2:5] + event_time, severity, message = line.split("|")[2:5] except ValueError: ctx.ret_code = 1 ctx.cmd = cmd_ctx.cmd # print original command on failure else: ctx.ret_code = 0 self.task_events_mgr.process_message( - itask, priority, message, self.poll_task_jobs, event_time) + itask, severity, message, self.poll_task_jobs, event_time) self.task_events_mgr.log_task_job_activity( ctx, suite, itask.point, itask.tdef.name) diff --git a/lib/cylc/task_message.py b/lib/cylc/task_message.py index 3505acb2a73..6f9552cae5a 100644 --- a/lib/cylc/task_message.py +++ b/lib/cylc/task_message.py @@ -47,17 +47,17 @@ class TaskMessage(object): WARNING = "WARNING" CRITICAL = "CRITICAL" CUSTOM = "CUSTOM" - PRIORITIES = (NORMAL, WARNING, CRITICAL, CUSTOM) + SEVERITIES = (NORMAL, WARNING, CRITICAL, CUSTOM) MSG_RETRY_INTVL = 5.0 MSG_MAX_TRIES = 7 MSG_TIMEOUT = 30.0 - def __init__(self, priority=NORMAL): - if priority in self.PRIORITIES: - self.priority = priority + def __init__(self, severity=NORMAL): + if severity in self.SEVERITIES: + self.severity = severity else: - raise ValueError('Illegal message priority ' + priority) + raise ValueError('Illegal message severity ' + severity) # load the environment self.env_map = dict(os.environ) @@ -92,13 +92,13 @@ def send(self, messages): def _print_messages(self, messages): """Print message to send.""" - if self.priority in [self.NORMAL, self.CUSTOM]: + if self.severity in [self.NORMAL, self.CUSTOM]: handle = sys.stdout else: handle = sys.stderr for message in messages: handle.write('%s %s - %s\n' % ( - self.true_event_time, self.priority, message)) + self.true_event_time, self.severity, message)) handle.flush() def _send_by_remote_port(self, messages): @@ -126,7 +126,7 @@ def _send_by_remote_port(self, messages): for i in range(1, max_tries + 1): # 1..max_tries inclusive try: for message in messages: - client.put_message(self.task_id, self.priority, message) + client.put_message(self.task_id, self.severity, message) except ClientError as exc: sys.stderr.write("Send message: try %s of %s failed: %s\n" % ( i, max_tries, exc)) @@ -259,11 +259,11 @@ def _update_job_status_file(self, messages): for line in lines: job_status_file.write(line) job_status_file.write("%s=%s|%s|%s\n" % ( - self.CYLC_MESSAGE, self.true_event_time, self.priority, + self.CYLC_MESSAGE, self.true_event_time, self.severity, message)) else: job_status_file.write("%s=%s|%s|%s\n" % ( - self.CYLC_MESSAGE, self.true_event_time, self.priority, + self.CYLC_MESSAGE, self.true_event_time, self.severity, message)) try: job_status_file.close() diff --git a/tests/broadcast/05-bad-point/suite.rc b/tests/broadcast/05-bad-point/suite.rc index e14584f6161..7a55d53d2df 100644 --- a/tests/broadcast/05-bad-point/suite.rc +++ b/tests/broadcast/05-bad-point/suite.rc @@ -1,7 +1,7 @@ [meta] title=broadcast bad point description=Test broadcast to an invalid cycle point fails. -# And see github #1415 - it did cause the suite daemon to abort. +# And see github #1415 - it did cause the suite server program to abort. [cylc] abort if any task fails = True [[events]] diff --git a/tests/events/38-task-event-handler-custom.t b/tests/events/38-task-event-handler-custom.t index aca56fdabb8..48cd9e4042a 100755 --- a/tests/events/38-task-event-handler-custom.t +++ b/tests/events/38-task-event-handler-custom.t @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test custom priority event handling. +# Test custom severity event handling. . "$(dirname "$0")/test_header" set_test_number 6 install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"