DEPRECATED: DO NOT USE.
ALTERNATIVES:
- you can fork one of the built-in hello world examples to your own app. See here
Cookiecutter template for a Jina project
pip install jina[devel]
jina hub new --type app
It will start a wizard in CLI to guide you to create your first app. The resulting file structure should look like:
- MyAwesomeApp/
|
|- Dockerfile
|- README.md
|- requirements.txt
|- app.py
|- flows/
|- index.yml
|- query.yml
|- pods/
|- craft.yml
|- chunk.yml
|- doc.yml
|- encode.yml
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install -U cookiecutter
Generate a Jina project:
cookiecutter gh:jina-ai/cookiecutter-jina
Install Jina requirements:
cd MyAwesomeApp/
pip install .
Before running python app.py
, set environment variables like MAX_DOCS
and JINA_DATA_PATH
using export. For example:
export JINA_DATA_PATH='./data/startrek_tng.csv'
If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.
-
Once you have your own version working, add it to the Similar Cookiecutter Templates list above with a brief description.
-
It's up to you whether or not to rename your fork/own version. Do whatever you think sounds good.
Jina apps created with the methods above:
- Store their Pods in the
pods
directory - Store their Flows in the
flows
directory
We highly encourage you to use these methods for your own apps, and especially if you're planning to create examples for Jina.