Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Remve KVS #49

Merged
merged 1 commit into from
Mar 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Remve KVS
mosuka committed Mar 31, 2019
commit f12c64a2783aaa949b37a01890b86df7a0734876
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -12,15 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:18.10
FROM golang:1.12.1-stretch

ARG VERSION

ENV GOPATH /go

COPY . ${GOPATH}/src/github.com/mosuka/blast

RUN apt-get update && \
RUN echo "deb http://ftp.us.debian.org/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y \
git \
golang \
@@ -31,8 +33,8 @@ RUN apt-get update && \
g++-4.8 \
build-essential && \
apt-get clean && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 80 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 80 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 80 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 && \
go get -u -v github.com/blevesearch/cld2 && \
@@ -42,14 +44,15 @@ RUN apt-get update && \
./compile_libs.sh && \
cp *.so /usr/local/lib && \
cd ${GOPATH}/src/github.com/mosuka/blast && \
GOOS=linux \
make \
GOOS=linux \
GOARCH=amd64 \
CGO_ENABLED=1 \
BUILD_TAGS="kagome icu libstemmer cld2 cznicb leveldb badger" \
VERSION="${VERSION}" \
make build
build

FROM ubuntu:18.10
FROM debian:stretch-slim

MAINTAINER Minoru Osuka "minoru.osuka@gmail.com"

761 changes: 0 additions & 761 deletions Gopkg.lock

This file was deleted.

62 changes: 0 additions & 62 deletions Gopkg.toml

This file was deleted.

45 changes: 15 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -12,24 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION ?=
GOOS ?= linux
GOARCH ?= amd64
BUILD_TAGS ?=
CGO_ENABLED ?= 0
CGO_CFLAGS ?=
CGO_LDFLAGS ?=
GO15VENDOREXPERIMENT ?= 1
BIN_EXT ?=
BUILD_TAGS ?=
DOCKER_REPOSITORY ?= mosuka
VERSION ?=
BIN_EXT ?=

GO := CGO_ENABLED=$(CGO_ENABLED) GO15VENDOREXPERIMENT=$(CGO_ENABLED) go
GO := GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) CGO_CFLAGS=$(CGO_CFLAGS) CGO_LDFLAGS=$(CGO_LDFLAGS) GO111MODULE=on go

PACKAGES = $(shell $(GO) list ./... | grep -v '/vendor/')

PROTOBUFS = $(shell find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort --unique | grep -v /vendor/)
PROTOBUFS = $(shell find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq | grep -v /vendor/)

TARGET_PACKAGES = $(shell find . -name 'main.go' -print0 | xargs -0 -n1 dirname | sort --unique | grep -v /vendor/)
TARGET_PACKAGES = $(shell find . -name 'main.go' -print0 | xargs -0 -n1 dirname | sort | uniq | grep -v /vendor/)

ifeq ($(VERSION),)
VERSION = latest
@@ -42,25 +41,10 @@ endif

.DEFAULT_GOAL := build

.PHONY: dep-init
dep-init:
@echo ">> initialize dependencies"
dep init

.PHONY: dep-ensure
dep-ensure:
@echo ">> install dependencies"
dep ensure

.PHONY: dep-update
dep-update:
@echo ">> update dependencies"
dep ensure -update

