Using Jina remotely with Jina Daemon¶
Jina Daemon, is a persistent process for deploying and managing Jina Flow, Pods, and Peas in a distributed system.
Workflow: a set of connected pods for accomplishing certain task, e.g. indexing, searching, extracting.
Flow API: a pythonic way for users to construct workflows in Jina with clean, readable idioms.
Remote, remote instance, remote machine: the place where you want to run the pod, the place offers better computational capability or larger storage. For example, one may want to run an encode pod on the remote GPU instance.
Local, local instance, local machine: the place of your entrypoint and the rest parts of your workflow.
jinad is designed to maintain bookkeeping for the running Flows, Pods and Peas on the remote machines.
jinad can also spawn Pods and Peas to other remote machines that have
fluentd is used to collect logs from different Processes and ensure the logs belonging to the same Flow are stored consistently.
Using Docker Images (Recommended)¶
In the command below, we use the tag
latest-daemon which uses the latest release version of
jinad. Of course, you can switch to other versions, and you can find all the available versions at hub.docker.com. You can found more information about the versioning at github.com/jina-ai/jina.
docker pull jinaai/jina:latest-daemon
Using PyPi package¶
Notes: As one part of the jina package,
jinadfollows the same installation instructions of jina and you only need to cherry pick
On Linux/Mac, simply run:
pip install "jina[daemon]"
Install from the Master Branch¶
If you want to keep track of the master branch of our development repository:
pip install "git+https://github.com/jina-ai/jina.git#egg=jina[daemon]"
Install from Your Local Fork/Clone¶
If you are a developer and want to test your changes on-the-fly:
git clone https://github.com/jina-ai/jina cd jina && pip install -e ".[daemon]"
jinad on the remote machine. We assume the remote is in the intranet and its IP address is
188.8.131.52. By default,
jinad will use the port
8000 for receiving requests. Make sure
8000 port is publicly accessible.
jinad running on the remote, you can open the browser the visit
http://184.108.40.206:8000/alive to check whether
jinad is properly set up. If everythong works well, you will see the following response.
Using Docker Container¶
We start a Docker container under the
host mode so that it will connect all the ports to the host machine.
-d option is to keep the container running in the background
docker run -d --network host jinaai/jina:latest-daemon
Using Native Python¶