|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from typing import Dict, List, Optional, Union |
|
|
|
from pydantic import BaseModel |
|
|
|
|
|
class TaskConfig(BaseModel): |
|
r"""A configuration for a task to run a command inside the container. |
|
|
|
Arttributes: |
|
cmd (str or list): Command to be executed |
|
stdout (bool): Attach to stdout. (default::obj: `True`) |
|
stderr (bool): Attach to stderr. (default::obj: `True`) |
|
stdin (bool): Attach to stdin. (default::obj: `False`) |
|
tty (bool): Allocate a pseudo-TTY. (default::obj: `False`) |
|
privileged (bool): Run as privileged. (default::obj: `False`) |
|
user (str): User to execute command as. (default::obj: `""`) |
|
detach (bool): If true, detach from the exec command. |
|
(default::obj: `False`) |
|
stream (bool): Stream response data. (default::obj: `False`) |
|
socket (bool): Return the connection socket to allow custom |
|
read/write operations. (default::obj: `False`) |
|
environment (dict or list): A dictionary or a list of strings in |
|
the following format ``["PASSWORD=xxx"]`` or |
|
``{"PASSWORD": "xxx"}``. (default::obj: `None`) |
|
workdir (str): Path to working directory for this exec session. |
|
(default::obj: `None`) |
|
demux (bool): Return stdout and stderr separately. (default::obj: |
|
`False`) |
|
""" |
|
|
|
cmd: Union[str, List[str]] |
|
stdout: bool = True |
|
stderr: bool = True |
|
stdin: bool = False |
|
tty: bool = False |
|
privileged: bool = False |
|
user: str = "" |
|
detach: bool = False |
|
stream: bool = False |
|
socket: bool = False |
|
environment: Optional[Union[Dict[str, str], List[str]]] = None |
|
workdir: Optional[str] = None |
|
demux: bool = False |
|
|