mate_common.models.compilations module

class mate_common.models.compilations.CompilationInformation(*, compilation_id: str, build_ids: List[str], state: mate_common.models.compilations.CompilationState, source_artifact: mate_common.models.artifacts.ArtifactInformation, log_artifact: mate_common.models.artifacts.ArtifactInformation = None, artifact_ids: List[str], options: mate_common.models.compilations.CompileOptions)

Bases: pydantic.main.BaseModel

Metadata about a compilation.

Return type


artifact_ids: List[str]

The IDs of any artifacts currently associated with the compilation.

build_ids: List[str]

The IDs of any builds created from this compilation.

compilation_id: str

The ID of the compilation.

log_artifact: Optional[mate_common.models.artifacts.ArtifactInformation]

Artifact detail for the compilation log recorded with this compilation, if available.

options: mate_common.models.compilations.CompileOptions

The CompileOptions used to configure this compilation.

source_artifact: mate_common.models.artifacts.ArtifactInformation

Artifact detail for the source artifact that this compilation was created from.

state: mate_common.models.compilations.CompilationState

The compilation’s current state.

class mate_common.models.compilations.CompilationState(value)

Bases: mate_common.state_machine.StateMachineMixin, str, enum.Enum

An enumeration of the different states that a compilation can be in.

Compiled = 'compiled'
Compiling = 'compiling'
Created = 'created'
Failed = 'failed'
Rejected = 'rejected'
class mate_common.models.compilations.CompileOptions(*, testbed: bool = None, containerized: bool = False, experimental_embed_bitcode: bool = False, docker_image: str = None, containerized_infer_build: bool = True, make_targets: List[str] = None, extra_compiler_flags: List[str] = [])

Bases: pydantic.main.BaseModel

Options the control the behavior of the compilation pipeline.

  • testbed (Optional[bool]) –

  • containerized (bool) –

  • experimental_embed_bitcode (bool) –

  • docker_image (Optional[str]) –

  • containerized_infer_build (bool) –

  • make_targets (Optional[List[str]]) –

  • extra_compiler_flags (List[str]) –

Return type


containerized: bool

Controls whether or not the compilation is attempted within a Docker container.

If the source of this compilation is a brokered target, then the container image used is the one supplied by the broker. Otherwise, the container is created from the image specified in the docker_image option.

containerized_infer_build: bool

When compiling with containerized: attempt to reproduce the discrete build steps from the supplied by the brokered target.

Only relevant for brokered challenges.

docker_image: Optional[str]

The Docker image to use for a non-brokered containerized compilation.

Ignored if containerized is false.

experimental_embed_bitcode: bool

Instrument the compilation to use -fembed-bitcode instead of using GLLVM.

This option is experimental, and is unlikely to work on compilations larger than a single file.

extra_compiler_flags: List[str]

A list of extra flags to pass to the underlying compiler with each invocation.

These flags are supplied to the compiler regardless of its type or mode, i.e. both CC and CXX receive them.

make_targets: Optional[List[str]]

A list of make targets to run sequentially instead of a vanilla make build. If not supplied, the default make target is run.

These should be formatted as just target names, e.g. ["depend", "all"] for make depend followed by make all.

This option is primarily useful for vexatious builds that require multiple independent steps to happen in sequence for a successful compilation. The cornhill challenge is a straightforward example: a successful compilation must run make depend before make.

This option overrides the behavior of containerized_infer_build.

testbed: Optional[bool]

Controls whether -DNO_TESTBED is passed to the compilation.

testbed has three states:

  • None indicates that the testbed setting is irrelevant, e.g. for a non-CHESS-style target.

  • True indicates that the target should be compiled with -UNO_TESTBED, i.e. with any testbed code explicitly enabled.

  • False indicates that the target should be compiled with -DNO_TESTBED, i.e. with any testbed code explicitly disabled.

class mate_common.models.compilations.TargetKind(value)

Bases: str, enum.Enum

Valid targets for the compilation phase.

Artifact = 'artifact'

A source artifact, either a single file or a tarball containing a source tree.

BrokeredChallengeID = 'brokered-challenge:id'

The unique ID of a challenge, brokered by the CHESS system challenge broker.

BrokeredChallengeName = 'brokered-challenge:name'

The name of a challenge, brokered by the CHESS system challenge broker.

BrokeredChallengeTargetID = 'brokered-challenge-target:id'

The unique ID of a target within a challenge, brokered by the CHESS system challenge broker.

is_brokered() bool

Returns whether this is a brokered compilation target.

Return type


class mate_common.models.compilations.TargetSpecification(*, kind: mate_common.models.compilations.TargetKind, handle: str, options: mate_common.models.compilations.CompileOptions)

Bases: pydantic.main.BaseModel

A descriptor, identifier, and additional options for a compilation target.

Return type


handle: str

The TargetKind-specific handle or other identifying information.

kind: mate_common.models.compilations.TargetKind

The kind of target being compiled.

options: mate_common.models.compilations.CompileOptions

Additional options for configuring the compilation.

classmethod validate_options(options: mate_common.models.compilations.CompileOptions, values: Dict[str, Any]) mate_common.models.compilations.CompileOptions
Return type