The Tool Registry is a crucial component of our platform that enables the registration and management of various tools. This document explains the structure of the Tool Registry and provides instructions on how to add new tools to it.
The Tool Registry relies on a registry.yaml file to maintain a comprehensive list of registered tools. Tools can be made public or private. In order for the tool registry configuration to be used, set the env TOOL_REGISTRY_CONFIG_PATH wherever this library is imported and used.
registry.yamlhelps register tools by specifying a tool image and version from a container registry.
- Public tools are openly accessible to all organizations and are readily available in the platform's
Workflowspage. These public tools are cataloged inpublic_tools.json. They are pulled from Docker hub and hence require no authentication.
- In contrast, private tools are documented in the
private_tools.jsonfile. This file is not tracked by git. These tools are meant for restricted or specialized use and are visible only to the running Unstract instance. They are generally pulled from a supported private container registry and hence require authentication.
-
Build the docker image for the tool that needs to be registered. This can be done with the Dockerfile residing in the tool's folder. Optionally this can be pushed to a registry of your choice.
docker build --pull --rm -f "tools/<tool_folder>/Dockerfile" -t <image_name>:<image_tag>
-
Refer the sample_registry.yaml and create a new
registry.yamlwith your desired tools. -
You can specify the tool's location using one of the following methods:
-
Local Path: If the tool is stored locally on your system, you can define it like this. The default tag is
latesttools: - local:<tool_image_name>:<tool_image_tag>
-
Docker: If the tool is available as a Docker image, define it as follows. The default tag is
latesttools: - docker:unstract/<tool_image_name>:<tool_image_tag>
-
-
Run the load_tools_to_json.py script. This script uses the
registry.yaml fileand updates theprivate_tools.jsonfile. -
Once the script has executed, the Tool Registry will be updated with the newly registered private tools.
-
Optionally in order to make the tool public, move the generated JSON to
public_tools.jsonand commit the changes. -
Users of the platform will be able to access and utilize all tools listed in both the user's
private_tools.jsonandpublic_tools.jsonfiles. This ensures that all available tools are accessible to the platform's users, whether they are public or private.
By following these steps, you can effectively add new private tools to the Tool Registry and make them available within the platform, enhancing the capabilities and offerings of the system.