Skip to content

Commit

Permalink
docs: update docker usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiniuYu committed Feb 22, 2023
1 parent bcd824c commit f029cb2
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/user-guides/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,21 +591,45 @@ The build argument `--build-arg GROUP_ID=$(id -g ${USER}) --build-arg USER_ID=$(

### Run

````{tab} PyTorch
```bash
docker run -p 51009:51000 -v $HOME/.cache:/home/cas/.cache --gpus all jinaai/clip-server
```
````
````{tab} ONNX
```bash
docker run -p 51009:51000 -v $HOME/.cache:/home/cas/.cache --gpus all jinaai/clip-server:master-onnx onnx-flow.yml
```
````
````{tab} TensorRT
```bash
docker run -p 51009:51000 -v $HOME/.cache:/home/cas/.cache --gpus all jinaai/clip-server:master-tensorrt tensorrt-flow.yml
```
````

Here, `51009` is the public port on the host and `51000` is the {ref}`in-container port defined inside YAML<flow-config>`. The argument `-v $HOME/.cache:/home/cas/.cache` leverages host's cache and prevents you to download the same model next time on start.

Due to the limitation of the terminal inside Docker container, you will **not** see the classic Jina progress bar on start. Instead, you will face a few minutes awkward silent while model downloading and then see "Flow is ready to serve" dialog.

To pass a YAML config from the host, one can do:

````{tab} PyTorch
```bash
cat my.yml | docker run -i -p 51009:51000 -v $HOME/.cache:/home/cas/.cache --gpus all jinaai/clip-server -i
```
````
````{tab} ONNX
```bash
cat my.yml | docker run -i -p 51009:51000 -v $HOME/.cache:/home/cas/.cache --gpus all jinaai/clip-server:master-onnx -i
```
````
````{tab} TensorRT
```bash
cat my.yml | docker run -i -p 51009:51000 -v $HOME/.cache:/home/cas/.cache --gpus all jinaai/clip-server:master-tensorrt -i
```
````

The CLI usage is the same {ref}`as described here <start-server>`.
The CLI usage is the same {ref}`as described here <server-address>`.

```{tip}
You can enable debug logging via: `docker run --env JINA_LOG_LEVEL=debug ...`
Expand Down

0 comments on commit f029cb2

Please sign in to comment.