mate_rest_client.compilations module¶
Python API bindings for compilation endpoints in the MATE REST API.
- class mate_rest_client.compilations.Compilation(client: mate_rest_client.Client, info: CompilationInformation)¶
Bases:
mate_rest_client.common.APIModel
Represents a compilation retrieved from MATE.
- property artifacts: Iterator[mate_rest_client.artifacts.Artifact]¶
Yields each artifact associated with this compilation.
- property builds: Iterator[builds.Build]¶
Yields each build created from this compilation.
- property id_: str¶
Returns a unique identifier for this compilation.
- property log_artifact: Optional[mate_rest_client.artifacts.Artifact]¶
Returns the compilation log artifact for this compilation, if it has a log.
- refresh() None ¶
Refresh the internal state of this compilation.
- Return type
None
- property source_artifact: mate_rest_client.artifacts.Artifact¶
Returns the source artifact that this compilation was started with.
- property state: mate_common.models.compilations.CompilationState¶
Returns the state that this compilation is in.
- class mate_rest_client.compilations.CompilationRoutes(client: mate_rest_client.Client)¶
Bases:
mate_rest_client.common.Routes
An adapter for interactions with compilation endpoints.
- Parameters
client (mate_rest_client.Client) –
- Return type
None
- create_from_artifact(artifact: mate_rest_client.artifacts.Artifact, options: mate_common.models.compilations.CompileOptions = CompileOptions(testbed=None, containerized=False, experimental_embed_bitcode=False, docker_image=None, containerized_infer_build=True, make_targets=None, extra_compiler_flags=[])) mate_rest_client.compilations.Compilation ¶
Create a new compilation from a source artifact.
The artifact can be any source artifact that MATE knows how to accept. The server will reject compilations that are started with a non-source artifact.
- Parameters
artifact (mate_rest_client.artifacts.Artifact) –
options (mate_common.models.compilations.CompileOptions) –
- Return type
- create_from_challenge(options: mate_common.models.compilations.CompileOptions = CompileOptions(testbed=None, containerized=False, experimental_embed_bitcode=False, docker_image=None, containerized_infer_build=True, make_targets=None, extra_compiler_flags=[]), *, challenge_name: Optional[str] = None, challenge_id: Optional[str] = None, target_id: Optional[str] = None) mate_rest_client.compilations.Compilation ¶
Create a new compilation from a challenge, supplied by a CHESS challenge broker.
Challenges can be identified through one of three mutually exclusive identifiers:
challenge_name
: the human-friendly “name” of the challenge, likeexample_1
challenge_id
: the broker-assigned unique identifier for the challengetarget_id
: the broker-assigned unique identifier for a particular challenge target
When
challenge_name
orchallenge_id
is used, MATE selects the “root” target for the specified challenge. Whentarget_id
is used, MATE selects that particular target instead. This can be used to specialize the compilation pipeline on a particular version of a brokered challenge, e.g. one that’s been patched to make compilation simpler within MATE.- Parameters
options (mate_common.models.compilations.CompileOptions) –
challenge_name (Optional[str]) –
challenge_id (Optional[str]) –
target_id (Optional[str]) –
- Return type
- get(id_: str) mate_rest_client.compilations.Compilation ¶
Retrieves a particular compilation by its unique identifier.
- Parameters
id_ (str) –
- Return type
- iter(**kwargs: Dict[str, Any]) Iterator[mate_rest_client.compilations.Compilation] ¶
Yield each compilation currently available.
Any additional filters can be supplied via keyword arguments.
- Parameters
kwargs (Dict[str, Any]) –
- Return type
- maybe_get(id_: str) Optional[mate_rest_client.compilations.Compilation] ¶
Return an compilation by ID, or
None
if the compilation does not exist.- Parameters
id_ (str) –
- Return type