.PHONY: protoc
protoc:
@echo ">> generating proto3 code"
@for proto_dir in $(PROTOBUFS); do echo $$proto_dir; protoc --proto_path=. --proto_path=$$proto_dir --proto_path=./vendor/ --go_out=plugins=grpc:$(GOPATH)/src $$proto_dir/*.proto || exit 1; done
@for proto_dir in $(PROTOBUFS); do echo $$proto_dir; protoc --proto_path=. --proto_path=$$proto_dir --go_out=plugins=grpc:$(GOPATH)/src $$proto_dir/*.proto || exit 1; done

.PHONY: format
format:
@@ -70,55 +54,56 @@ format:
.PHONY: test
test:
@echo ">> testing all packages"
@echo " VERSION = $(VERSION)"
@echo " GOOS = $(GOOS)"
@echo " GOARCH = $(GOARCH)"
@echo " CGO_ENABLED = $(CGO_ENABLED)"
@echo " CGO_CFLAGS = $(CGO_CFLAGS)"
@echo " CGO_LDFLAGS = $(CGO_LDFLAGS)"
@echo " BUILD_TAGS = $(BUILD_TAGS)"
@$(GO) test -v -tags="$(BUILD_TAGS)" $(LDFLAGS) $(PACKAGES)
@$(GO) test -v -tags="$(BUILD_TAGS)" $(PACKAGES)

.PHONY: build
build:
@echo ">> building binaries"
@echo " VERSION = $(VERSION)"
@echo " GOOS = $(GOOS)"
@echo " GOARCH = $(GOARCH)"
@echo " CGO_ENABLED = $(CGO_ENABLED)"
@echo " CGO_CFLAGS = $(CGO_CFLAGS)"
@echo " CGO_LDFLAGS = $(CGO_LDFLAGS)"
@echo " BUILD_TAGS = $(BUILD_TAGS)"
@echo " VERSION = $(VERSION)"
@for target_pkg in $(TARGET_PACKAGES); do echo $$target_pkg; $(GO) build -tags="$(BUILD_TAGS)" $(LDFLAGS) -o ./bin/`basename $$target_pkg`$(BIN_EXT) $$target_pkg || exit 1; done

.PHONY: install
install:
@echo ">> installing binaries"
@echo " VERSION = $(VERSION)"
@echo " GOOS = $(GOOS)"
@echo " GOARCH = $(GOARCH)"
@echo " CGO_ENABLED = $(CGO_ENABLED)"
@echo " CGO_CFLAGS = $(CGO_CFLAGS)"
@echo " CGO_LDFLAGS = $(CGO_LDFLAGS)"
@echo " BUILD_TAGS = $(BUILD_TAGS)"
@echo " VERSION = $(VERSION)"
@for target_pkg in $(TARGET_PACKAGES); do echo $$target_pkg; $(GO) install -tags="$(BUILD_TAGS)" $(LDFLAGS) $$target_pkg || exit 1; done

.PHONY: dist
dist:
@echo ">> packaging binaries"
@echo " VERSION = $(VERSION)"
@echo " GOOS = $(GOOS)"
@echo " GOARCH = $(GOARCH)"
@echo " CGO_ENABLED = $(CGO_ENABLED)"
@echo " CGO_CFLAGS = $(CGO_CFLAGS)"
@echo " CGO_LDFLAGS = $(CGO_LDFLAGS)"
@echo " BUILD_TAGS = $(BUILD_TAGS)"
@echo " VERSION = $(VERSION)"
mkdir -p ./dist/$(GOOS)-$(GOARCH)/bin
@for target_pkg in $(TARGET_PACKAGES); do echo $$target_pkg; $(GO) build -tags="$(BUILD_TAGS)" $(LDFLAGS) -o ./dist/$(GOOS)-$(GOARCH)/bin/`basename $$target_pkg`$(BIN_EXT) $$target_pkg || exit 1; done
(cd ./dist/$(GOOS)-$(GOARCH); tar zcfv ../blast-${VERSION}.$(GOOS)-$(GOARCH).tar.gz .)

.PHONY: git-tag
git-tag:
@echo ">> tagging github"
@echo " VERSION = $(VERSION)"
@echo " VERSION = $(VERSION)"
ifeq ($(VERSION),$(filter $(VERSION),latest master ""))
@echo "please specify VERSION"
else
@@ -130,7 +115,7 @@ endif
docker-build:
@echo ">> building docker container image"
@echo " DOCKER_REPOSITORY = $(DOCKER_REPOSITORY)"
@echo " VERSION = $(VERSION)"
@echo " VERSION = $(VERSION)"
docker build -t $(DOCKER_REPOSITORY)/blast:latest --build-arg VERSION=$(VERSION) .
docker tag $(DOCKER_REPOSITORY)/blast:latest $(DOCKER_REPOSITORY)/blast:$(VERSION)

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -110,6 +110,7 @@ Blast supports some [Bleve Extensions (blevex)](https://github.com/blevesearch/b

```bash
$ make \
GOOS=linux \
BUILD_TAGS=leveldb \
CGO_ENABLED=1 \
build
@@ -185,6 +186,7 @@ You can test with all the Bleve extensions supported by Blast as follows:

```bash
$ make \
GOOS=linux \
BUILD_TAGS="kagome icu libstemmer cld2 cznicb leveldb badger" \
CGO_ENABLED=1 \
test
@@ -195,6 +197,7 @@ $ make \

```bash
$ make \
GOOS=darwin \
BUILD_TAGS="kagome icu libstemmer cld2 cznicb leveldb badger" \
CGO_ENABLED=1 \
CGO_LDFLAGS="-L/usr/local/opt/icu4c/lib" \
53 changes: 0 additions & 53 deletions cmd/blast-kvs/cluster.go

This file was deleted.

57 changes: 0 additions & 57 deletions cmd/blast-kvs/delete.go

This file was deleted.

64 changes: 0 additions & 64 deletions cmd/blast-kvs/get.go

This file was deleted.

64 changes: 0 additions & 64 deletions cmd/blast-kvs/join.go

This file was deleted.

57 changes: 0 additions & 57 deletions cmd/blast-kvs/leave.go

This file was deleted.

258 changes: 0 additions & 258 deletions cmd/blast-kvs/main.go

This file was deleted.

53 changes: 0 additions & 53 deletions cmd/blast-kvs/node.go

This file was deleted.

71 changes: 0 additions & 71 deletions cmd/blast-kvs/put.go

This file was deleted.

45 changes: 0 additions & 45 deletions cmd/blast-kvs/snapshot.go

This file was deleted.

86 changes: 0 additions & 86 deletions cmd/blast-kvs/start.go

This file was deleted.

163 changes: 0 additions & 163 deletions kvs/grpc_client.go

This file was deleted.

62 changes: 0 additions & 62 deletions kvs/grpc_server.go

This file was deleted.

167 changes: 0 additions & 167 deletions kvs/grpc_service.go

This file was deleted.

224 changes: 0 additions & 224 deletions kvs/http_handler.go

This file was deleted.

86 changes: 0 additions & 86 deletions kvs/http_server.go

This file was deleted.

177 changes: 0 additions & 177 deletions kvs/kvs.go

This file was deleted.

61 changes: 0 additions & 61 deletions kvs/metric.go

This file was deleted.

284 changes: 0 additions & 284 deletions kvs/raft_fsm.go

This file was deleted.

610 changes: 0 additions & 610 deletions kvs/raft_server.go

This file was deleted.

170 changes: 0 additions & 170 deletions kvs/server.go

This file was deleted.

497 changes: 0 additions & 497 deletions protobuf/kvs/kvs.pb.go

This file was deleted.

53 changes: 0 additions & 53 deletions protobuf/kvs/kvs.proto

This file was deleted.

2 changes: 0 additions & 2 deletions protobuf/util.go
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@ import (
"github.com/blevesearch/bleve"
"github.com/golang/protobuf/ptypes/any"
"github.com/mosuka/blast/protobuf/index"
"github.com/mosuka/blast/protobuf/kvs"
"github.com/mosuka/blast/protobuf/management"
"github.com/mosuka/blast/protobuf/raft"
"github.com/mosuka/blast/registry"
@@ -32,7 +31,6 @@ func init() {

registry.RegisterType("management.KeyValuePair", reflect.TypeOf(management.KeyValuePair{}))
registry.RegisterType("index.Document", reflect.TypeOf(index.Document{}))
registry.RegisterType("kvs.KeyValuePair", reflect.TypeOf(kvs.KeyValuePair{}))
registry.RegisterType("raft.Node", reflect.TypeOf(raft.Node{}))

registry.RegisterType("bleve.SearchRequest", reflect.TypeOf(bleve.SearchRequest{}))
1 change: 0 additions & 1 deletion vendor/github.com/AndreasBriese/bbloom/.travis.yml

This file was deleted.

35 changes: 0 additions & 35 deletions vendor/github.com/AndreasBriese/bbloom/LICENSE

This file was deleted.

131 changes: 0 additions & 131 deletions vendor/github.com/AndreasBriese/bbloom/README.md

This file was deleted.

270 changes: 0 additions & 270 deletions vendor/github.com/AndreasBriese/bbloom/bbloom.go

This file was deleted.

Loading