mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
* Replace OpenDevin with OpenHands * Update CONTRIBUTING.md * Update README.md * Update README.md * update poetry lock; move opendevin folder to openhands * fix env var * revert image references in docs * revert permissions * revert permissions --------- Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
38 lines
894 B
Python
38 lines
894 B
Python
import abc
|
|
|
|
|
|
class RuntimeBuilder(abc.ABC):
|
|
@abc.abstractmethod
|
|
def build(
|
|
self,
|
|
path: str,
|
|
tags: list[str],
|
|
) -> str:
|
|
"""
|
|
Build the runtime image.
|
|
|
|
Args:
|
|
path (str): The path to the runtime image's build directory.
|
|
tags (list[str]): The tags to apply to the runtime image (e.g., ["repo:my-repo", "sha:my-sha"]).
|
|
|
|
Returns:
|
|
str: The name of the runtime image (e.g., "repo:sha").
|
|
|
|
Raises:
|
|
RuntimeError: If the build failed.
|
|
"""
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def image_exists(self, image_name: str) -> bool:
|
|
"""
|
|
Check if the runtime image exists.
|
|
|
|
Args:
|
|
image_name (str): The name of the runtime image (e.g., "repo:sha").
|
|
|
|
Returns:
|
|
bool: Whether the runtime image exists.
|
|
"""
|
|
pass
|