Configuration via tesseract_config.yaml

The tesseract_config.yaml file contains a Tesseract’s metadata, such as its name, description, version, and build configuration.

Example file

name: "helloworld"
version: "1.0.0"
description: "A sample Python app"

build_config:
  # Base image to use for the container, must be Ubuntu or Debian-based
  # with Python 3.9 or later
  # base_image: "python:3.12-slim-bookworm"

  # Platform to build the container for. In general, images can only be executed
  # on the platform they were built for.
  # target_platform: "native"

  # Additional packages to install in the container (via apt-get)
  # extra_packages:
  #  - package_name

  # Data to copy into the container, relative to the project root
  # package_data:
  #  - [path/to/source, path/to/destination]

  # Additional Dockerfile commands to run during the build process
  # custom_build_steps:
  #  - |
  #   RUN echo "Hello, World!"

Schema

The TesseractConfig class is used to define the schema for the tesseract_config.yaml file. It contains the following fields:

pydantic model tesseract_core.sdk.api_parse.TesseractConfig[source]

Configuration options for Tesseracts. Defines valid options in tesseract_config.yaml.

Show JSON schema
{
   "title": "TesseractConfig",
   "description": "Configuration options for Tesseracts. Defines valid options in ``tesseract_config.yaml``.",
   "type": "object",
   "properties": {
      "name": {
         "description": "Name of the Tesseract.",
         "title": "Name",
         "type": "string"
      },
      "version": {
         "default": "0+unknown",
         "description": "Version of the Tesseract.",
         "title": "Version",
         "type": "string"
      },
      "description": {
         "default": "",
         "description": "Free-text description of what the Tesseract does.",
         "title": "Description",
         "type": "string"
      },
      "build_config": {
         "$ref": "#/$defs/TesseractBuildConfig",
         "description": "Configuration options for building the Tesseract."
      }
   },
   "$defs": {
      "TesseractBuildConfig": {
         "additionalProperties": false,
         "description": "Configuration options for building a Tesseract.",
         "properties": {
            "base_image": {
               "default": "python:3.12-slim-bookworm",
               "description": "Base Docker image for the build. Must be Debian-based.",
               "title": "Base Image",
               "type": "string"
            },
            "target_platform": {
               "default": "native",
               "description": "Target platform for the Docker build. Must be a valid Docker platform, or 'native' to build for the host platform. In general, images built for one platform will not run on another.",
               "title": "Target Platform",
               "type": "string"
            },
            "extra_packages": {
               "default": [],
               "description": "Extra packages to install during build via apt-get.",
               "items": {
                  "type": "string"
               },
               "title": "Extra Packages",
               "type": "array"
            },
            "package_data": {
               "anyOf": [
                  {
                     "items": {
                        "maxItems": 2,
                        "minItems": 2,
                        "prefixItems": [
                           {
                              "type": "string"
                           },
                           {
                              "type": "string"
                           }
                        ],
                        "type": "array"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Additional files to copy into the Docker image, in the format ``(source, destination)``. Source paths are relative to the Tesseract directory.",
               "title": "Package Data"
            },
            "custom_build_steps": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Custom steps to run during ``docker build`` (after everything else is installed). Example: ``[\"RUN echo 'Hello, world!'\"]``",
               "title": "Custom Build Steps"
            }
         },
         "title": "TesseractBuildConfig",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "name"
   ]
}

Fields:
field name: Annotated[str] [Required]

Name of the Tesseract.

Constraints:
  • strict = True

field version: Annotated[str] = '0+unknown'

Version of the Tesseract.

Constraints:
  • strict = True

field description: Annotated[str] = ''

Free-text description of what the Tesseract does.

Constraints:
  • strict = True

field build_config: Annotated[TesseractBuildConfig] [Optional]

Configuration options for building the Tesseract.

Constraints:
  • func = <function <lambda> at 0x733d557bfd80>

  • json_schema_input_type = PydanticUndefined

pydantic model tesseract_core.sdk.api_parse.TesseractBuildConfig[source]

Configuration options for building a Tesseract.

Show JSON schema
{
   "title": "TesseractBuildConfig",
   "description": "Configuration options for building a Tesseract.",
   "type": "object",
   "properties": {
      "base_image": {
         "default": "python:3.12-slim-bookworm",
         "description": "Base Docker image for the build. Must be Debian-based.",
         "title": "Base Image",
         "type": "string"
      },
      "target_platform": {
         "default": "native",
         "description": "Target platform for the Docker build. Must be a valid Docker platform, or 'native' to build for the host platform. In general, images built for one platform will not run on another.",
         "title": "Target Platform",
         "type": "string"
      },
      "extra_packages": {
         "default": [],
         "description": "Extra packages to install during build via apt-get.",
         "items": {
            "type": "string"
         },
         "title": "Extra Packages",
         "type": "array"
      },
      "package_data": {
         "anyOf": [
            {
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "type": "string"
                     },
                     {
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Additional files to copy into the Docker image, in the format ``(source, destination)``. Source paths are relative to the Tesseract directory.",
         "title": "Package Data"
      },
      "custom_build_steps": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Custom steps to run during ``docker build`` (after everything else is installed). Example: ``[\"RUN echo 'Hello, world!'\"]``",
         "title": "Custom Build Steps"
      }
   },
   "additionalProperties": false
}

Fields:
field base_image: Annotated[str] = 'python:3.12-slim-bookworm'

Base Docker image for the build. Must be Debian-based.

Constraints:
  • strict = True

field target_platform: Annotated[str] = 'native'

Target platform for the Docker build. Must be a valid Docker platform, or ‘native’ to build for the host platform. In general, images built for one platform will not run on another.

Constraints:
  • strict = True

field extra_packages: tuple[Annotated[str], ...] = ()

Extra packages to install during build via apt-get.

field package_data: tuple[tuple[Annotated[str], Annotated[str]], ...] | None = ()

Additional files to copy into the Docker image, in the format (source, destination). Source paths are relative to the Tesseract directory.

field custom_build_steps: tuple[Annotated[str], ...] | None = ()

Custom steps to run during docker build (after everything else is installed). Example: ["RUN echo 'Hello, world!'"]