Skip to content

Commit

Permalink
chore(docs): add Jina Deployment docs
Browse files Browse the repository at this point in the history
  • Loading branch information
subbuv26 committed Oct 13, 2023
1 parent 8cea02a commit e65026f
Show file tree
Hide file tree
Showing 13 changed files with 213 additions and 0 deletions.
Binary file added docs/concepts/jcloud/img/deployment/deploy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/list_all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/recreate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/restart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/resume.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/concepts/jcloud/img/deployment/update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
213 changes: 213 additions & 0 deletions docs/concepts/jcloud/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,219 @@ jc job logs myjob1 -f rich-husky-af14064067
:width: 90%
```

## Deployments

### Deploy

In Jina's idiom, a project is a [Deployment](https://docs.jina.ai/concepts/orchestration/Deployment/), which represents an end-to-end task such as indexing, searching or recommending. In this document, we use "project" and "Deployment" interchangeably.

```{caution}
When `jcloud` deploys a deployment it automatically appends the following global arguments to the `deployment.yml`, if not present:
```

```yaml
jcloud:
version: jina-version
docarray: docarray-version
```
#### Single YAML file
A self-contained YAML file, consisting of all configuration at the [Deployment](https://docs.jina.ai/concepts/orchestration/deployment/)-level and [Executor](https://docs.jina.ai/concepts/serving/executor/)-level.
> A Deployment's `uses` must follow the format `jinaai+docker://<username>/MyExecutor` (from [Executor Hub](https://cloud.jina.ai)) to avoid any local file dependencies:

```yaml
# deployment.yml
jtype: Deployment
with:
protocol: grpc
uses: jinaai+docker://jina-ai/Sentencizer
```

To deploy:

```bash
jc deployment deploy ./deployment.yaml
```

The Deployment is successfully deployed when you see:

```{figure} img/deployment/deploy.png
:width: 70%
```
---

You will get a Deployment ID, say `pretty-monster-130a5ac952`. This ID is required to manage, view logs and remove the Deployment.

As this Deployment is deployed with the default gRPC protocol (feel free to change it to `http`), you can use `jina.Client` to access it:

```python
from jina import Client, Document
print(
Client(host='grpcs://executor-pretty-monster-130a5ac952.wolf.jina.ai').post(
on='/', inputs=Document(text='hello')
)
)
```

(jcloud-deployoment-status)=
### Get status

To get the status of a Deployment:
```bash
jc deployment status pretty-monster-130a5ac952
```

```{figure} img/deployment/status.png
:width: 70%
```

### List Deployments

To list all of your "Starting", "Serving", "Failed", "Updating", and "Paused" Deployments:

```bash
jc deployment list
```

```{figure} img/deployment/list.png
:width: 90%
```

You can also filter your Deployments by passing a phase:

```bash
jc deployment list --phase Deleted
```


```{figure} img/deployment/list_deleted.png
:width: 90%
```

Or see all Deployments:

```bash
jc deployment list --phase all
```

```{figure} img/deployment/list_all.png
:width: 90%
```

### Remove Deployments
You can remove a single Deployment, multiple Deployments or even all Deployments by passing different identifiers.

To remove a single Deployment:

```bash
jc deployment remove pretty-monster-130a5ac952
```

To remove multiple Deployments:

```bash
jc deployment remove pretty-monster-130a5ac952 artistic-tuna-ab154c4dcc
```

To remove all Deployments:

```bash
jc deployment remove all
```

By default, removing multiple or all Deployments is an interactive process where you must give confirmation before each Deployment is deleted. To make it non-interactive, set the below environment variable before running the command:

```bash
export JCLOUD_NO_INTERACTIVE=1
```

### Update a Deployment
You can update a Deployment by providing an updated YAML.

To update a Deployment:

```bash
jc deployment update pretty-monster-130a5ac952 deployment.yml
```

```{figure} img/deployment/update.png
:width: 70%
```

### Pause / Resume Deployment

You have the option to pause a Deployment that is not currently in use but may be needed later. This will allow the Deployment to be resumed later when it is needed again by using `resume`.

To pause a Deployment:

```bash
jc deployment pause pretty-monster-130a5ac952
```

```{figure} img/deployment/pause.png
:width: 70%
```

To resume a Deployment:

```bash
jc eployment resume pretty-monster-130a5ac952
```

```{figure} img/deployment/resume.png
:width: 70%
```

### Restart Deployment

To restart a Deployment:

```bash
jc deployment restart pretty-monster-130a5ac952
```

```{figure} img/deployment/restart.png
:width: 70%
```

### Recreate a Deleted Deployment

To recreate a deleted Deployment:

```bash
jc deployment recreate pretty-monster-130a5ac952
```

```{figure} img/deployment/recreate.png
:width: 70%
```

### Scale a Deployment
You can also manually scale any Deployment.

```bash
jc deployment scale pretty-monster-130a5ac952 --replicas 2
```

```{figure} img/deployment/scale.png
:width: 70%
```

### Get Deployment logs

To get the Deployment logs:

```bash
jc deployment logs pretty-monster-130a5ac952
```

```{figure} img/deployment/logs.png
:width: 70%
```

## Configuration

Please refer to {ref}`Configuration <jcloud-configuration>` for configuring the Flow on Jina AI Cloud.
Expand Down

0 comments on commit e65026f

Please sign in to comment.