Skip to content

Commit

Permalink
docs(hub): add description about the tag of hub (#3125)
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleeit authored Aug 11, 2021
1 parent 42d493f commit b7a1cf7
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/2.0/cookbooks/Hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ $ jina hub push <path_to_executor_folder> -t TAG1 -t TAG2 -f <path_to_dockerfile

You can specify `-t` or `--tags` parameters to tag one Executor. In additional, you can specify `-f` or `--docker-file` parameters to use a specific docker file to build your Executor.

If there is no `-t` parameter provided, the default tag is `latest`. And if you provide `-t` parameters, and you still want to have `latest` tag, you must write it as one `-t` parameter.

```bash
$ jina hub push . # Result in one tag: latest
$ jina hub push . -t v1.0.0 # Result in one tag: v1.0.0
$ jina hub push . -t v1.0.0 -t latest # Result in two tags: v1.0.0, latest
```

## 3. Update Executor in JinaHub

### 3.1 Basic
Expand Down Expand Up @@ -115,15 +123,19 @@ $ jina hub push [--public/--private] --force <UUID> --secret <SECRET> -t TAG <pa
### 4.1 Docker Image

```bash
$ jina hub pull jinahub+docker://<UUID>[:<SECRET>]
$ jina hub pull jinahub+docker://<UUID>[:<SECRET>][/<TAG>]
```

You can find the Executor by running this command `docker images`.
You can find the Executor by running this command `docker images`. You can also indicate which version of the Executor you want to use by naming the `/<TAG>`.

```bash
$ jina hub pull jinahub+docker://DummyExecutor/v1.0.0
```

### 4.2 Source Code

```bash
$ jina hub pull jinahub://<UUID>[:<SECRET>]
$ jina hub pull jinahub://<UUID>[:<SECRET>][/<TAG>]
```

It will store Executor source code to `~/.jina/hub-packages`.
Expand All @@ -148,6 +160,8 @@ from jina import Flow
f = Flow().add(uses='jinahub+docker://<UUID>[:<SECRET>][/<TAG>]')
```

If there is no `/<TAG>` provided when using, it by default equals to `/latest`, which means using the `latest` tag.

**Attention:**

If you are a Mac user, please use `host.docker.internal` as your url when you want to connect a local port from Executor
Expand Down Expand Up @@ -185,7 +199,7 @@ any of these parameters by passing `uses_with` and `uses_metas` as parameters.
```python
from jina import Flow

f = Flow().add(uses='jinahub://<UUID>[:<SECRET>]',
f = Flow().add(uses='jinahub://<UUID>[:<SECRET>][/<TAG>]',
uses_with={'param1': 'new_value'},
uses_metas={'name': 'new_name'})
```
Expand Down

0 comments on commit b7a1cf7

Please sign in to comment.