Skip to content

Commit

Permalink
fix: Fixing panic in cluster manager and adding a cluster example
Browse files Browse the repository at this point in the history
  • Loading branch information
krotik committed Mar 8, 2020
1 parent 56026b6 commit 98d1336
Show file tree
Hide file tree
Showing 65 changed files with 2,480 additions and 186 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.0.3](https://devt.de///compare/v1.0.2...v1.0.3) (2020-03-08)


### Bug Fixes

* Adding compose files and frontend files ([f33d23f](https://devt.de///commit/f33d23f912a3e3d05192a88afadb592b05229040))
* Adding mining example ([c585876](https://devt.de///commit/c585876025a37539aed7f81c514f0f802baf9c9f))
* Adding UInt64 conversion function ([a63fe0f](https://devt.de///commit/a63fe0f575fe977e06c6f534718b184d40817128))
* Make cluster translationRec and transferRec gobable ([34623d8](https://devt.de///commit/34623d897286960180474fb466cec499ec1e0188))

### [1.0.2](https://devt.de///compare/v1.0.1...v1.0.2) (2020-02-22)


### Bug Fixes

* Adding more debug tools to cluster ([7ca3ae0](https://devt.de///commit/7ca3ae04cdf3816edb950be0b066c94aff87a70f))
* Adding proper Graph Manager global values for tests ([127477f](https://devt.de///commit/127477fd541d45258bad36e36f17648bf95bd4d2))
* Cluster Distributed Storage must assign new locations from 1 ([6c24001](https://devt.de///commit/6c240016c1414f945adb2e47c26542c3a226ef5b))
* Small fix for debug code and better comments ([3b68724](https://devt.de///commit/3b68724d2ab936ec0c29afc6cc0d191714cd1a23))

### [1.0.1](https://devt.de///compare/v1.0.0...v1.0.1) (2019-12-15)


### Bug Fixes

* Minor restructuring ([137c0ae](https://devt.de///commit/137c0ae6e7460fdb96614a555030cde2dcb3d7df))

## 1.0.0 (2019-08-30)


### Features

* BREAKING CHANGE: Restructure EliasDB code for go modules / Adding GraphQL interface ([65c38db59e](https://devt.de///commit/65c38db59e))
* Initial commit ([b2e9cd9a8a](https://devt.de///commit/b2e9cd9a8a))
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ENTRYPOINT ["../eliasdb"]
#
# docker run --rm --user $(id -u):$(id -g) -v $PWD:/data -p 9090:9090 krotik/eliasdb server

# To run the console as the current user, use the eliasdb.config.json in
# the local directory
# To run the console as the current user and use the eliasdb.config.json in
# the local directory run:

# docker run --rm --network="host" -it -v $PWD:/data --user $(id -u):$(id -g) -v $PWD:/data krotik/eliasdb console
20 changes: 7 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ pipeline {
* a new product version. The versioning will be according to the rules
* of “Semantic Versioning” (https://semver.org/).
*
* Building is done using goreleaser (https://goreleaser.com/) for different
* platforms.
* Building is done using simple make.
*
* Testing produces code coverage badges which can be embedded on other
* pages.
*
* Everything runs in docker containers to ensure isolation of the build
* system and to allow painless upgrades.
* Testing produces code coverage badges which can be embedded web pages.
*/

stages {
Expand Down Expand Up @@ -60,8 +55,7 @@ pipeline {
sh 'git fetch --tags'
}

sh 'mkdir -p .cache'
sh 'docker run --rm --user $(id -u):$(id -g) -v $PWD/.cache:/.cache -v $PWD:/go/code -w /go/code goreleaser/goreleaser --snapshot --skip-publish --rm-dist'
sh '/opt/env-go/bin/env-go make dist'
}
}
stage('Test') {
Expand All @@ -74,12 +68,12 @@ pipeline {

sh """echo '<svg width="88" height="20" xmlns="http://www.w3.org/2000/svg"><g shape-rendering="crispEdges"><path fill="#555" d="M0 0h41v20H0z"/><path fill="#fc1" d="M41 0h40v20H41z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"><text x="20.5" y="14">tests</text><text x="60" y="14">fail</text></g></svg>' > test_result.svg"""

sh 'docker run --rm -e GOPATH=/tmp -v $PWD:/go golang go test -p 1 --coverprofile=coverage.out ./...'
sh 'docker run --rm -e GOPATH=/tmp -v $PWD:/go golang go tool cover --html=coverage.out -o coverage.html'
sh 'CGO_ENABLED=0 /opt/env-go/bin/env-go go test -p 1 --coverprofile=coverage.out ./...'
sh '/opt/env-go/bin/env-go go tool cover --html=coverage.out -o coverage.html'

echo 'Determine overall coverage and writing badge'
script {
coverage = sh(returnStdout: true, script: 'docker run --rm -e GOPATH=/tmp -v $PWD:/go golang go tool cover -func=coverage.out | tee coverage.txt | tail -1 | grep -o "[0-9]*.[0-9]*%$" | tr -d "\\n"')
coverage = sh(returnStdout: true, script: '/opt/env-go/bin/env-go go tool cover -func=coverage.out | tee coverage.txt | tail -1 | grep -o "[0-9]*.[0-9]*%$" | tr -d "\\n"')

echo "Overall coverage is: ${coverage}"

Expand All @@ -105,7 +99,7 @@ pipeline {
sshagent (credentials: ['Gogs']) {
sh 'git fetch --tags'
}
sh 'docker run --rm -v $PWD:/app standard-version'
sh 'standard-version'

// The new version is inserted into the code
//
Expand Down
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export NAME=eliasdb
export TAG=`git describe --abbrev=0 --tags`
export CGO_ENABLED=0
export GOOS=linux

all: build
clean:
rm -f eliasdb

mod:
go mod init || true
go mod tidy
test:
go test -p 1 ./...
cover:
go test -p 1 --coverprofile=coverage.out ./...
go tool cover --html=coverage.out -o coverage.html
sh -c "open coverage.html || xdg-open coverage.html" 2>/dev/null
fmt:
gofmt -l -w -s .

vet:
go vet ./...

build: clean mod fmt vet
go build -o $(NAME) cli/eliasdb.go

build-win: clean mod fmt vet
GOOS=windows GOARCH=amd64 go build -o $(NAME).exe cli/eliasdb.go

dist: build build-win
rm -fR dist

mkdir -p dist/$(NAME)_linux_amd64
mv $(NAME) dist/$(NAME)_linux_amd64
cp LICENSE dist/$(NAME)_linux_amd64
cp NOTICE dist/$(NAME)_linux_amd64
tar --directory=dist -cz $(NAME)_linux_amd64 > dist/$(NAME)_$(TAG)_linux_amd64.tar.gz

mkdir -p dist/$(NAME)_windows_amd64
mv $(NAME).exe dist/$(NAME)_windows_amd64
cp LICENSE dist/$(NAME)_windows_amd64
cp NOTICE dist/$(NAME)_windows_amd64
tar --directory=dist -cz $(NAME)_windows_amd64 > dist/$(NAME)_$(TAG)_windows_amd64.tar.gz

sh -c 'cd dist; sha256sum *.tar.gz' > dist/checksums.txt
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Features

Getting Started (standalone application)
----------------------------------------
You can download a precompiled package for Windows (win64) or Linux (amd64) [here](https://void.devt.de/pub/eliasdb).
You can download a pre-compiled package for Windows (win64) or Linux (amd64) [here](https://void.devt.de/pub/eliasdb).

Extract it and execute the executable with:
```
Expand Down Expand Up @@ -58,14 +58,18 @@ docker run --rm --network="host" -it -v $PWD:/data --user $(id -u):$(id -g) -v $

### Tutorial:

To get an idea of what EliasDB is about have a look at the [tutorial](https://devt.de/krotik/eliasdb/src/master/examples/tutorial/doc/tutorial.md). This tutorial will cover the basics of EQL and show how data is organized.
To get an idea of what EliasDB is about have a look at the [tutorial](examples/tutorial/doc/tutorial.md). This tutorial will cover the basics of EQL and show how data is organized.

There is a separate [tutorial](https://devt.de/krotik/eliasdb/src/master/examples/tutorial/doc/tutorial_graphql.md) on using ELiasDB with GraphQL.
There is a separate [tutorial](examples/tutorial/doc/tutorial_graphql.md) on using ELiasDB with GraphQL.

### REST API:

The terminal uses a REST API to communicate with the backend. The REST API can be browsed using a dynamically generated swagger.json definition (https://localhost:9090/db/swagger.json). You can browse the API of EliasDB's latest version [here](http://petstore.swagger.io/?url=https://devt.de/krotik/eliasdb/raw/master/swagger.json).

### Clustering:

EliasDB supports to be run in a cluster by joining multiple instances of EliasDB together. You can read more about it [here](cluster.md).

### Command line options
The main EliasDB executable has two main tools:
```
Expand Down Expand Up @@ -212,12 +216,15 @@ docker build --tag krotik/eliasdb .

Example Applications
--------------------
[Chat](https://devt.de/krotik/eliasdb/src/master/examples/chat/doc/chat.md) - A simple chat application showing user management and subscriptions.
- [Chat](examples/chat/doc/chat.md) - A simple chat application showing user /management and subscriptions.
- [Data-mining](examples/data-mining/doc/data-mining.md) - A more complex application which uses the cluster feature of EliasDB and GraphQL for data queries.


Further Reading
---------------
- A design document which describes the different components of the graph database. [Link](https://devt.de/krotik/eliasdb/src/master/eliasdb_design.md)
- A reference for the EliasDB query language EQL. [Link](https://devt.de/krotik/eliasdb/src/master/eql.md)
- A reference for the EliasDB's support for GraphQL. [Link](https://devt.de/krotik/eliasdb/src/master/graphql.md)
- A quick overview of what you can do when you embed EliasDB in your own Go project. [Link](https://devt.de/krotik/eliasdb/src/master/embedding.md)

License
Expand Down
Loading

0 comments on commit 98d1336

Please sign in to comment.