Skip to content

Commit

Permalink
docs: add JCloud deployment docs (#739)
Browse files Browse the repository at this point in the history
* docs: add jcloud deploy docs

* docs: add jcloud deployment docs

* docs: modify headline

* docs: add JCloud deployment docs

* docs: add jcloud deployment docs

* docs: fix images

* docs: fix jcloud header

* docs: replace jc image

* docs: highlight executor name; correct ID

* docs: better screenshot

* docs: better screenshot

* docs: better screenshot

* docs: remove unsed header; correct img
  • Loading branch information
ZiniuYu committed Jun 8, 2022
1 parent 4b88e99 commit 130108c
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
Binary file added docs/user-guides/images/jc-deploy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions docs/user-guides/server.md
Expand Up @@ -486,5 +486,70 @@ r = c.encode(
]
)
```
## Deploy on JCloud

You can deploy `CLIPTorchEncoder` on JCloud.
A minimum YAML file `flow.yml` is as follows:

```yaml
jtype: Flow
executors:
- name: CLIPTorchEncoder # The name of the encoder
uses: jinahub+docker://CLIPTorchEncoder
```

```{warning}
All Executors' `uses` must follow the format `jinahub+docker://MyExecutor` (from [Jina Hub](https://hub.jina.ai)) to avoid any local file dependencies.
```

To deploy,

```bash
$ jc deploy flow.yml
```

Here `jc deploy` is the command to deploy a Jina project to JCloud.
Learn more about [JCloud usage](https://github.com/jina-ai/jcloud).


The Flow is successfully deployed when you see:

```{figure} images/jc-deploy.png
:width: 60%
```

After deploying on jcloud, you can connect to it via client by setting `grpcs://` as follows:


```python
from clip_client import Client

c = Client('grpcs://174eb69ba3.wolf.jina.ai') # This is the URL you get from previous step

r = c.encode(
[
'First do it',
'then do it right',
'then do it better',
'https://picsum.photos/200',
]
)
print(r)
```

will give you:

```text
[[ 0.03480401 -0.23519686 0.01041038 ... -0.5229086 -0.10081214
-0.08695138]
[-0.0683605 -0.00324154 0.01490371 ... -0.50309485 -0.06193433
-0.08574048]
[ 0.15041807 -0.07933374 -0.06650036 ... -0.46410388 -0.08535041
0.04270519]
[-0.16183889 0.10636599 -0.2062868 ... -0.41244072 0.19485454
0.05658712]]
```


It means the client and the JCloud server are now connected. Well done!

0 comments on commit 130108c

Please sign in to comment.