Introducing plugin2cube: Simplifying Plugin Registration in CUBE
Author: Blake Bradford
April 5, 2023
Are you tired of the complexity and extra steps involved in registering ChRIS plugins to a CUBE instance via a ChRIS Store? If so, we have great news for you! The plugin2cube utility app is here to simplify the process by allowing direct registration of plugins to CUBE, without the need for an intermediary store. In this article, we will explore the key features of plugin2cube, its installation process, and provide examples of how to use it effectively.
Key Features
Plugin2cube provides a streamlined approach to plugin registration in CUBE. Here are some of its key features:
-
Direct Registration: By leveraging updates to the CUBE API, plugin2cube enables the direct registration of a plugin image to a CUBE instance.
-
Portable Plugin Management: With plugin2cube, managing plugins in CUBE becomes simpler and more portable, eliminating the need for a separate ChRIS Store.
-
Determining Plugin JSON Representation: Plugin2cube offers two mechanisms for resolving the plugin JSON representation. It can either read the representation from a file or run the plugin image to determine it.
-
Docker Dependency: Running the plugin image requires Docker to be present on the host executing plugin2cube. Docker is a crucial component for ensuring the seamless execution of plugins.
Installation and Usage
Getting started with plugin2cube is easy! Simply install it using pip:
bash
pip install plugin2cube
Once installed, you can register a plugin to CUBE by providing the necessary CLI flags and arguments. For a complete list of supported arguments, use the --man
flag:
shell
plugin2cube --man
To register a plugin, you need to specify the CUBE instance, the plugin JSON description, and additional parameters if needed. Here’s an example:
shell
plugin2cube --CUBEurl http://localhost:8000/api/v1/ \
--CUBEuser chris --CUBEpassword chris1234 \
--dock_image local/pl-imageProc \
--name pl-imageProc \
--public_repo https://github.com/FNNDSC/pl-imageProc
In this example, the plugin JSON representation is determined by running the plugin container. Make sure Docker is installed on the machine running plugin2cube for this to work seamlessly.
Debugging and Testing
For developers looking to debug plugin2cube, there is a simple mechanism in place. By using the --debug
flag, you can trigger an internal remote telnet session. Simply add Env.set_trace()
calls in the code where needed. Remember to keep these calls in the codebase since they are only active when the --debug
flag is passed.
Unit testing for plugin2cube is coming soon. Stay tuned for further updates on this.
Conclusion
Plugin2cube is a powerful utility app that simplifies plugin registration in CUBE. By enabling direct registration and eliminating the need for a ChRIS Store, it provides a more streamlined and portable solution for managing plugins. With plugin2cube, you can save time and effort while seamlessly integrating plugins into your CUBE instance. Install plugin2cube today and experience the ease of plugin registration like never before.
References
Note: The content in this article is based on the plugin2cube README located in the plugin2cube repository.
Leave a Reply