- Table Of Contents
- 1. Buildbot Tutorial
- 2. Buildbot Manual
- 2.1. Introduction
- 2.2. Installation
- 2.3. Concepts
- 2.4. Secret Management
- 2.5. Configuration
- 2.5.1. Configuring Buildbot
- 2.5.2. Global Configuration
- 2.5.3. Change Sources and Changes
- 2.5.5. Schedulers
- 2.5.6. Workers
- 2.5.7. Builder Configuration
- 2.5.8. Projects
- 2.5.9. Build Factories
- 2.5.10. Build Sets
- 2.5.11. Properties
- 2.5.12. Build Steps
- 2.5.12.1. Parameters Common to all Steps
- 2.5.12.2. Common Parameters of source checkout operations
- 2.5.12.3. Bzr
- 2.5.12.4. CVS
- 2.5.12.5. Darcs
- 2.5.12.6. Gerrit
- 2.5.12.7. GitHub
- 2.5.12.8. GitLab
- 2.5.12.9. Git
- 2.5.12.10. Mercurial
- 2.5.12.11. Monotone
- 2.5.12.12. P4
- 2.5.12.13. Repo
- 2.5.12.14. SVN
- 2.5.12.15. GitCommit
- 2.5.12.16. GitTag
- 2.5.12.17. GitPush
- 2.5.12.18. GitDiffInfo
- 2.5.12.19. ShellCommand
- 2.5.12.20. Shell Sequence
- 2.5.12.21. Compile
- 2.5.12.21. Compile
- 2.5.12.22. Configure
- 2.5.12.23. CMake
- 2.5.12.24. Visual C++
- 2.5.12.25. Cppcheck
- 2.5.12.26. Robocopy
- 2.5.12.27. Test
- 2.5.12.28. TreeSize
- 2.5.12.29. PerlModuleTest
- 2.5.12.30. SubunitShellCommand
- 2.5.12.31. HLint
- 2.5.12.32. MaxQ
- 2.5.12.33. Trigger
- 2.5.12.34. BuildEPYDoc
- 2.5.12.35. PyFlakes
- 2.5.12.36. Sphinx
- 2.5.12.37. PyLint
- 2.5.12.38. Trial
- 2.5.12.39. RemovePYCs
- 2.5.12.40. HTTP Requests
- 2.5.12.41. Worker Filesystem Steps
- 2.5.12.42. Transferring Files
- 2.5.12.44. MasterShellCommand
- 2.5.12.45. LogRenderable
- 2.5.12.47. SetProperty
- 2.5.12.46. Assert
- 2.5.12.48. SetProperties
- 2.5.12.49. SetPropertyFromCommand
- 2.5.12.51. RpmBuild
- 2.5.12.52. RpmLint
- 2.5.12.53. MockBuildSRPM Step
- 2.5.12.54. MockRebuild
- 2.5.12.55. DebPbuilder
- 2.5.12.57. DebLintian
- 2.5.13. Interlocks
- 2.5.14. Report Generators
- 2.5.15. Reporters
- 2.5.15.1. ReporterBase
- 2.5.15.2. BitbucketServerCoreAPIStatusPush
- 2.5.15.2. BitbucketServerCoreAPIStatusPush
- 2.5.15.3. BitbucketServerPRCommentPush
- 2.5.15.4. BitbucketServerStatusPush
- 2.5.15.6. GerritStatusPush
- 2.5.15.5. BitbucketStatusPush
- 2.5.15.7. GerritVerifyStatusPush
- 2.5.15.9. GitHubStatusPush
- 2.5.15.10. GitLabStatusPush
- 2.5.15.11. HttpStatusPush
- 2.5.15.12. IRC Bot
- 2.5.15.13. MailNotifier
- 2.5.15.14. PushjetNotifier
- 2.5.15.15. PushoverNotifier
- 2.5.15.16. Telegram Bot
- 2.5.15.17. ZulipStatusPush
- 2.5.16. Web Server
- 2.5.17. Change Hooks
- 2.5.18. Custom Services
- 2.5.19. DbConfig
- 2.5.20. Configurators
- 2.5.21. Manhole
- 2.5.22. Multimaster
- 2.5.23. Multiple-Codebase Builds
- 2.5.24. Miscellaneous Configuration
- 2.5.25. Testing Utilities
- 2.6. Customization
- 2.7. Command-line Tool
- 2.8. Resources
- 2.9. Optimization
- 2.10. Plugin Infrastructure in Buildbot
- 2.11. Deployment
- 2.12. Upgrading
- 3. Buildbot Development
- 3.1. Development Quick-start
- 3.2. Submitting Pull Requests
- 3.3. General Documents
- 3.3.1. Master Organization
- 3.3.2. Buildbot Coding Style
- 3.3.3. Buildbot’s Test Suite
- 3.3.4. Configuration
- 3.3.6. Writing Schedulers
- 3.3.7. Utilities
- 3.3.8. Build Result Codes
- 3.3.9. WWW Server
- 3.3.10. Javascript Data Module
- 3.3.11. Base web application
- 3.3.12. Authentication
- 3.3.13. Authorization
- 3.3.14. Master-Worker API
- 3.3.15. Master-Worker connection with MessagePack over WebSocket protocol
- 3.3.16. Claiming Build Requests
- 3.3.17. String Encodings
- 3.3.18. Metrics
- 3.3.19. Secrets
- 3.3.22. Statistics Service
- 3.3.23. How to package Buildbot plugins
- 3.4. REST API
- 3.5. REST API Specification
- 3.5.1. builder
- 3.5.2. buildrequest
- 3.5.3. build
- 3.5.4. buildset
- 3.5.5. build_data
- 3.5.6. change
- 3.5.7. changesource
- 3.5.8. forcescheduler
- 3.5.9. identifier
- 3.5.10. logchunk
- 3.5.11. log
- 3.5.12. master
- 3.5.13. patch
- 3.5.14. project
- 3.5.15. rootlink
- 3.5.16. scheduler
- 3.5.17. sourcedproperties
- 3.5.18. sourcestamp
- 3.5.19. spec
- 3.5.20. step
- 3.5.21. worker
- 3.5.22. test_result
- 3.5.23. testresultset
- 3.5.24. Raw endpoints
- 3.6. Data API
- 3.7. Database
- 3.8.1. Buildsets connector
- 3.8.2. Buildrequests connector
- 3.8.3. Builders connector
- 3.8.4. Builds connector
- 3.8.5. Build data connector
- 3.8.6. Steps connector
- 3.8.7. Logs connector
- 3.8.8. Changes connector
- 3.8.9. Change sources connector
- 3.8.10. Schedulers connector
- 3.8.11. Source stamps connector
- 3.8.12. State connector
- 3.8.13. Users connector
- 3.8.14. Masters connector
- 3.8.15. Workers connector
- 3.8. Database connectors API
- 3.9. Messaging and Queues
- 3.10. Classes
- 3.10.1. Builds
- 3.10.2. Workers
- 3.10.3. BuildFactory
- 3.10.4. Change Sources
- 3.10.5. RemoteCommands
- 3.10.6. BuildSteps
- 3.10.7. BaseScheduler
- 3.10.8. ForceScheduler
- 3.10.9. IRenderable
- 3.10.10. IProperties
- 3.10.11. IConfigurator
- 3.10.12. ResultSpecs
- 3.10.13. Protocols
- 3.10.14. WorkerManager
- 3.10.15. Logs
- 3.10.16. LogObservers
- 3.10.17. Authentication
- 3.10.18. Avatars
- 3.10.19. Web Server Classes
- 4. Release Notes
- 6. API Indices
- Release Notes
- 5.1. Buildbot 2.10.5 ( 2021-04-05 )
- 5.29. Release Notes for Buildbot 1.8.2 ( 2019-05-22 )
- 5.42. Release Notes for Buildbot 0.9.15.post1 ( 2018-01-07 )
- 5.60. Release Notes for Buildbot 0.9.1
- 5.61. Release Notes for Buildbot 0.9.0
- 5.62. Release Notes for Buildbot 0.9.0rc4
- 5.63. Release Notes for Buildbot 0.9.0rc3
- 5.64. Release Notes for Buildbot 0.9.0rc2
- 5.65. Release Notes for Buildbot 0.9.0rc1
- 5.66. Release Notes for Buildbot 0.9.0b9
- 5.67. Release Notes for Buildbot 0.9.0b8
- 5.68. Release Notes for Buildbot 0.9.0b7
- 5.69. Release Notes for Buildbot 0.9.0b6
- 5.70. Release Notes for Buildbot 0.9.0b5
- 5.71. Release Notes for Buildbot 0.9.0b4
- 5.72. Release Notes for Buildbot 0.9.0b3
- 5.73. Release Notes for Buildbot 0.9.0b2
- 5.74. Release Notes for Buildbot 0.9.0b1
- 5.75. Release Notes for Buildbot 0.8.11
- 5.76. Release Notes for Buildbot 0.8.10
- 5.77. Release Notes for Buildbot 0.8.9
- 5.78. Release Notes for Buildbot v0.8.8
- 5.79. Release Notes for Buildbot v0.8.7
- 5.80. Release Notes for Buildbot v0.8.6p1
- Other
3.3.15. Master-Worker connection with MessagePack over WebSocket protocol
Caution
Buildbot no longer supports Python 2.7 on the Buildbot master.
3.3.15. 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.
Authentication happens during opening WebSocket handshake using standard HTTP Basic authentication. Worker credentials are sent in the value of the HTTP “Authorization” header. Master checks if the credentials match and if not - the connection is terminated.
A WebSocket 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.1. Message key-value pairs
This section describes a general structure of messages. It applies for both master and worker.
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_number
Value is an integer. seq_number
must be unique for every request message coming from a particular side. The purpose of seq_number
value is to link the request message with response message. Response message will carry the same seq_number
value as in corresponding request message.
op
Value is a string. It must not be response
. Each side has a predefined set of commands that another side may invoke. op
specifies the command to be invoked by requesting side.
Response message
A response message must contain at least these keys: seq_number
, op
, result
.
seq_number
Value is an integer. It represents a number which was specified in the corresponding request message.
op
Value is a string, always a response
.
result
Value is None
when success. Otherwise – message of exception.
is_exception
This key-value pair is optional. If request succeeded this key-value pair is absent. Otherwise, its value is a boolean True
and the message of exception is specified in the value of result
.
3.3.15.2. Messages from master to worker
Request
This message requests worker to print a message to its log.
seq_number
Described in section on
Worker prints a message from master to its log.
seq_number
Described in section on
Request
Master sends this message to check if the connection is still working.
seq_number
Described in section on
Response indicates that connection is still working.
seq_number
Described in section on
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.
op
Value is a string get_worker_info
.
seq_number
Described in section on
op
Value is a string response
.
seq_number
Described in section on
Request
Master sends this message to set worker settings. The settings must be sent from master before first command.
seq_number
Described in section on
seq_number
Described in section on
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.
op
Value is a string start_command
.
seq_number
Described in section
op
Value is a string response
.
seq_number
Described in section
Request
This message requests worker to halt the specified command.
seq_number
Described in section
During this command worker may also send back additional update messages to the master. Update messages are explained in section
Request
This message requests worker to shutdown itself. Action does not require arguments, so only op
and seq_number
values are sent.
seq_number
Described in section
Worker returns result
: None
without waiting for completion of shutdown.
op
Value is a string response
.
seq_number
Described in section
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_number
Described in section
op
Value is a string response
.
seq_number
Described in section
Request
op
Value is a string update_upload_file_write
.
args
Contents of the chunk from the file that worker read.
command_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
By this command worker states that no more data will be transferred.
Request
op
Value is a string update_upload_file_close
.
command_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
Request
op
Value is a string update_upload_file_utime
.
access_time
Value 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_time
Value 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_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
Request
op
Value is a string update_read_file
.
length
Maximum number of bytes of data to read.
command_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
By this command worker states that no more data will be transferred.
Request
op
Value is a string update_read_file_close
.
command_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
Request
op
Value is a string update_upload_directory_write
.
args
Contents of the chunk from the directory that worker read.
command_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
By this command worker states that no more data will be transferred.
Request
op
Value is a string update_upload_directory_unpack
.
command_id
Value is a string which identifies command the update refers to.
Response
op
Value is a string response
.
seq_number
Described in section
Notifies master that the remote command has finished.
Request
seq_number
Described in section
op
Value is a string response
.
seq_number
Described in section
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
Runs a shell
command on the worker.
workdir
Value is a string. workdir
is an absolute path and overrides the builder directory. The resulting path represents the worker directory to run the command in.
env
Value 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
env
has value for specific key and it isNone
, resulting dictionary does not have this key.
- If
env
has 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_stdout
Value is a bool and is optional. If value is not specified, the default is True
. If value is True
, worker sends update
log messages to master from the process stdout
output.
want_stderr
Value is a bool and is optional. If value is not specified, the default is True. If value is True
, worker sends update
log messages to the master from the process stderr
output.
logfiles
Value 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 update
message, where logfile name as a key identifies data of different logfiles.
Value is a dictionary. It contains the following keys:
filename
Value is a string. It represents the filename of the logfile, relative to worker directory where the command is run.
follow
Value is a boolean. If True
- only follow the file from its current end-of-file, rather than starting from the beginning. The default is False
.
timeout
Value 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.
maxTime
Value 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, maxTime
variable sets the maximum time the command is allowed to be performing. If maxTime
is set to None
, command runs for as long as it needs unless timeout
specifies otherwise.
sigtermTime
Value is an integer and is optional. If value is not specified, the default is None
. It specifies how to abort the process. If sigtermTime
is not None
when aborting the process, worker sends a signal SIGTERM. After sending this signal, worker waits for sigtermTime
seconds of time and if the process is still alive, sends the signal SIGKILL. If sigtermTime
is None
, worker does not wait and sends signal SIGKILL to the process immediately.
usePTY
Value is a bool and is optional. If value is not specified, the default is False
. True
to use a PTY, False
to not use a PTY.
logEnviron
Value is a bool and is optional. If value is not specified, the default is True
. If True
, worker sends to master an update
message with process environment key-value pairs at the beginning of a process.
initial_stdin
Value is a string or None
. If not None
, the value is sent to the process as an initial stdin after process is started. If value is None
, no initial stdin is sent.
command
Value 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/sh
shell by calling it as /bin/sh -c <command>
. Otherwise, it must be a list, which will be executed directly.
If command succeeded, worker sends rc
value 0 as an update
message args
key-value pair. It can also send many other update
messages with keys such as header
, stdout
or stderr
to inform about command execution. If command failed, it sends rc
value with the error number.
The basic structure of worker update
message is explained in section
Worker reads the contents of its file and sends them in chunks to write into the file on masters’s side.
path
Value is a string. It specifies the path of the worker file to read from.
maxsize
Value 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
.
blocksize
Value is an integer. Maximum size for each data block to be sent to master.
keepstamp
Value is a bool. It represents whether to preserve “file modified” and “accessed” times. True
is for preserving.
Workers sends data to master with one or more update_upload_file_write
messages. After reading the file is over, worker sends update_upload_file_close
message. If keepstamp
was True
, workers sends update_upload_file_utime
message. If command succeeded, worker sends rc
value 0 as an update
message args
key-value pair. It can also send update
messages with key header
or stderr
to inform about command execution.
If command failed, worker sends update_upload_file_close
message and the update
message with dictionary args
key rc
with the error number.
The basic structure of worker update
message is explained in section
Similar to upload_file
. This command will upload an entire directory to the master, in the form of a tarball.
path
Value is a string. It specifies the path of the worker directory to upload.
maxsize
Value 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
.
blocksize
Value is an integer. Maximum size for each data block to be sent to master.
compress
Compression algorithm to use – one of None
, ‘bz2’, or ‘gz’.
Worker sends data to the master with one or more update_upload_directory_write
messages. After reading the directory, worker sends update_upload_directory_unpack
with no arguments to extract the tarball and rc
value 0 as an update
message args
key-value pair if the command succeeded.
Otherwise, worker sends update
message with dictionary args
key header
with information about the error that occurred and another update
message with dictionary args
key rc
with the error number.
The basic structure of worker update
message is explained in section
Downloads a file from master to worker.
path
Value is a string. It specifies the path of the worker file to create.
maxsize
Value 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
.
blocksize
Value is an integer. It represents maximum size for each data block to be sent from master to worker.
mode
Value is None
or 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 rc
value 0 as an update
message args
key-value pair.
Otherwise, worker sends update
message with dictionary args
key header
with information about the error that occurred and another update
message with dictionary args
key rc
with the error number.
The basic structure of worker update
message is explained in section
This command reads the directory and returns the list with directory contents.
path
Value is a string. It specifies the path of a directory to list.
If command succeeded, the list containing the names of the entries in the directory given by that path is sent via update
message in args
key files
. Worker will also send rc
value 0 as an update
message args
key-value pair. If command failed, worker sends update
message with dictionary args
key header
with information about the error that occurred and another update
message with dictionary args
key rc
with the error number.
The basic structure of worker update
message is explained in section
This command will create a directory on the worker. It will also create any intervening directories required.
paths
Value is a list of strings. It specifies absolute paths of directories to create.
If command succeeded, worker will send rc
value 0 as an update
message args
key-value pair.
Otherwise, worker sends update
message with dictionary args
key header
with information about the error that occurred and another update
message with dictionary args
key rc
with the error number.
The basic structure of worker update
message is explained in section
This command will remove directories or files on the worker.
paths
Value is a list of strings. It specifies absolute paths of directories or files to remove.
logEnviron
Value is a bool and is optional. If value is not specified, the default is True
. If True
, worker sends to master an update
message with process environment key-value pairs at the beginning of a process.
timeout
Value 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.
maxTime
Value 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, maxTime
variable sets the maximum time the command is allowed to be performing. If maxTime
is set to None
, command runs for as long as it needs unless timeout
specifies otherwise.
If command succeeded, worker sends rc
value 0 as an update
message args
key-value pair. It can also send many update
messages with key header
, stdout
or stderr
to 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 sends rc
value with the error number.
The basic structure of worker update
message is explained in section
This command copies a directory from one place in the worker to another.
from_path
Value is a string. It specifies the absolute path to the source directory for the copy operation.
to_path
Value is a string. It specifies the absolute path to the destination directory for the copy operation.
logEnviron
Value is a bool. If True
, worker sends to master an update
message with process environment key-value pairs at the beginning of a process.
timeout
Value 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.
maxTime
Value 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, maxTime
variable sets the maximum time the command is allowed to be performing. If maxTime
is set to None
, command runs for as long as it needs unless timeout
specifies otherwise.
If command succeeded, worker sends rc
value 0 as an update
message args
key-value pair. It can also send many update
messages with key header
, stdout
or `stderr` to inform about command execution. If command failed, it sends ``rc
value with the error number.
The basic structure of worker update
message is explained in section
This command returns status information about workers file or directory.
path
Value is a string. It specifies the path of a file or directory 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
rc
value 0 as anupdate
messageargs
key-value pair.Otherwise, worker sends
update
message with dictionaryargs
keyheader
with information about the error that occurred and anotherupdate
message with dictionaryargs
keyrc
with the error number.The basic structure of worker
update
message is explained in sectionWorker sends to the master a possibly-empty list of path names that match shell-style path specification.
path
Value is a string. It specifies a shell-style path pattern. Path pattern can contain shell-style wildcards and must represent an absolute path.
If command succeeded, the result is sent to the master in an
update
message, whereargs
has a keyfile
with the value of that possibly-empty path list. This path list may contain broken symlinks as in the shell. It is not specified whether path list is sorted.Worker also sends
rc
value 0 as anupdate
messageargs
key-value pair.Otherwise, worker sends
update
message with dictionaryargs
keyheader
with information about the error that occurred and anotherupdate
message with dictionaryargs
keyrc
with the error number.The basic structure of worker
update
message is explained in sectionThis command removes the specified file.
path
Value is a string. It specifies a path of a file to delete.
If command succeeded, worker sends
rc
value 0 as anupdate
messageargs
key-value pair.Otherwise, worker sends
update
message with dictionaryargs
keyheader
with information about the error that occurred and anotherupdate
message with dictionaryargs
keyrc
with the error number.The basic structure of worker
update
message is explained in sectionThe
args
key-value pair describes information that the request message sends to master. The value is a list of lists. Each sub-list contains a name-value pair and represents a single update. First element in a list represents the name of update (see below) and second element represents its value. Commands may have their own update names so only common ones are described here.
stdout
Value is a standard output of a process as a string. 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
. The value satisfies the requirements described in a section below.
rc
Value is an integer. It represents an exit code of a process. 0 if the process exit was successful. Any other number represents a failure.
header
Value is a string of a header. 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. The value satisfies the requirements described in a section below.
files
Value is a list of strings.
- If the
update
message was a response to master request messagestart_command
with a key value paircommand_name
andglob
, then strings in this list represent path names that matched pathname given by the master.
- If the
update
message was a response to master request messagestart_command
with a key value paircommand_name
andlistdir
, then strings in this list represent the names of the entries in the directory given by path, which master sent as an argument.
stderr
Value is a standard error of a process as a string. 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
. The value satisfies the requirements described in a section below.
log
Value is a list where the first element represents the name of the log and the second element is a list, representing the contents of the file. The composition of this second element is described in the section below. This message is used to transfer the contents of the file that master requested worker to read. This file is identified by the name of the log. The same value is sent by master as the key of dictionary represented by
logfile
key withinargs
dictionary ofStartCommand
command.
elapsed
Value is an integer. It represents how much time has passed between the start of a command and the completion in seconds.
Requirements for content lists of
stdout
,stderr
,header
andlog
The lists that represents the contents of the output or a file consist of three elements.
First element is a string with the content, which must be processed using the following algorithm:
Each value may contain one or more lines (characters with a terminating
\n
character).Each line is not longer than internal
maxsize
value on worker side. Longer lines are split into multiple lines where each except the last line contains exactlymaxsize
characters and the last line may contain less.
- The lines are run through an internal worker cleanup regex.
Second element is a list of indexes, representing the positions of newline characters in the string of first tuple element.
Third element is a list of numbers, representing at what time each line was received as an output while processing the command.
The number of elements in both lists is always the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论