Skip to content

Commit

Permalink
docs: fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Apr 21, 2020
1 parent 5c6ccdf commit 4a2bfae
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 117 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Want to build a search system backed by deep learning? Then you come to the righ

**🌌 The Universal Search Solution** - Jina enables large-scale index and query of any kind on multiple platforms and architectures. Whether you are searching for images, video clips, audio snippets, long legal documents, short tweets, Jina can handle them all.

**🚀 High Preformat & State-of-the-Art** - Jina aims at AI-in-production. You can easily scale out your VideoBERT, Xception, your word tokenizer, image segmenter and database to handle billion-level data.
**🚀 High Preformat & State-of-the-Art** - Jina aims at AI-in-production. You can easily scale out your VideoBERT, Xception, your word tokenizer, image segmenter and database to handle billion-level data. Features such as replicas and shards come off-the-shelf.

**🐣 System Engineering Made Easy** - Jina offers an one-stop solution that frees you from handcrafting and gluing packages, libraries and database. With the most intuitive API and [dashboard UI](https://github.com/jina-ai/dashboard), building a cloud-native search system is just a minute thing.

Expand Down Expand Up @@ -309,15 +309,15 @@ We welcome all kinds of contributions from the open-source community, individual
The following resources help you to make a good first contribution:

- [Contributing guidelines](CONTRIBUTING.md)
- [Release cycles and developement stages](RELEASE.md)
- [Release cycles and development stages](RELEASE.md)

## Community

- [Slack chanel](https://join.slack.com/t/jina-ai/shared_invite/zt-dkl7x8p0-rVCv~3Fdc3~Dpwx7T7XG8w) - a communication platform for developers to discuss Jina
- [Community newsletter](mailto:newsletter+subscribe@jina.ai) - subscribe to the latest update, release and event news of Jina
- [LinkedIn](https://www.linkedin.com/showcase/31268045/) - get to know Jina AI as a company
- ![Twitter Follow](https://img.shields.io/twitter/follow/JinaAI_?label=Follow%20%40JinaAI_&style=social) - follow us and interact with us using hashtag `#JinaSearch`
- [Join Us](mailto:hr@jina.ai) - want to work full-time with us on Jina?
- [Join Us](mailto:hr@jina.ai) - want to work full-time with us on Jina? We are hiring!
- [Company](https://jina.ai) - know more about our company, we are fully committed to open-source!

## Roadmap
Expand All @@ -342,5 +342,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More legal notice can be found in [jina-ai/legal](https://github.com/jina-ai/legal).
49 changes: 48 additions & 1 deletion docs/_static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@
src: url(OpenSans-Regular.ttf);
}

.wy-menu-vertical li.toctree-l2 a, .wy-menu-vertical li.toctree-l3 a, .wy-menu-vertical li.toctree-l4 a {
color: white;
}

.fa-minus-square-o:before, .wy-menu-vertical li.on a span.toctree-expand:before, .wy-menu-vertical li.current > a span.toctree-expand:before {
content: "\f055";
color: white;
}

.wy-menu-vertical li.on a span.toctree-expand, .wy-menu-vertical li.current > a span.toctree-expand {
/* line-height: 1.6em; */
/* color: #333; */
/* top: 50%; */
/* vertical-align: middle; */
/* vertical-align: -50%; */
padding-top: .8em;
/* padding-right: 1em; */
/* margin-left: -1em; */
}

p.caption:before {
content: "\f055";
font-family: FontAwesome;
Expand Down Expand Up @@ -422,9 +442,36 @@ input {
top: 10%;
z-index: 99;
padding: 15px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
border-radius: 5px;
opacity: 0.2
}

.rst-content .note .admonition-title {
background: #32C8CD;
border-radius: 10px 10px 0px 0px;
}

.wy-alert.wy-alert-info, .rst-content .note, .rst-content .wy-alert-info.attention, .rst-content .wy-alert-info.caution, .rst-content .wy-alert-info.danger, .rst-content .wy-alert-info.error, .rst-content .wy-alert-info.hint, .rst-content .wy-alert-info.important, .rst-content .wy-alert-info.tip, .rst-content .wy-alert-info.warning, .rst-content .seealso, .rst-content .wy-alert-info.admonition-todo, .rst-content .wy-alert-info.admonition {
background: rgba(50, 200, 205, 0.2);
border-radius: 10px;
}


.rst-content .warning .admonition-title {
background: #ff6666;
border-radius: 10px 10px 0px 0px;
}


.wy-alert.wy-alert-warning, .rst-content .wy-alert-warning.note, .rst-content .attention, .rst-content .caution, .rst-content .wy-alert-warning.danger, .rst-content .wy-alert-warning.error, .rst-content .wy-alert-warning.hint, .rst-content .wy-alert-warning.important, .rst-content .wy-alert-warning.tip, .rst-content .warning, .rst-content .wy-alert-warning.seealso, .rst-content .admonition-todo, .rst-content .wy-alert-warning.admonition {
background: rgba(255, 102, 102, 0.2);
border-radius: 10px;
}

.table-of-contents:hover {
opacity: 1.0;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.table-of-contents li::before {
Expand Down
18 changes: 0 additions & 18 deletions docs/chapters/install/via-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,3 @@ This Docker image is based on `python:3.7.6-slim` and can be run on the followin
- arm/v6

No extra steps is required to run on those architectures, simply do `docker run jinaai/jina`

## Other Jina Docker Image Mirrors

### Github Package

> 🚨 Github Docker Registry does not support multi-architecture Docker image, so if you want to run Jina Docker image on non-amd64 architecture, please [use the DockerHub image instead](#running-jina-image).
```bash
docker login -u USERNAME -p TOKEN docker.pkg.github.com
docker run docker.pkg.github.com/jina-ai/jina/jina:[tag]
```

### Tencent Cloud (Too slow to upload)

```bash
docker login -u USERNAME -p TOKEN ccr.ccs.tencentyun.com
docker run ccr.ccs.tencentyun.com/jina/jina:[tag]
```
94 changes: 1 addition & 93 deletions docs/chapters/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,96 +43,4 @@ Probably MacOS only.
```bash
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
```


## Check if docker swarm/stack runs successfully

```bash
docker service ls
```

```text
ID NAME MODE REPLICAS IMAGE PORTS
j7b533zxmzg5 jina-swarm-2654_encoder replicated 0/1 ccr.ccs.tencentyun.com/jina/aipd-jina:master
0vlxu4acg1ph jina-swarm-2654_income-proxy replicated 0/1 ccr.ccs.tencentyun.com/jina/aipd-jina:master *:4962->4962/tcp
equqrhsn7pky jina-swarm-2654_indexer replicated 0/3 ccr.ccs.tencentyun.com/jina/aipd-jina:master
nd7euo7mcpa9 jina-swarm-2654_middleman-proxy replicated 0/1 ccr.ccs.tencentyun.com/jina/aipd-jina:master
ssdlk9gzmggw jina-swarm-2654_outgoing-proxy replicated 0/1 ccr.ccs.tencentyun.com/jina/aipd-jina:master *:4963->4963/tcp
xgxeetyhos6t my-jina_encoder replicated 1/1 ccr.ccs.tencentyun.com/jina/aipd-jina:a799a0f
zny37400p225 my-jina_income-proxy replicated 1/1 ccr.ccs.tencentyun.com/jina/aipd-jina:a799a0f *:8598->8598/tcp
taqqg6qwrxlw my-jina_indexer replicated 3/3 ccr.ccs.tencentyun.com/jina/aipd-jina:a799a0f
j96gnny8ysbn my-jina_middleman-proxy replicated 1/1 ccr.ccs.tencentyun.com/jina/aipd-jina:a799a0f
e28spnuksjw8 my-jina_outgoing-proxy replicated 1/1 ccr.ccs.tencentyun.com/jina/aipd-jina:a799a0f *:8599->8599/tcp
```

In the above example, we started two swarms, i.e. `jina-swarm-2654` and `my-jina`. Unfortunately, `jina-swarm-2654` fails to start and is not running at all. But how can one tell that?

Note the column `REPLICAS`, which indicates the number of running service (versus the number of required services). `jina-swarm-2654` gives `0/0` for all services. This suggests the swarm fails to start. The next step is to investigate the reason.

## Investigate the reason of a failed service

One can not print out all logs of a docker swarm. Instead, one can inspect service by service, e.g.

```bash
docker service ps jina-swarm-2654_encoder --format "{{json .Error}}" --no-trunc
```

```text
"\"invalid mount config for type \"bind\": bind source path does not exist: /data/han/test-shell/output_data\""
"\"invalid mount config for type \"bind\": bind source path does not exist: /data/han/test-shell/output_data\""
"\"invalid mount config for type \"bind\": bind source path does not exist: /data/han/test-shell/output_data\""
"\"invalid mount config for type \"bind\": bind source path does not exist: /data/han/test-shell/output_data\""
```

Now the reason is clear, `output_data` does not exist when starting the swarm. But why there are duplicated lines there? This is because docker swarm did three retries before giving up on starting this service, where each time it met the same problem. Thus four duplicated lines in total.

## Delete a failed service

Now that the reason is clear, we can delete the failed service and release the resources.

```bash
docker stack rm jina-swarm-2654
```

```text
Removing service jina-swarm-2654_encoder
Removing service jina-swarm-2654_income-proxy
Removing service jina-swarm-2654_indexer
Removing service jina-swarm-2654_middleman-proxy
Removing service jina-swarm-2654_outgoing-proxy
Removing network jina-swarm-2654_jina-net
```

## Locate internal errors by looking at logs

Sometime the service fails to start but `docker service ps` gives no error,

```bash
docker service ps jina-swarm-4254_encoder --format "{{json .Error}}" --no-trunc
```

```text
""
```

Or it shows an error that is not explanatory.

```bash
"\"task: non-zero exit (2)\""
```

Often in this case, the service fails to start *not* due tothe docker config, but due to the JINA internal error. To see that,

```bash
docker service logs jina-swarm-4254_income-proxy
```

```bash
jina-swarm-4254_income-proxy.1.yj5v8n4dhfgv@VM-0-3-ubuntu | [--proxy-type {BS,Dict,MapProxyService,Message,MessageHandler,ProxyService,ReduceProxyService,defaultdict}]
jina-swarm-4254_income-proxy.1.yj5v8n4dhfgv@VM-0-3-ubuntu | [--batch-size BATCH_SIZE] [--num-part NUM_PART]
jina-swarm-4254_income-proxy.1.kmgk21qo6m0n@VM-0-3-ubuntu | [--proxy-type {BS,Dict,MapProxyService,Message,MessageHandler,ProxyService,ReduceProxyService,defaultdict}]
jina-swarm-4254_income-proxy.1.w04d552cuj93@VM-0-3-ubuntu | jina proxy: error: argument --batch-size: invalid int value: ''
jina-swarm-4254_income-proxy.1.kmgk21qo6m0n@VM-0-3-ubuntu | [--batch-size BATCH_SIZE] [--num-part NUM_PART]
```

One can now clearly see that the error comes from an incorrectly given `--batch-size`, which throws from JINA CLI.

0 comments on commit 4a2bfae

Please sign in to comment.