Simplify deploying and managing Jina projects on Jina Cloud
☁️ To the cloud! - Smoothly deploy a local project as a cloud service. Radically easy, no brainfuck.
🎯 Cut to the chase - One CLI with five commands to manage the lifecycle of your Jina projects.
🎟️ Early free access - Sneak peek at our stealthy cloud hosting platform. Built on latest cloud-native tech stack, we now host your Jina project and offer computational and storage resources, for free!
pip install jcloud
jc -h
In case jc
is already occupied by another tool, please use jcloud
instead. If your pip install doesn't register bash command for you, you can do python -m jcloud -h
.
jc login
You can use Google/Github account to register and login. Without login, you can do nothing.
In Jina's idiom, a project is a Flow, which represents an end-to-end task such as indexing, searching, recommending. In the sequel, we will use "project" and "Flow" interchangeably.
A Flow can have two types of file structure:
- A folder: just like a regular Python project, you can have sub-folders of Executor implementations; and a
flow.yml
on the top-level to connect all Executors together. You can create an example project folder viajc new
. This is often used in prototyping. - A single YAML file: a self-contained YAML file, consisting of all configs at the Flow-level and Executor-level. Note that, all Executors'
uses:
must followuses: jinahub+docker://MyExecutor
(from Jina Hub) oruses: docker://your_dockerhub_org/MyExecutor
(from Docker Hub) to avoid any local file dependency. This is often used in production.
jc new ./hello
jc deploy ./hello
jc deploy toy.yml
The simplest toy.yml
looks like the following:
jtype: Flow
executors: {}
Flow is successfully deployed when you see:
You will get a Flow ID, say 84b8b495df
. This ID is required to manage, view logs and remove the Flow.
As this Flow is deployed with default gRPC gateway (feel free changing it to http or websocket), you can use jina.Client
to access it:
from jina import Client, Document
c = Client(host='grpcs://84b8b495df.wolf.jina.ai')
print(c.post('/', Document(text='hello')))
By default, jcloud
allocates 100M
of RAM to each Executor. There might be cases where your Executor requires more memory. For example, DALLE-mini (generating image from text prompt) would need more than 100M to load the model. Here's how you can request for more memory while deploying the Flow (max 16G allowed per Executor).
jtype: Flow
with:
protocol: http
executors:
- name: dalle_mini
uses: jinahub+docker://DalleMini
resources:
memory: 8G
To watch the logs in realtime.
jc logs 84b8b495df
You can also stream logs for a particular executor by passing its name.
jc logs 84b8b495df --executor sentencizer
jc remove 84b8b495df
jc status 84b8b495df
jc list
You can only see the Flows deployed by you.
You can also filter your Flows by passing a status.
jc list --status DELETED
To make the output more verbose, you can add --loglevel DEBUG
before each CLI subcommand, e.g.
jc --loglevel DEBUG deploy toy.yml
gives you more comprehensive output.
-
Why does it take a while on every operation of
jcloud
?Because the event listener at Jina Cloud is serveless by design, which means it spawns an instance on-demand to process your requests from
jcloud
. Note that operation such asdeploy
,remove
injcloud
is not high-frequent. Hence, having a serveless listener is much more cost-efficient than an always-on listener. The downside is slower operations, nevertheless this does not affect the deployed service. Your deployed service is always on. -
How long do you persist my service?
Until you manually
remove
it, we will persist your service as long as possible. -
Is everything free?
Yes! We just need your feedback - use
jc survey
to help us understand your needs. -
How powerful is Jina Cloud?
Jina Cloud scales according to your need. You can demand for the resources your Flow requires. If there's anything particular you'd be looking for, you can contact us on Slack or let us know via
jc survey
. -
How do I send request to a HTTP server?
First, you need to set the Flow protocol to
http
. Then make sure you are sending to/post
endpoint, e.g.curl -X POST https://6893976a58.wolf.jina.ai/post -H 'Content-Type: application/json' -d '{"data":[{"text": "hello, world!"}], "execEndpoint":"/"}'
- Check out the Learning Bootcamp to get started with DocArray.
- Join our Slack community and chat with other community members about ideas.
- Join our Engineering All Hands meet-up to discuss your use case and learn Jina's new features.
- When? The second Tuesday of every month
- Where? Zoom (see our public events calendar/.ical) and live stream on YouTube
- Subscribe to the latest video tutorials on our YouTube channel
JCloud is backed by Jina AI and licensed under Apache-2.0. We are actively hiring AI engineers, solution engineers to build the next neural search ecosystem in open-source.