Create#
To create your Executor, run:
jina hub new
For basic configuration (advanced configuration is optional but rarely necessary), you will be asked for:
Your Executor’s name
The path to the folder where it should be saved
After running the command, a project with the following structure will be generated:
MyExecutor/
├── executor.py
├── config.yml
├── README.md
├── requirements.txt
└── Dockerfile
executor.pycontains your Executor’s main logic.config.ymlis the Executor’s configuration file, where you can define__init__arguments using thewithkeyword. You can also define meta annotations relevant to the Executor, for getting better exposure on Executor Hub.requirements.txtdescribes the Executor’s Python dependencies.README.mddescribes how to use your Executor.Dockerfileis only generated if you choose advanced configuration.
Tips#
Use
jina hub newCLI to create an ExecutorTo create an Executor, always use this command and follow the instructions. This ensures the correct file structure.
You don’t need to manually write a Dockerfile
The build system automatically generates an optimized Dockerfile according to your Executor package.
Tip
In the jina hub new wizard you can choose from four Dockerfile templates: cpu, tf-gpu, torch-gpu, and jax-gpu.
If you push your Executor to the Executor Hub, you don’t need to bump the Jina version
Hub Executors are version-agnostic. When you pull an Executor from Executor Hub, it will select the right Jina version for you. You don’t need to upgrade your version of Jina.
Fill in metadata of your Executor correctly
Information you include under the
metaskey inconfig.ymlis displayed on Executor Hub.The specification can be found here<config.yml>.