Pieces repository
The easiest way to start your Pieces repository is to use our Template for Pieces repository.
You can either clone it using git or use our CLI command domino pieces create
.
A Pieces repository is a git repository that contains multiple Pieces available to be used in Domino Workflows. A Domino Pieces repository should contain:
- a
pieces/
folder containing all Pieces folders - a dependencies/ folder with all
Dockerfile
andrequirements.txt
files defined as Pieces dependencies - a config.toml configuration file
- a
.domino/
folder containing thedependencies_map.json
andcompiled_metadata.json
files, which are automatically generated by the Github
dependencies/
├── Dockerfile_2
└── requirements_1.txt
pieces/
└── FirstPiece/
├── metadata.json
├── models.py
├── piece.py
└── test_firstpiece.py
└── SecondPiece/
├── metadata.json
├── models.py
├── piece.py
└── test_secondpiece.py
config.toml
Piece Folder
The pieces/
folder should contain all the Pieces in the repository. Each Piece folder name should have the sufix Piece
and follow a standard organization and contain certain information to be able to be found and used by your deployed Domino instance. Example:
pieces/
└── FirstPiece/
├── metadata.json
├── models.py
└── piece.py
For detailed information on how to create a Piece, see Create Pieces.
Dependencies
The /dependencies
folder should contain all the requirements.txt
and Dockerfile
files that were defined as dependencies in the metadata.json
files of the Pieces in this repository. Example:
dependencies/
├── Dockerfile_1
├── requirements_1.txt
└── requirements_2.txt
config.toml
The config.toml
file stores the configuration variables for the repository. Example:
[repository]
# The name of the github owner, must be in lower-case letters
REGISTRY_NAME = "github_owner_name"
# The name of this Pieces repository
REPOSITORY_NAME = "example_pieces"
# The label of this Pieces repository, as it will appear in Domino GUI
REPOSITORY_LABEL = "OpenAI Domino Pieces"
# The version of this Pieces release
VERSION = "0.1.0"
Github actions
Our Template for Pieces repository provides out-of-the box Github actions to validate, organize and publish your Pieces images.
Whenever the config.toml
file of a pieces repository is updated, the actions will run and some files will be automatically created or modified inside the repository's /.domino
folder:
- A
dependencies_map.json
file - A
compiled_metadata.json
file
Besides that, the actions will also create the following artifacts within the repository:
- A
VERSION.tar.gz
file will be created as a release asset - Docker images will be built and published to the repository's container registry (in Github this is named Packages). One image will be created for each dependency group, as defined in
.domino/dependencies_map.json
file.
For the actions to run successfully, make sure that under your repository Settings -> Action -> General -> Workflow permissions
the option Read and write permissions
is selected.
The actions are triggered only when the config.toml
file is updated.