tugboat.schemas package¶
tugboat.schemas contains classes representing the schemas of Argo Workflows.
All the listed classes are pydantic.BaseModel classes used for input
data validation. These classes are immutable and do not allow any extra fields.
This ensures that the input data strictly follows the schema and that the data
model remains consistent throughout the program’s execution, even when data is
transferred between different modules.
All the classes are derived from Argo Workflows’ official Field Reference documentation. If you find any discrepancies between the classes and the official documentation, please report it as a bug.
Currently, many of the members are typed as typing.Any.
This means that the field is not yet used in the codebase but is included in the
schema for future compatibility. This also provides the basic ability to validate
if there are any incompatible fields in the input data.
- class tugboat.schemas.Arguments(*, artifacts: Array[Artifact] | None = None, parameters: Array[Parameter] | None = None)¶
Arguments to a template.
- artifacts: Array[Artifact] | None¶
Artifacts is the list of artifacts to pass to the template or workflow.
- property parameter_dict: dict[str, Parameter]¶
Parameter name to
parametersmapping.
- class tugboat.schemas.Artifact¶
Artifact indicates an artifact to place at a specified path.
- archive: ArchiveStrategy | None¶
- artifactGc: ArtifactGc | None¶
- artifactory: ArtifactoryArtifact | None¶
- azure: AzureArtifact | None¶
- gcs: GcsArtifact | None¶
- git: GitArtifact | None¶
- hdfs: HdfsArtifact | None¶
- http: HttpArtifact | None¶
- oss: OssArtifact | None¶
- plugin: PluginArtifact | None¶
- raw: RawArtifact | None¶
- s3: S3Artifact | None¶
- value: Literal[None]¶
Not a valid field for artifact. Preserve for validation purposes.
- class tugboat.schemas.ContainerNode¶
Represents an individual ContainerNode within a ContainerSetTemplate.
- envFrom: Array[EnvFromSource] | None¶
- resources: ResourceRequirements | None¶
- volumeMounts: Array[VolumeMount] | None¶
- class tugboat.schemas.ContainerTemplate¶
A single application container that you want to run within a pod.
- envFrom: Array[EnvFromSource] | None¶
- resources: ResourceRequirements | None¶
- volumeMounts: Array[VolumeMount] | None¶
- class tugboat.schemas.CronWorkflow(*, apiVersion: Literal['argoproj.io/v1alpha1'], kind: Literal['CronWorkflow'], metadata: Metadata, spec: CronWorkflowSpec)¶
CronWorkflows are workflows that run on a schedule.
- apiVersion: Literal['argoproj.io/v1alpha1']¶
- kind: Literal['CronWorkflow']¶
- spec: CronWorkflowSpec¶
- class tugboat.schemas.DagTask¶
DAGTask represents a node in the graph during DAG execution.
- templateRef: TemplateRef | None¶
- class tugboat.schemas.Manifest(*, apiVersion: str, kind: str, metadata: Metadata, spec: T_Spec)¶
The base schema for the Kubernetes manifest.
This schema is generic and must be inherited with the
T_Spectype parameter, which is the schema for thespecfield of the manifest:class MyManifestSpec(BaseModel): ... class MyManifest(Manifest[MyManifestSpec]): ...
- spec: T_Spec¶
- class tugboat.schemas.Parameter¶
Parameter indicate a passed string parameter to a service template with an optional default value.
- class tugboat.schemas.ScriptTemplate¶
ScriptTemplate is a template subtype to enable scripting through code steps.
- envFrom: Array[EnvFromSource] | None¶
- resources: ResourceRequirements | None¶
- volumeMounts: Array[VolumeMount] | None¶
- class tugboat.schemas.Step¶
Step is a reference to a template to execute in a series of step.
- templateRef: TemplateRef | None¶
- class tugboat.schemas.Template¶
Template is a reusable and composable unit of execution in a workflow.
- container: ContainerTemplate | None¶
- containerSet: ContainerSetTemplate | None¶
- dag: DagTemplate | None¶
- script: ScriptTemplate | None¶
- property step_dict: dict[str, Step]¶
Step name to step data model mapping.
Note
Duplicate names will be overwritten and the empty name will be ignored.
- suspend: SuspendTemplate | None¶
- class tugboat.schemas.Workflow(*, apiVersion: Literal['argoproj.io/v1alpha1'], kind: Literal['Workflow'], metadata: Metadata, spec: WorkflowSpec)¶
Workflows are the top-level resource in Argo Workflows that define a single unit of work.
- apiVersion: Literal['argoproj.io/v1alpha1']¶
- kind: Literal['Workflow']¶
- spec: WorkflowSpec¶
- class tugboat.schemas.WorkflowTemplate(*, apiVersion: Literal['argoproj.io/v1alpha1'], kind: Literal['WorkflowTemplate'], metadata: Metadata, spec: WorkflowSpec)¶
WorkflowTemplates are reusable Workflow definitions stored in the cluster.
- apiVersion: Literal['argoproj.io/v1alpha1']¶
- kind: Literal['WorkflowTemplate']¶
- spec: WorkflowSpec¶
tugboat.schemas.arguments.artifact module¶
- class tugboat.schemas.arguments.artifact.ArchiveStrategy¶
-
- tar: TarStrategy | None¶
- class tugboat.schemas.arguments.artifact.ArtifactGc(*, podMetadata: PodMetadata | None = None, serviceAccountName: str | None = None, strategy: str)¶
- podMetadata: PodMetadata | None¶
- class tugboat.schemas.arguments.artifact.ArtifactoryArtifact(*, passwordSecret: ConfigKeySelector, url: str, usernameSecret: ConfigKeySelector)¶
- passwordSecret: ConfigKeySelector¶
- usernameSecret: ConfigKeySelector¶
- class tugboat.schemas.arguments.artifact.AzureArtifact(*, accountKeySecret: ConfigKeySelector, blob: str, container: str, endpoint: str, useSDKCreds: bool | None = None)¶
- accountKeySecret: ConfigKeySelector¶
- class tugboat.schemas.arguments.artifact.BasicAuth(*, passwordSecret: ConfigKeySelector, usernameSecret: ConfigKeySelector)¶
- passwordSecret: ConfigKeySelector¶
- usernameSecret: ConfigKeySelector¶
- class tugboat.schemas.arguments.artifact.ClientCertAuth(*, clientCertSecret: ConfigKeySelector | None = None, clientKeySecret: ConfigKeySelector)¶
- clientCertSecret: ConfigKeySelector | None¶
- clientKeySecret: ConfigKeySelector¶
- class tugboat.schemas.arguments.artifact.GcsArtifact(*, bucket: str, key: str, serviceAccountKeySecret: ConfigKeySelector)¶
-
- serviceAccountKeySecret: ConfigKeySelector¶
- class tugboat.schemas.arguments.artifact.GitArtifact(*, branch: str | None = None, depth: int | None = None, disableSubmodules: bool | None = None, fetch: Array[str] | None = None, insecureIgnoreHostKey: bool | None = None, insecureSkipTLS: bool | None = None, passwordSecret: ConfigKeySelector | None = None, repo: str, revision: str | None = None, singleBranch: bool | None = None, sshPrivateKeySecret: ConfigKeySelector | None = None, usernameSecret: ConfigKeySelector | None = None)¶
-
- passwordSecret: ConfigKeySelector | None¶
- sshPrivateKeySecret: ConfigKeySelector | None¶
- usernameSecret: ConfigKeySelector | None¶
- class tugboat.schemas.arguments.artifact.HdfsArtifact(*, addresses: Array[str], dataTransferProtection: str | None = None, force: bool | None = None, hdfsUser: str, krbCCacheSecret: ConfigKeySelector | None = None, krbConfigConfigMap: ConfigKeySelector | None = None, krbKeytabSecret: ConfigKeySelector | None = None, krbRealm: str | None = None, krbServicePrincipalName: str | None = None, krbUsername: str | None = None, path: str)¶
-
- krbCCacheSecret: ConfigKeySelector | None¶
- krbConfigConfigMap: ConfigKeySelector | None¶
- krbKeytabSecret: ConfigKeySelector | None¶
- class tugboat.schemas.arguments.artifact.HttpArtifact¶
-
- headers: Array[NameValuePair] | None¶
- class tugboat.schemas.arguments.artifact.HttpAuth¶
-
- clientCert: ClientCertAuth | None¶
- oauth2: OAuth2Auth | None¶
- class tugboat.schemas.arguments.artifact.OAuth2Auth(*, clientIDSecret: ConfigKeySelector, clientSecretSecret: ConfigKeySelector, endpointParams: Array[KeyValuePair] | None = None, scopes: Array[str] | None = None, tokenURLSecret: ConfigKeySelector | None = None)¶
- clientIdSecret: ConfigKeySelector¶
- clientSecretSecret: ConfigKeySelector¶
- endpointParams: Array[KeyValuePair] | None¶
- tokenUrlSecret: ConfigKeySelector | None¶
- class tugboat.schemas.arguments.artifact.OssArtifact¶
- accessKeySecret: ConfigKeySelector | None¶
- lifecycleRule: OssLifecycleRule | None¶
- secretKeySecret: ConfigKeySelector | None¶
- class tugboat.schemas.arguments.artifact.OssLifecycleRule(*, markDeletionAfterDays: int | None = None, markInfrequentAccessAfterDays: int | None = None)¶
- class tugboat.schemas.arguments.artifact.PluginArtifact(*, configuration: str | None = None, connectionTimeoutSeconds: int | None = None, key: str | None = None, name: str | None)¶
PluginArtifact is the location of an artifact plugin.
- class tugboat.schemas.arguments.artifact.S3Artifact¶
- accessKeySecret: ConfigKeySelector | None¶
- caSecret: ConfigKeySelector | None¶
- createBucketIfNotPresent: CreateS3BucketOptions | None¶
- encryptionOptions: S3EncryptionOptions | None¶
- secretKeySecret: ConfigKeySelector | None¶
- sessionTokenSecret: ConfigKeySelector | None¶
tugboat.schemas.arguments.parameter module¶
- class tugboat.schemas.arguments.parameter.ValueFrom(*, configMapKeyRef: ConfigKeySelector | None = None, default: str | None = None, event: str | None = None, expression: str | None = None, jqFilter: str | None = None, jsonPath: str | None = None, parameter: str | None = None, path: str | None = None, supplied: Empty | None = None)¶
ValueFrom describes a location in which to obtain the value to a parameter.
- configMapKeyRef: ConfigKeySelector | None¶
tugboat.schemas.basic module¶
- class tugboat.schemas.basic.ConfigKeySelector(*, key: str, name: str, optional: bool | None = None)¶
Represents a reference to a key within a ConfigMap or Secret. This class is utilized by both the ConfigMapKeySelector and SecretKeySelector classes.
- class tugboat.schemas.basic.Dict(*args, **kwargs)¶
A frozen dictionary type that can be used in Pydantic models.
- class tugboat.schemas.basic.Empty¶
tugboat.schemas.cron_workflow module¶
- class tugboat.schemas.cron_workflow.CronWorkflowSpec(*, concurrencyPolicy: str | None = None, failedJobsHistoryLimit: int | None = None, schedule: str | None = None, schedules: Array[str] | None = None, startingDeadlineSeconds: int | None = None, successfulJobsHistoryLimit: int | None = None, suspend: bool | None = None, timezone: str | None = None, when: str | None = None, workflowSpec: WorkflowSpec, stopStrategy: Any | None = None, workflowMetadata: Any | None = None)¶
CronWorkflowSpec is the specification of a CronWorkflow.
- workflowSpec: WorkflowSpec¶
tugboat.schemas.manifest module¶
- class tugboat.schemas.manifest.Metadata(*, name: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=253)] = None, generateName: Annotated[str | None, MinLen(min_length=1), MaxLen(max_length=248)] = None, labels: Dict[str, str] | None = None, annotations: Dict[str, str] | None = None)¶
Kubernetes manifest metadata.
tugboat.schemas.template module¶
- class tugboat.schemas.template.DagTemplate¶
DAGTemplate is a template subtype for directed acyclic graph templates.
- class tugboat.schemas.template.SuspendTemplate(*, duration: str | None = None)¶
SuspendTemplate is a template subtype to suspend a workflow at a predetermined point in time.
tugboat.schemas.template.env module¶
- class tugboat.schemas.template.env.EnvFromSource¶
EnvFromSource represents the source of a set of ConfigMaps.
- configMapRef: OptionalName | None¶
- secretRef: OptionalName | None¶
- class tugboat.schemas.template.env.EnvVar¶
EnvVar represents an environment variable present in a Container.
- valueFrom: EnvVarSource | None¶
- class tugboat.schemas.template.env.EnvVarSource¶
- configMapKeyRef: ConfigKeySelector | None¶
- fieldRef: ObjectFieldSelector | None¶
- resourceFieldRef: ResourceFieldSelector | None¶
- secretKeyRef: ConfigKeySelector | None¶
- class tugboat.schemas.template.env.ObjectFieldSelector(*, apiVersion: str | None = None, fieldPath: str)¶
- class tugboat.schemas.template.env.OptionalName(*, name: str, optional: bool | None = None)¶
Represents a reference to a ConfigMap or Secret. This class is utilized by both the ConfigMapEnvSource and SecretEnvSource classes.
tugboat.schemas.template.container module¶
- class tugboat.schemas.template.container.ContainerSetRetryStrategy(*, duration: Annotated[str | None, _PydanticGeneralMetadata(pattern='\\d+(ns|us|µs|ms|s|m|h)')] = None, retries: int | str)¶
- class tugboat.schemas.template.container.ContainerSetTemplate¶
ContainerSetTemplate to specify multiple containers to run within a single pod.
- containers: Array[ContainerNode]¶
- retryStrategy: ContainerSetRetryStrategy | None¶
- volumeMounts: Array[VolumeMount] | None¶
- class tugboat.schemas.template.container.Quantity(expr: str)¶
Quantity is a fixed-point representation of a number.
- class tugboat.schemas.template.container.ResourceClaim(*, name: str, request: str | None = None)¶
ResourceClaim references one entry in PodSpec.ResourceClaims.
- class tugboat.schemas.template.container.ResourceQuantities¶
ResourceQuantity is a class to represent resource quantities in Kubernetes.
- class tugboat.schemas.template.container.ResourceRequirements¶
ResourceRequirements describes the compute resource requirements.
- claims: Array[ResourceClaim] | None¶
- limits: ResourceQuantities | None¶
- requests: ResourceQuantities | None¶
tugboat.schemas.template.volume module¶
- class tugboat.schemas.template.volume.VolumeMount(*, mountPath: str, mountPropagation: str | None = None, name: str, readOnly: bool | None = None, recursiveReadOnly: bool | None = None, subPath: str | None = None, subPathExpr: str | None = None)¶
VolumeMount describes a mounting of a Volume within a container.
tugboat.schemas.template.probe module¶
- class tugboat.schemas.template.probe.ExecAction(*, command: Array[str])¶
ExecAction describes a “run in container” action.
- class tugboat.schemas.template.probe.HttpGetAction¶
HttpGetAction describes an action based on HTTP Get requests.
- httpHeaders: Array[HttpHeader] | None¶
- class tugboat.schemas.template.probe.HttpHeader¶
-
- valueFrom: HttpHeaderSource | None¶
- class tugboat.schemas.template.probe.HttpHeaderSource(*, secretKeyRef: ConfigKeySelector)¶
- secretKeyRef: ConfigKeySelector¶
- class tugboat.schemas.template.probe.Probe¶
- exec: ExecAction | None¶
- grpc: GrpcAction | None¶
- httpGet: HttpGetAction | None¶
- tcpSocket: TcpSocketAction | None¶
tugboat.schemas.metrics module¶
- class tugboat.schemas.metrics.Counter(*, value: str)¶
Counter is a prometheus counter metric.
- class tugboat.schemas.metrics.Gauge(*, operation: str | None = None, realtime: bool | None = None, value: str)¶
Gauge is a prometheus gauge metric.
- class tugboat.schemas.metrics.Histogram(*, buckets: Array[int | float], value: str)¶
Histogram is a prometheus histogram metric.
tugboat.schemas.workflow module¶
- class tugboat.schemas.workflow.WorkflowSpec(**data: Any)¶
WorkflowSpec is the specification of a Workflow.
- workflowTemplateRef: WorkflowTemplateRef | None¶