buildgrid.server.sql.models module

class buildgrid.server.sql.models.Base(**kwargs: Any)

Bases: DeclarativeBase

registry: ClassVar[_RegistryType] = <sqlalchemy.orm.decl_api.registry object>

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

metadata: ClassVar[MetaData] = MetaData()

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

See also

orm_declarative_metadata

class buildgrid.server.sql.models.PlatformEntry(**kwargs)

Bases: Base

id: Mapped[int]
key: Mapped[str]
value: Mapped[str]
jobs: Mapped[list['JobEntry']]
class buildgrid.server.sql.models.JobEntry(**kwargs)

Bases: Base

name: Mapped[str]
instance_name: Mapped[str]
action_digest: Mapped[str]
action: Mapped[bytes]
do_not_cache: Mapped[bool]
platform_requirements: Mapped[str]
property_label: Mapped[str]
command: Mapped[str]
stage: Mapped[int]
priority: Mapped[int]
cancelled: Mapped[bool]
assigned: Mapped[bool]
n_tries: Mapped[int]
result: Mapped[str | None]
status_code: Mapped[int | None]
create_timestamp: Mapped[datetime | None]
queued_timestamp: Mapped[datetime]
queued_time_duration: Mapped[int | None]
worker_start_timestamp: Mapped[datetime | None]
worker_completed_timestamp: Mapped[datetime | None]
input_fetch_start_timestamp: Mapped[datetime | None]
input_fetch_completed_timestamp: Mapped[datetime | None]
output_upload_start_timestamp: Mapped[datetime | None]
output_upload_completed_timestamp: Mapped[datetime | None]
execution_start_timestamp: Mapped[datetime | None]
execution_completed_timestamp: Mapped[datetime | None]
stdout_stream_name: Mapped[str | None]
stdout_stream_write_name: Mapped[str | None]
stderr_stream_name: Mapped[str | None]
stderr_stream_write_name: Mapped[str | None]
leases: Mapped[list['LeaseEntry']]
active_states: list[int] = [0, 1, 2, 5]
active_leases: Mapped[list['LeaseEntry']]
operations: Mapped[list['OperationEntry']]
platform: Mapped[list['PlatformEntry']]
class buildgrid.server.sql.models.LeaseEntry(**kwargs)

Bases: Base

id: Mapped[int]
job_name: Mapped[str]
status: Mapped[int | None]
state: Mapped[int]
worker_name: Mapped[str | None]
job: Mapped[JobEntry]
to_protobuf() Lease
class buildgrid.server.sql.models.ClientIdentityEntry(**kwargs)

Bases: Base

id: Mapped[int]
instance: Mapped[str]
workflow: Mapped[str]
actor: Mapped[str]
subject: Mapped[str]
class buildgrid.server.sql.models.RequestMetadataEntry(**kwargs)

Bases: Base

id: Mapped[int]
tool_name: Mapped[str | None]
tool_version: Mapped[str | None]
invocation_id: Mapped[str | None]
correlated_invocations_id: Mapped[str | None]
action_mnemonic: Mapped[str | None]
target_id: Mapped[str | None]
configuration_id: Mapped[str | None]
class buildgrid.server.sql.models.OperationEntry(**kwargs)

Bases: Base

name: Mapped[str]
cancelled: Mapped[bool]
tool_name: Mapped[str | None]
tool_version: Mapped[str | None]
invocation_id: Mapped[str | None]
correlated_invocations_id: Mapped[str | None]
job_name: Mapped[str]
job: Mapped[JobEntry]
client_identity_id: Mapped[int | None]
client_identity: Mapped[ClientIdentityEntry | None]
request_metadata_id: Mapped[int | None]
request_metadata: Mapped[RequestMetadataEntry | None]
class buildgrid.server.sql.models.IndexEntry(**kwargs)

Bases: Base

digest_hash: Mapped[str]
digest_size_bytes: Mapped[int]
accessed_timestamp: Mapped[datetime]
deleted: Mapped[bool]
inline_blob: Mapped[bytes | None]
class buildgrid.server.sql.models.BotEntry(**kwargs)

Bases: Base

name: Mapped[str]
bot_id: Mapped[str]
instance_name: Mapped[str]
bot_status: Mapped[int]
lease_id: Mapped[str | None]
expiry_time: Mapped[datetime]
last_update_timestamp: Mapped[datetime]
job: Mapped[JobEntry | None]
class buildgrid.server.sql.models.BlobEntry(**kwargs)

Bases: Base

digest_hash: Mapped[str]
digest_size_bytes: Mapped[int]
data: Mapped[bytes]
buildgrid.server.sql.models.digest_to_string(digest: Digest) str
buildgrid.server.sql.models.string_to_digest(string: str) Digest