Skip to content

Commit c7ae052

Browse files
authored
Add signal handling (#22)
1 parent 375b557 commit c7ae052

15 files changed

+77
-50
lines changed

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ name = "bayard"
33
version = "0.1.1"
44
authors = ["Minoru Osuka <[email protected]>"]
55
edition = "2018"
6+
description = "Bayard is a full-text search and indexing server written in Rust."
7+
documentation = "https://bayard-search.github.io/bayard/"
8+
homepage = "https://github.com/bayard-search/bayard"
9+
repository = "https://github.com/bayard-search/bayard"
10+
readme = "README.md"
11+
keywords = ["search", "index", "server", "information", "retrieval"]
12+
categories = ["database"]
13+
license = "MIT"
614

715
[lib]
816
name = "bayard"
@@ -13,6 +21,8 @@ path = "src/main.rs"
1321

1422
[dependencies]
1523
clap = "2.33.0"
24+
crossbeam-channel = "0.3.9"
25+
ctrlc = { version = "3.1.3", features = ["termination"] }
1626
env_logger = "0.7.0"
1727
futures = "0.1.29"
1828
grpcio = { version = "0.4.5", features = [ "secure" ] }

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
BIN_DIR ?= $(CURDIR)/bin
2-
DATA_DIR ?= $(CURDIR)/data
3-
CARGO_TARGET_DIR ?= $(CURDIR)/target
42
VERSION ?=
53

64
ifeq ($(VERSION),)
@@ -9,8 +7,7 @@ endif
97

108
clean:
119
rm -rf $(BIN_DIR)
12-
rm -rf $(DATA_DIR)
13-
rm -rf $(CARGO_TARGET_DIR)
10+
cargo clean
1411

1512
format:
1613
cargo fmt
@@ -19,20 +16,20 @@ protoc:
1916
./generate_proto.sh
2017

2118
build:
19+
mkdir -p $(BIN_DIR)
2220
cargo update -p protobuf --precise 2.8.0
2321
cargo build --release
24-
mkdir -p $(BIN_DIR)
25-
cp $(CARGO_TARGET_DIR)/release/bayard $(BIN_DIR)/
22+
cp -p ./target/release/bayard $(BIN_DIR)
2623

27-
docker-build:
24+
build-docker:
2825
docker build -t bayardsearch/bayard:latest .
2926
docker tag bayardsearch/bayard:latest bayardsearch/bayard:$(VERSION)
3027

31-
docker-push:
28+
push-docker:
3229
docker push bayardsearch/bayard:latest
3330
docker push bayardsearch/bayard:$(VERSION)
3431

35-
docker-clean:
32+
clean-docker:
3633
docker rmi -f $(shell docker images --filter "dangling=true" -q --no-trunc)
3734

3835
build-docs:

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ Bayard makes easy for programmers to develop search applications with advanced f
1616
- Command line interface is available
1717

1818

19-
## Source code
19+
## Source code repository
2020

21-
Here is the source code.
2221
- [https://github.com/bayard-search/bayard](https://github.com/bayard-search/bayard)
2322

23+
## Docker container repository
24+
25+
- [https://hub.docker.com/r/bayardsearch/bayard](https://hub.docker.com/r/bayardsearch/bayard)
26+
2427
## Documents
2528

26-
The document is available at the following URL:
2729
- [https://bayard-search.github.io/bayard/](https://bayard-search.github.io/bayard/)

docs/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,15 @@ <h2><a class="header" href="#features" id="features">Features</a></h2>
161161
<li>Bringing up a cluster</li>
162162
<li>Command line interface is available</li>
163163
</ul>
164-
<h2><a class="header" href="#source-code" id="source-code">Source code</a></h2>
165-
<p>Here is the source code.</p>
164+
<h2><a class="header" href="#source-code-repository" id="source-code-repository">Source code repository</a></h2>
166165
<ul>
167166
<li><a href="https://github.com/bayard-search/bayard">https://github.com/bayard-search/bayard</a></li>
168167
</ul>
168+
<h2><a class="header" href="#docker-container-repository" id="docker-container-repository">Docker container repository</a></h2>
169+
<ul>
170+
<li><a href="https://hub.docker.com/r/bayardsearch/bayard">https://hub.docker.com/r/bayardsearch/bayard</a></li>
171+
</ul>
169172
<h2><a class="header" href="#documents" id="documents">Documents</a></h2>
170-
<p>The document is available at the following URL:</p>
171173
<ul>
172174
<li><a href="https://bayard-search.github.io/bayard/">https://bayard-search.github.io/bayard/</a></li>
173175
</ul>

docs/overview.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,15 @@ <h2><a class="header" href="#features" id="features">Features</a></h2>
161161
<li>Bringing up a cluster</li>
162162
<li>Command line interface is available</li>
163163
</ul>
164-
<h2><a class="header" href="#source-code" id="source-code">Source code</a></h2>
165-
<p>Here is the source code.</p>
164+
<h2><a class="header" href="#source-code-repository" id="source-code-repository">Source code repository</a></h2>
166165
<ul>
167166
<li><a href="https://github.com/bayard-search/bayard">https://github.com/bayard-search/bayard</a></li>
168167
</ul>
168+
<h2><a class="header" href="#docker-container-repository" id="docker-container-repository">Docker container repository</a></h2>
169+
<ul>
170+
<li><a href="https://hub.docker.com/r/bayardsearch/bayard">https://hub.docker.com/r/bayardsearch/bayard</a></li>
171+
</ul>
169172
<h2><a class="header" href="#documents" id="documents">Documents</a></h2>
170-
<p>The document is available at the following URL:</p>
171173
<ul>
172174
<li><a href="https://bayard-search.github.io/bayard/">https://bayard-search.github.io/bayard/</a></li>
173175
</ul>

docs/print.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ <h2><a class="header" href="#features" id="features">Features</a></h2>
163163
<li>Bringing up a cluster</li>
164164
<li>Command line interface is available</li>
165165
</ul>
166-
<h2><a class="header" href="#source-code" id="source-code">Source code</a></h2>
167-
<p>Here is the source code.</p>
166+
<h2><a class="header" href="#source-code-repository" id="source-code-repository">Source code repository</a></h2>
168167
<ul>
169168
<li><a href="https://github.com/bayard-search/bayard">https://github.com/bayard-search/bayard</a></li>
170169
</ul>
170+
<h2><a class="header" href="#docker-container-repository" id="docker-container-repository">Docker container repository</a></h2>
171+
<ul>
172+
<li><a href="https://hub.docker.com/r/bayardsearch/bayard">https://hub.docker.com/r/bayardsearch/bayard</a></li>
173+
</ul>
171174
<h2><a class="header" href="#documents" id="documents">Documents</a></h2>
172-
<p>The document is available at the following URL:</p>
173175
<ul>
174176
<li><a href="https://bayard-search.github.io/bayard/">https://bayard-search.github.io/bayard/</a></li>
175177
</ul>
@@ -366,9 +368,9 @@ <h2><a class="header" href="#remove-a-server-from-a-cluster" id="remove-a-server
366368
--leader-id=1
367369
</code></pre>
368370
<h1><a class="header" href="#running-on-docker" id="running-on-docker">Running on Docker</a></h1>
369-
<p>Docker container image is available. Check the available version at the following URL:</p>
371+
<p>See the available Docker container image version at the following URL:</p>
370372
<ul>
371-
<li>https://hub.docker.com/r/bayardsearch/bayard/tags/</li>
373+
<li><a href="https://hub.docker.com/r/bayardsearch/bayard/tags/">https://hub.docker.com/r/bayardsearch/bayard/tags/</a></li>
372374
</ul>
373375
<h2><a class="header" href="#pulling-docker-container" id="pulling-docker-container">Pulling Docker container</a></h2>
374376
<p>You can pull the Docker container image with the following command:</p>

docs/running_on_docker.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ <h1 class="menu-title">Bayard</h1>
149149
<div id="content" class="content">
150150
<main>
151151
<h1><a class="header" href="#running-on-docker" id="running-on-docker">Running on Docker</a></h1>
152-
<p>Docker container image is available. Check the available version at the following URL:</p>
152+
<p>See the available Docker container image version at the following URL:</p>
153153
<ul>
154-
<li>https://hub.docker.com/r/bayardsearch/bayard/tags/</li>
154+
<li><a href="https://hub.docker.com/r/bayardsearch/bayard/tags/">https://hub.docker.com/r/bayardsearch/bayard/tags/</a></li>
155155
</ul>
156156
<h2><a class="header" href="#pulling-docker-container" id="pulling-docker-container">Pulling Docker container</a></h2>
157157
<p>You can pull the Docker container image with the following command:</p>

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs_src/building_bayard.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ When the build is successful, the binary file is output to the following directo
2121
```text
2222
$ ls ./bin
2323
```
24-
25-

0 commit comments

Comments
 (0)