Create#
To create your Hub Executor
, you just need to run:
jina hub new
For the basic configuration (advanced configuration is optional but rarely necessary), you will be asked for two things:
Name of your Executor
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.py
should contain your Executor’s main logic.config.yml
is the Executor’s configuration file, where you can define__init__
arguments usingwith
keyword. You can also define meta annotations relevant to the executor, for getting better exposer on Jina Hub.requirements.txt
describes the Executor’s Python dependencies.README.md
should describe how to use your Executor.Dockerfile
will only be generated once you request advanced configuration.
Tips#
When developing Hub Executor
s, make sure to follow these tips:
Use
jina hub new
CLI to create an ExecutorTo get started, always use the command and follow the instructions. This will ensure you follow the right file structure.
No need to write Dockerfile manually
Most of the time, you do not need to create
Dockerfile
manually. Build system will generate a well-optimized Dockerfile according to your Executor package.
Tip
In the wizard of jina hub new
, you can choose from four Dockerfile templates: cpu
, tf-gpu
, torch-gpu
, and jax-gpu
.
No need to bump Jina version
Hub executors are version-agnostic. When you pull an Executor from Hub, Hubble will always select the right Jina version for you. No worries about Jina version upgrade!
Fill in metadata of your Executor correctly
Information you include under the
metas
key, inconfig.yml
, will be displayed on our website. Want to make your Executor eye-catching on our website? Fill allmetas
fields inconfig.yml
with heart & love! Its specification can be found here.