Caution
Buildbot no longer supports Python 2.7 on the Buildbot master.
Master-Worker connection with MessagePack over WebSocket protocol
Note
This is experimental protocol.
Messages between master and worker are sent using WebSocket protocol in both directions. Data to be sent conceptually is a dictionary and is encoded using MessagePack. One such encoded dictionary corresponds to one WebSocket message.
A message can be either a request or a response. Request message is sent when one side wants another one to perform an action. Once the action is performed, the other side sends the response message back. A response message is mandatory for every request message.
3.3.15. Message key-value pairs
This section describes a general structure of messages. It applies for both master and worker.
3.3.15.1. Request message
A request message must contain at least these keys: seq_number, op.
Additional key-value pairs may be supplied depending on the request type.
seq_numberValue is an integer.
seq_numbermust be unique for every request message coming from a particular side. The purpose ofseq_numbervalue is to link the request message with response message. Response message will carry the sameseq_numbervalue as in corresponding request message.opValue is a string. It must not be
response. Each side has a predefined set of commands that another side may invoke.opspecifies the command to be invoked by requesting side.
3.3.15.2. Response message
A response message must contain at least these keys: seq_number, op, result.
seq_numberValue is an integer. It represents a number which was specified in the corresponding request message.
opValue is a string, always a
response.resultValue is
Nonewhen success. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.16. Messages from master to worker
3.3.16.1. print
Request
This message requests worker to print a message to its log.
seq_numberDescribed in section on Request message structure.
opValue is a string
print.messageValue is a string. It represents the string to be printed in worker’s log.
Response
Worker prints a message from master to its log.
seq_numberDescribed in section on Response message structure.
opValue is a string
response.resultValue is
Noneif log was printed successfully. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.16.2. keep-alive
Request
Master sends this message to check if the connection is still working.
seq_numberDescribed in section on Request message structure.
opValue is a string
keepalive.
Response
Response indicates that connection is still working.
seq_numberDescribed in section on Response message structure.
opValue is a string
response.resultValue is
None.
3.3.16.3. get_worker_info
Request
This message requests worker to collect and send the information about itself back to the master.
Only op and seq_number values are sent, because worker does not need any additional arguments for this action.
opValue is a string
get_worker_info.seq_numberDescribed in section on Request message structure.
Response
opValue is a string
response.seq_numberDescribed in section on Response message structure.
resultValue is a dictionary that contains data about worker. Otherwise – message of exception.
is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
Key-value pairs in result dictionary represent:
environValue is a dict. It represents environment variables of the worker.
systemValue is a string. It represents a name of the operating system dependent module imported.
basedirValue is a string. It represents a path to build directory.
numcpusValue is an integer. It represents a number of CPUs in the system. If CPUs number for the worker is not detected, number 1 is set.
versionValue is a string. It represents worker version.
worker_commandsValue is a dictionary. Keys of this dictionary represent the commands that worker is able to perform. Values represent the command version.
Additionally, files in Worker ‘basedir/info’ directory are read as key-value pairs. Key is a name of a file and value is the content of a file. As a convention, there are files named ‘admin’ and ‘host’:
adminValue is a string. It specifies information about administrator responsible for this worker.
hostValue is a string. It specifies the name of the host.
3.3.16.4. set_builder_list
For each master’s (builder, builddir) pair worker creates a corresponding directory. Directories which exist on the worker and are no longer needed by master, maybe deleted.
Request
This message sets builders on which commands may be run.
seq_numberDescribed in section Request message structure.
opValue is a string
set_builder_list.buildersValue is a list of two-item lists. It represents wanted builders names. Each tuple contains a builder name and its directory. Builds will be run in a directory, whose path is a concatenation of worker base directory (which comes from Worker’s configuration file) and the directory received from the master. If the directory received from the master is an absolute path, it is used instead for running the builds.
This directory is called builder directory in the rest of documentation.
Response
seq_numberDescribed in section Response message structure.
opValue is a string
response.resultValue is a list which represents names of builders. Otherwise – message of exception.
is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.16.5. start_command
Request
This message requests worker to start a specific command. Master does not have to wait for completion of previous commands before starting a new one, so many different commands may be running in worker simultaneously.
Each start command request message has a unique command_id value.
Worker may be sending request update messages to master which update master about status of started command.
When worker sends a request update message about command, the message takes a command_id value from corresponding start command request message.
Accordingly master can match update messages to the commands they correspond to.
When command execution in worker is completed, worker sends a request complete message to master with the command_id value of the completed command.
It allows master to track which command exactly was completed.
opValue is a string
start_command.seq_numberDescribed in section Request message structure.
builder_nameValue is a string. It represents the builder, which should start a command.
command_idValue is a string value that is unique per worker connection.
command_nameValue is a string. It represents a name of the command to be called.
argsValue is a dictionary. It represents arguments needed to run the command and any additional information about a command.
Arguments of all different commands are explained in section start_command request types.
Response
opValue is a string
response.seq_numberDescribed in section Response message structure.
resultValue is
Nonewhen success. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.16.6. interrupt_command
Request
This message requests worker to halt the specified command.
seq_numberDescribed in section Request message
opValue is a string
interrupt_command.builder_nameValue is a string. It represents a name of a builder which should interrupt its command.
command_idValue is a string which identifies the command to interrupt.
whyValue is a string. It represents the reason of interrupting command.
Response
During this command worker may also send back additional update messages to the master. Update messages are explained in section update.
opValue is a string
response.seq_numberDescribed in section Response message
resultValue is
Noneif success. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.16.7. shutdown
Request
This message requests worker to shutdown itself.
Action does not require arguments, so only op and seq_number values are sent.
seq_numberDescribed in section Request message
opThe value is a string
shutdown.
Response
Worker returns result: None without waiting for completion of shutdown.
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Noneif success. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17. Messages from worker to master
3.3.17.1. auth
Request
The authentication message requests master to authenticate username and password given by the worker. This message must be the first message sent by worker.
seq_numberDescribed in section Request message.
opValue is a string
auth.usernameValue is a string. It represents a username of a connecting worker.
passwordValue is a string. It represents a password of a connecting worker.
Response
Master returns result: True if authentication was successful and worker has logged to master.
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Truewhen authentication succeeded,Falseif authentication failed. If request itself failed due to reason not related to authentication, value contains the message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.2. update
From the start of a command till its completion, worker may be updating master about the processes of commands it requested to start.
These updates are sent in an update messages.
Request
seq_numberDescribed in section Request message.
opValue is a string
update.argsValue is a list of lists. Inner list contains a dictionary and an integer. Keys and values of the dictionary are further explained in section Keys and values of args dictionary value in update request message.
command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.3. update_upload_file_write
Request
opValue is a string
update_upload_file_write.argsContents of the chunk from the file that worker read.
command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.4. update_upload_file_close
By this command worker states that no more data will be transferred.
Request
opValue is a string
update_upload_file_close.command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.5. update_upload_file_utime
Request
opValue is a string
update_upload_file_utime.access_timeValue is a floating point number. It is a number of seconds that passed from the start of the Unix epoch (January 1, 1970, 00:00:00 (UTC)) and last access of path.
modified_timeValue is a floating point number. It is a number of seconds that passed from the start of the Unix epoch (January 1, 1970, 00:00:00 (UTC)) and last modification of path.
command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.6. update_read_file
Request
opValue is a string
update_read_file.lengthMaximum number of bytes of data to read.
command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is data of length
lengththat master read from its file. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.7. update_read_file_close
By this command worker states that no more data will be transferred.
Request
opValue is a string
update_read_file_close.command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.8. update_upload_directory_write
Request
opValue is a string
update_upload_directory_write.argsContents of the chunk from the directory that worker read.
command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.9. update_upload_directory_unpack
By this command worker states that no more data will be transferred.
Request
opValue is a string
update_upload_directory_unpack.command_idValue is a string which identifies command the update refers to.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the update. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.17.10. complete
Notifies master that the remote command has finished.
Request
seq_numberDescribed in section Request message
opValue is a string
complete.argsNoneif a command succeeded. A message of error as a string if command failed.command_idValue is a string which identifies command to complete.
Response
opValue is a string
response.seq_numberDescribed in section Response message.
resultValue is
Nonewhen master successfully acknowledges the completion. Otherwise – message of exception.is_exceptionThis key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean
Trueand the message of exception is specified in the value ofresult.
3.3.18. start_command request types
Request causes worker to start performing an action. There are multiple types of the request each supporting a particular type of worker action. The basic structure of request is the same as explained in section Request message.
Values of command_name and args keys depend on the specific command within the request message dictionary.
command_name is a string which defines command type.
args is a dictionary which defines the arguments and other variables worker needs to perform the command successfully.
Worker starts a program specified in the key command_name and sends updates to the master about ongoing command.
Command names and their arguments dictionary key-value pairs are explained below.
3.3.18.1. Command_name: shell
Runs a shell command on the worker.
workdirValue is a string. This value is joined with the builder directory string (see set_builder_list) to form the path string. If
workdiris an absolute path, it overrides the builder directory. The resulting path represents the worker directory to run the command in.envValue is a dictionary and is optional. It contains key-value pairs that specify environment variables for the environment in which a new command is started.
If the value is of type list, its elements are concatenated to a single string using a platform specific path separator between the elements.
If this dictionary contains “PYTHONPATH” key, path separator and “$PYTHONPATH” is appended to that value.
Resulting environment dictionary sent to the command is created following these rules:
If
envhas value for specific key and it isNone, resulting dictionary does not have this key.If
envhas value for specific key and it is notNone, resulting dictionary contains this value with substitutions applied.
Any matches of a pattern
${name}in this value, where name is any number of alphanumeric characters, are substituted with the value of the same key from worker environment.If a specific key from worker environment is not present in
env, resulting dictionary contains that key-value pair from worker environment.
want_stdoutValue is a bool and is optional. If value is not specified, the default is
True. If value isTrue, worker sendsupdatelog messages to master from the processstdoutoutput.want_stderrValue is a bool and is optional. If value is not specified, the default is True. If value is
True, worker sendsupdatelog messages to the master from the processstderroutput.logfilesValue is a dictionary and is optional. If the value is not specified, the default is an empty dictionary.
This dictionary specifies logfiles other than stdio.
Keys are the logfile names.
Worker reads this logfile and sends the data with the
updatemessage, where logfile name as a key identifies data of different logfiles.Value is a dictionary. It contains the following keys:
filenameValue is a string. It represents the filename of the logfile, relative to worker directory where the command is run.
followValue is a boolean. If
True- only follow the file from its current end-of-file, rather than starting from the beginning. The default isFalse.
timeoutValue is an integer and is optional. If value is not specified, the default is
None. It represents, how many seconds a worker should wait before killing a process after it gives no output.maxTimeValue is an integer and is optional. If value is not specified, the default is
None. It represents, how many seconds a worker should wait before killing a process. Even if command is still running and giving the output,maxTimevariable sets the maximum time the command is allowed to be performing. IfmaxTimeis set toNone, command runs for as long as it needs unlesstimeoutspecifies otherwise.sigtermTimeValue is an integer and is optional. If value is not specified, the default is
None. It specifies how to abort the process. IfsigtermTimeis notNonewhen aborting the process, worker sends a signal SIGTERM. After sending this signal, worker waits forsigtermTimeseconds of time and if the process is still alive, sends the signal SIGKILL. IfsigtermTimeisNone, worker does not wait and sends signal SIGKILL to the process immediately.usePTYValue is a bool and is optional. If value is not specified, the default is
False.Trueto use a PTY,Falseto not use a PTY.logEnvironValue is a bool and is optional. If value is not specified, the default is
True. IfTrue, worker sends to master anupdatemessage with process environment key-value pairs at the beginning of a process.initial_stdinValue is a string or
None. If notNone, the value is sent to the process as an initial stdin after process is started. If value isNone, no initial stdin is sent.commandValue is a list of strings or a string. It represents the name of a program to be started and its arguments. If this is a string, it will be invoked via
/bin/shshell by calling it as/bin/sh -c <command>. Otherwise, it must be a list, which will be executed directly.If command succeeded, worker sends
rcvalue 0 as anupdatemessageargskey-value pair. It can also send manyupdatemessages with keyheader,stdoutor`stderr` to inform about command execution. If command failed, it sends ``rcvalue with the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.2. Command_name: upload_file
Worker reads the contents of its file and sends them in chunks to write into the file on masters’s side.
workdirValue is a string. It represents a base directory for the filename, relative to the builder’s basedir.
workersrcValue is a string. It represents a path to the worker-side file to read from, relative to the workdir.
maxsizeValue is an integer. Maximum number of bytes to transfer from the worker. The operation will fail if the file exceeds this size. Worker will send messages with data to master until it notices it exceeded
maxsize.blocksizeValue is an integer. Maximum size for each data block to be sent to master.
keepstampValue is a bool. It represents whether to preserve “file modified” and “accessed” times.
Trueis for preserving.Workers sends data to master with one or more
update_upload_file_writemessages. After reading the file is over, worker sendsupdate_upload_file_closemessage. IfkeepstampwasTrue, workers sendsupdate_upload_file_utimemessage. If command succeeded, worker sendsrcvalue 0 as anupdatemessageargskey-value pair. It can also sendupdatemessages with keyheaderorstderrto inform about command execution.If command failed, worker sends
update_upload_file_closemessage and theupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.3. Command_name: upload_directory
Similar to upload_file.
This command will upload an entire directory to the master, in the form of a tarball.
workdirValue is a string. It represents a base directory for the filename, relative to the builder’s basedir.
workersourceValue is a string. It represents a path to the worker-side directory to read from, relative to the workdir.
maxsizeValue is an integer. Maximum number of bytes to transfer from the worker. The operation will fail if the tarball file exceeds this size. Worker will send messages with data to master until it notices it exceeded
maxsize.blocksizeValue is an integer. Maximum size for each data block to be sent to master.
compressCompression algorithm to use – one of
None, ‘bz2’, or ‘gz’.Worker sends data to the master with one or more
update_upload_directory_writemessages. After reading the directory, worker sendsupdate_upload_directory_unpackwith no arguments to extract the tarball andrcvalue 0 as anupdatemessageargskey-value pair if the command succeeded.Otherwise, worker sends
updatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.
The basic structure of worker update message is explained in section Keys and values of args dictionary value in update request message.
3.3.18.4. Command_name: download_file
Downloads a file from master to worker.
workdirValue is a string. It represents a base directory for the filename, relative to the builder’s basedir.
workerdestValue is a string. It represents a path to the worker-side file to write to, relative to the workdir.
maxsizeValue is an integer. Maximum number of bytes to transfer from the master. The operation will fail if the file exceeds this size. Worker will request data from master until it notices it exceeded
maxsize.blocksizeValue is an integer. It represents maximum size for each data block to be sent from master to worker.
modeValue is
Noneor an integer which represents an access mode for the new file.256 - owner has read permission.
128 - owner has write permission.
64 - owner has execute permission.
32 - group has read permission.
16 - group has write permission.
8 - group has execute permission.
4 - others have read permission.
2 - others have write permission.
1 - others have execute permission.
If
None, file has default permissions.If command succeeded, worker will send
rcvalue 0 as anupdatemessageargskey-value pair.Otherwise, worker sends
updatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.5. Command_name: listdir
This command reads the directory and returns the list with directory contents.
dirValue is a string. Specifies the directory relative to the builder’s basedir.
Worker creates the path to list by joining base directory and the given value.
If command succeeded, the list containing the names of the entries in the directory given by that path is sent via
updatemessage inargskeyfiles. Worker will also sendrcvalue 0 as anupdatemessageargskey-value pair. If command failed, worker sendsupdatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.6. Command_name: mkdir
This command will create a directory on the worker. It will also create any intervening directories required.
dirValue is a string. Specifies the directory relative to the builder’s basedir.
Worker creates the path to directory by joining the base directory and given value.
If command succeeded, worker will send
rcvalue 0 as anupdatemessageargskey-value pair.Otherwise, worker sends
updatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.7. Command_name rmdir
This command will remove a directory or file on the worker.
dirValue is a string or a list of strings. It represents a name of a directory or directories to be removed.
logEnvironValue is a bool and is optional. If value is not specified, the default is
True. IfTrue, worker sends to master anupdatemessage with process environment key-value pairs at the beginning of a process.timeoutValue is an integer and is optional. If value is not specified, the default is 120s. It represents how many seconds a worker should wait before killing a process when it gives no output.
maxTimeValue is an integer and is optional. If value is not specified, the default is
None. It represents, how many seconds a worker should wait before killing a process. Even if command is still running and giving the output,maxTimevariable sets the maximum time the command is allowed to be performing. IfmaxTimeis set toNone, command runs for as long as it needs unlesstimeoutspecifies otherwise.If command succeeded, worker sends
rcvalue 0 as anupdatemessageargskey-value pair. It can also send manyupdatemessages with keyheader,stdoutorstderrto inform about command execution. If command failed, worker changes the permissions of a directory and tries the removal once again. If that does not help, worker sendsrcvalue with the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.8. Command_name: cpdir
This command copies a directory from one place in the worker to another.
fromdirValue is a string. Source directory for the copy operation, relative to the builder’s basedir.
todirValue is a string. Destination directory for the copy operation, relative to the builder’s basedir.
logEnvironValue is a bool. If
True, worker sends to master anupdatemessage with process environment key-value pairs at the beginning of a process.timeoutValue is an integer. If value is not specified, the default is 120s. It represents, how many seconds a worker should wait before killing a process if it gives no output.
maxTimeValue is an integer and is optional. If value is not specified, the default is
None. It represents, how many seconds a worker should wait before killing a process. Even if command is still running and giving the output,maxTimevariable sets the maximum time the command is allowed to be performing. IfmaxTimeis set toNone, command runs for as long as it needs unlesstimeoutspecifies otherwise.If command succeeded, worker sends
rcvalue 0 as anupdatemessageargskey-value pair. It can also send manyupdatemessages with keyheader,stdoutor`stderr` to inform about command execution. If command failed, it sends ``rcvalue with the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.9. Command_name: stat
This command returns status information about workers file or directory.
Path of that file or directory is constructed by joining the Builder base directory and path in file value.
fileValue is a string. It represents the filename relative to the Builder’s basedir to get the status of.
If command succeeded, status information is sent to the master in an update message, where args has a key stat with a value of a tuple of these 10 elements:
0 - File mode: file type and file mode bits (permissions) in Unix convention.
1 - Platform dependent, but if non-zero, uniquely identifies the file for a specific device.
2 - Unique ID of disc device where this file resides.
3 - Number of hard links.
4 - ID of the file owner.
5 - Group ID of the file owner.
6 - If the file is a regular file or a symbolic link, size of the file in bytes, otherwise unspecified.
Timestamps depend on the platform:
Unix time or the time of Windows creation, expressed in seconds.
7 - time of last access in seconds.
8 - time of last data modification in seconds.
9 - time of last status change in seconds.
If command succeeded, worker also sends
rcvalue 0 as anupdatemessageargskey-value pair.Otherwise, worker sends
updatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.10. Command_name: glob
Worker sends to the master a possibly-empty list of path names that match shell-style path specification.
Path of the file is constructed by joining the Builder base directory and path in
pathvalue. Pathname can be absolute or relative with or without shell-style wildcards.
pathValue is a string. It represents a shell-style path specification of a pattern.
If command succeeded, the result is sent to the master in an
updatemessage, whereargshas a keyfilewith the value of that possibly-empty path list. Worker also sendsrcvalue 0 as anupdatemessageargskey-value pair.Otherwise, worker sends
updatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.18.11. Command_name: rmfile
This command removes the specified file.
pathValue is a string. It represents the file path relative to the builder’s basedir. Worker removes (deletes) the file
path.If command succeeded, worker sends
rcvalue 0 as anupdatemessageargskey-value pair.Otherwise, worker sends
updatemessage with dictionaryargskeyheaderwith information about the error that occurred and anotherupdatemessage with dictionaryargskeyrcwith the error number.The basic structure of worker
updatemessage is explained in section Keys and values of args dictionary value in update request message.
3.3.19. Keys and values of args dictionary value in update request message
Commands may have specific key-value pairs so only common ones are described here.
stdoutValue is a standard output of a process. Some of the commands that master requests worker to start, may initiate processes which output a result as a standard output and this result is saved in the value of
stdout.rcValue is an integer. It represents an exit code of a process. 0 if the process exit was successful. Any other number represents a failure.
headerValue is a string. It represents additional information about how the command worked. For example, information may include the command name and arguments, working directory and environment or various errors or warnings of a process or other information that may be useful for debugging.
filesValue is a list of strings.
If the
updatemessage was a response to master request messagestart_commandwith a key value paircommand_nameandglob, then strings in this list represent path names that matched pathname given by the master.If the
updatemessage was a response to master request messagestart_commandwith a key value paircommand_nameandlistdir, then strings in this list represent the names of the entries in the directory given by path, which master sent as an argument.
stderrValue is a standard error of a process. Some of the commands that master requests worker to start may initiate processes which can output a result as a standard error and this result is saved in the value of
stderr.Tuple (“log”, name)Value is a string. This message is used to transfer the contents of the file that master requested worker to read. This file is identified by the second member in workers tuple. The same value is sent by master as the key of dictionary represented by
logfilekey withinargsdictionary ofStartCommandcommand. The string value of the message is the contents of a file that worker read.elapsedValue is an integer. It represents how much time has passed between the start of a command and the completion in seconds.