Skip to content

Commit

Permalink
feat: add hello world yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Apr 17, 2020
1 parent 22eb415 commit e0e642e
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jina/resources/executors.requests.BaseVectorIndexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ on:
SearchRequest:
- !VectorSearchDriver {}
IndexRequest:
- !VectorIndexDriver {}
- !DocPruneDriver
with:
pruned: raw_bytes
- !VectorIndexDriver {}
- !ChunkPruneDriver {}
24 changes: 24 additions & 0 deletions jina/resources/helloworld.crafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
!CompoundExecutor
components:
- !MyDocCrafter
metas:
name: mycraft # a customized name
- !MySegmenter
metas:
name: myseg # a customized name
metas:
name: compound_crafter
requests:
on:
[IndexRequest, SearchRequest]:
- !DocCraftDriver
with:
executor: mycraft
- !SegmentDriver
with:
executor: myseg
- !DocPruneDriver
with:
pruned: raw_bytes # we will never use raw_bytes in the remaining pipeline
ControlRequest:
- !ControlReqDriver {}
4 changes: 4 additions & 0 deletions jina/resources/helloworld.encoder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!MyEncoder
metas:
name: myenc # a customized name
workspace: $HW_WORKDIR
20 changes: 20 additions & 0 deletions jina/resources/helloworld.flow.index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
!Flow
pods:
chunk_seg:
yaml_path: $RESOURCE_DIR/helloworld.crafter.yml
replicas: $REPLICAS
read_only: true
doc_idx:
yaml_path: $RESOURCE_DIR/helloworld.indexer.doc.yml
encode:
yaml_path: $RESOURCE_DIR/helloworld.encoder.yml
needs: chunk_seg
replicas: $REPLICAS
chunk_idx:
yaml_path: $RESOURCE_DIR/helloworld.indexer.chunk.yml
replicas: $SHARDS
separated_workspace: true
join_all:
yaml_path: _merge
needs: [doc_idx, chunk_idx]
read_only: true
21 changes: 21 additions & 0 deletions jina/resources/helloworld.flow.query.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
!Flow
with:
read_only: true # better add this in the query time
pods:
chunk_seg:
yaml_path: $RESOURCE_DIR/helloworld.crafter.yml
replicas: $REPLICAS
encode:
yaml_path: $RESOURCE_DIR/helloworld.encoder.yml
replicas: $REPLICAS
chunk_idx:
yaml_path: $RESOURCE_DIR/helloworld.indexer.chunk.yml
replicas: $SHARDS
separated_workspace: true
polling: all
reducing_yaml_path: _merge_topk_chunks
timeout_ready: 100000 # larger timeout as in query time will read all the data
ranker:
yaml_path: BiMatchRanker
doc_idx:
yaml_path: $RESOURCE_DIR/helloworld.indexer.doc.yml
36 changes: 36 additions & 0 deletions jina/resources/helloworld.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Jina Hello World!</title>
</head>
<body>
<div class="topnav" style="height: 30px;
margin-bottom: 20px;
background: #009999;
border-radius: 10px;
padding: 15px;">
<a class="logo" href="https://github.com/jina-ai/jina/" style="height: inherit;">
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOwAAABICAYAAAD1XhnsAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAA7KADAAQAAAABAAAASAAAAAB3FpgyAAAUNUlEQVR4Ae2dB7RUxRnHg72gYsMOD0WJWEBFxGNJNMZeMCqxxSieGGM5GhX12DiapoJGjeVoVDSWeDS2YCIeCxaMGjsidnhGRMUGFiwI5Pd/b+dx9+7M3C1z9+365jvnv/femW++75vvznen3Nndbj+oA82fP78HajYB64HVCliG4/wCvuD4dgGvc3yxW7duczhGih6IHkh4oFviPNgpAbokwnYAe4DtwdqgEl1fwf8MGA9uJ3gncowUPRA9ENIDBOrmYAz4EoSk1xF2OlgppL1RVvRAl/QAgbQjeArkTbNRcBX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UPRA/IAwSEVpCPANqkoTnmtaDjq04hvYTcIcC26JQOYgV2HAKHdH6UFT1QjQcIxMFgAjBzaO15fhPcAbSrq281cmOZ6IHogRw9QGCqZ9cur0jRAxV74P9PS0qyBQk2NwAAAABJRU5ErkJggg=="
style="
height: inherit;"></a>
</div>
<hr style="border: 1px dashed #009999;">
<div class="about" style="
max-width: 50%;
padding: 10px;">
<h2 style="color: #1E6E73">What is happening?</h2>
<span>This is Jina's <pre style="display: inline;">hello-world</pre>, end-to-endly. It downloads Fashion-MNIST dataset and indexes 50,000 images via Jina search framework. The index is stored into 4 <i>shards</i>. We then randomly sample 128 unseen images as <i>Queries</i>, ask Jina to retrieve relevant results. Below is Jina's retrievals.</span>
</div>
<hr style="border: 1px dashed #009999;">

<table style="width:100%; white-space: nowrap;">
<tr>
<th align="left"><h3 style="color: #1E6E73">Query</h3></th>
<th align="left"><h3 style="color: #1E6E73">Top-K Results</h3></th>
</tr>
{% RESULT %}
</table>
</body>
</html>
17 changes: 17 additions & 0 deletions jina/resources/helloworld.indexer.chunk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
!ChunkIndexer
components:
- !NumpyIndexer
with:
index_filename: vec.gz
metas:
name: vecidx # a customized name
workspace: $HW_WORKDIR
- !BasePbIndexer
with:
index_filename: chunk.gz
metas:
name: chunkidx
workspace: $HW_WORKDIR
metas:
name: chunk_indexer
workspace: $HW_WORKDIR
6 changes: 6 additions & 0 deletions jina/resources/helloworld.indexer.doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!DocPbIndexer
with:
index_filename: doc.gzip
metas:
name: doc_indexer # a customized name
workspace: $HW_WORKDIR

0 comments on commit e0e642e

Please sign in to comment.