Skip to content

Build#

lit.sdk.data.build #

This module provides classes and functions for managing build processes and their statuses within the LIT platform.

Build #

Represents the process which builds raw data files into an asset.

path = Path(get_folder(self.team, self.runid)) instance-attribute #

The path to folder where the build artifacts are saved.

runid = runid instance-attribute #

The identifier of the build.

tags = get_tags(self.team, self.runid, is_archived(self.team, self.runid)) or ''.split(',') instance-attribute #

A list of tags associated with this build.

team = team instance-attribute #

The name of the team.

__init__(team, runid) #

Initializes a new instance of Build.

Parameters:

Name Type Description Default
team str

The team which owns the Build.

required
runid int

The run id of the Build.

required

archive() #

Archive this build, hiding it from the main list of builds.

Returns:

Type Description
Path

The new path to the build artifacts.

Examples:

>>> build = Build("contoso", 19)
>>> build.archive()
/data/contoso/logs/archive/19

get_status() #

Gets detailed status and step information about a build.

Returns:

Type Description
BuildStatus

detailed build status

Examples:

>>> build = Build("contoso", 19)
>>> build.get_status
BuildStats('2024-06-08 16:40:31', 'complete', None)

restore() #

Resore this build from the archive.

Returns:

Type Description
Path

The new path to the build artifacts.

Examples:

>>> build = Build("contoso", 19)
>>> build.restore()
/data/contoso/logs/19

stop() #

Stops a build process and all of its subprocesses.

Returns:

Type Description
str

A status message.

Examples:

>>> build = Build("contoso", 19)
>>> build.stop()
'Build id 19 has been stopped'

get_builds(team) #

Gets all of the builds for a given team.

Parameters:

Name Type Description Default
team str

The name of the team.

required

Returns:

Type Description
list[Build]

A list of build objects.

Examples:

>>> builds = get_builds('contoso')
>>> builds[0].path
Path('/data/contoso/logs/19')