temci.build package¶
Submodules¶
temci.build.build_processor module¶
- class temci.build.build_processor.BuildProcessor(build_blocks: Optional[List[Dict[str, Any]]] = None)[source]¶
Bases:
object
Build programs
A block in the configuration has the following format:
# Optional attributes that describe the block attributes: description: Optional(Str()) # Tags of this block tags: ListOrTuple(Str()) # Build configuration for this program block build_config: # Base directory that contains everything to build an run the program base_dir: Either(DirName()|non existent) default: . # Used version control system branch (default is the current branch) branch: Either(Str()|non existent) # Command to build this program block, might randomize it cmd: Str() # Number of times to build this program number: Either(Int(constraint=<function>)|non existent) default: 1 # Used version control system revision of the program (-1 is the current revision) revision: Either(Either(Str()|Int())|non existent) default: -1 # Working directory in which the build command is run working_dir: Either(DirName()|non existent) default: . # Run configuration for this program block run_config: Dict(, keys=Any, values=Any, default = {})
Creates a build processor for the passed build block configurations.
- Parameters
build_blocks – passed build block configurations
- block_scheme = # Optional attributes that describe the block attributes: description: Optional(Str()) # Tags of this block tags: ListOrTuple(Str()) # Build configuration for this program block build_config: # Base directory that contains everything to build an run the program base_dir: Either(DirName()|non existent) default: . # Used version control system branch (default is the current branch) branch: Either(Str()|non existent) # Command to build this program block, might randomize it cmd: Str() # Number of times to build this program number: Either(Int(constraint=<function>)|non existent) default: 1 # Used version control system revision of the program (-1 is the current revision) revision: Either(Either(Str()|Int())|non existent) default: -1 # Working directory in which the build command is run working_dir: Either(DirName()|non existent) default: . # Run configuration for this program block run_config: Dict(, keys=Any, values=Any, default = {})¶
Type scheme of the program block configurations
- out¶
Temporary directory in which the building takes place
temci.build.builder module¶
- exception temci.build.builder.BuildError(thread: int, item: BuilderQueueItem, error: RecordedError)[source]¶
Bases:
Exception
- class temci.build.builder.Builder(id: int, build_dir: str, build_cmd: str, revision: Union[str, int], number: int, base_dir: str, branch: str)[source]¶
Bases:
object
Allows the building of a program configured by a program block configuration.
Creates a new builder for a program block.
- Parameters
build_dir – working directory in which the build command is run
build_cmd – command to build this program block
revision – used version control systemrand revision of the program (-1 is the current revision)
number – number of times to build this program
base_dir – base directory that contains everything to build an run the program
branch – used version control system branch
- build(thread_count: Optional[int] = None) List[str] [source]¶
Build the program block in parallel with at maximum thread_count threads in parallel.
- Parameters
thread_count – number of threads to use at maximum to build the configured number of time, defaults to build/threads
- Returns
list of base directories for the different builds
- build_cmd¶
Command to build this program block
- build_dir¶
Working directory in which the build command is run
- number¶
Number of times to build this program
- revision¶
Used version control system revision of the program
- vcs_driver¶
Used version control system driver
- exception temci.build.builder.BuilderKeyboardInterrupt(error: BaseException, result: List[str])[source]¶
Bases:
KeyboardInterrupt
KeyboardInterrupt that wraps an error that occurred during the building of a program block
- error¶
Wrapped error
- result¶
Base directories of the succesfull builds
- class temci.build.builder.BuilderQueueItem(id, number, tmp_build_dir, tmp_dir, build_cmd)¶
Bases:
tuple
Create new instance of BuilderQueueItem(id, number, tmp_build_dir, tmp_dir, build_cmd)
- property build_cmd¶
Alias for field number 4
- property id¶
Alias for field number 0
- property number¶
Alias for field number 1
- property tmp_build_dir¶
Alias for field number 2
- property tmp_dir¶
Alias for field number 3
- class temci.build.builder.BuilderThread(id: int, submit_queue: Queue)[source]¶
Bases:
Thread
Thread that fetches configurations from a queue and builds the therein described program blocks.
Creates a new builder thread
- Parameters
id – id of the thread
submit_queue – used queue
- id¶
Id of this thread
- stop¶
Stop the queue fetch loop?
- submit_queue¶
Used queue
Module contents¶
This module contains the build part of temci (usable from the command line with temci build).
It’s separated into four parts with the following purposes:
build_processor.py: facade for the the builders
builder.py: Build programs