Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add JCloud deployment docs #739

Merged
merged 13 commits into from
Jun 8, 2022
Binary file added docs/user-guides/images/jc-deploy.png
Loading
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
Original file line number Diff line number Diff line change
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!