Skip to content

Commit

Permalink
Merge pull request #84 from silasdavis/streaming-hoard
Browse files Browse the repository at this point in the history
Streaming hoard
  • Loading branch information
Greg Hill authored Dec 3, 2019
2 parents f569f91 + dcb4490 commit 92dad7c
Show file tree
Hide file tree
Showing 79 changed files with 3,393 additions and 2,585 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
mocha: true
},
extends: [
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018
},
rules: {}
}
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# [Monax Hoard](https://github.com/monax/hoard) Changelog
## [Unreleased]
## [7.0.0] - 2019-12-02
This release makes some changes to the Hoard protobuf and service that are backwards compatible for clients - Hoard v6 clients should work with Hoard v7 but hoard-js v7 will not work entirely correctly with Hoard v6 due to removal of oneof.

### Changed
- [API] Drop use of oneof in protobuf files - allow singleton fields to be sent with streamable fields
- [API] Enforce that we only receive exactly one salt and grant spec in streams and that they come first
- [NODEJS] Expose streaming promise client-side API to take advantage of streaming rather than loading entire file into buffer

### Fixed
- Ignoring Spec if Salt present in single message


## [6.0.0] - 2019-10-11
Expand Down Expand Up @@ -136,7 +145,7 @@ This is the first Hoard open source release and includes:
- Hoar-Daemon hoard
- Hoar-Control hoarctl CLI

[Unreleased]: https://github.com/monax/hoard/compare/v6.0.0...HEAD
[7.0.0]: https://github.com/monax/hoard/compare/v6.0.0...v7.0.0
[6.0.0]: https://github.com/monax/hoard/compare/v5.1.0...v6.0.0
[5.1.0]: https://github.com/monax/hoard/compare/v5.0.1...v5.1.0
[5.0.1]: https://github.com/monax/hoard/compare/v5.0.0...v5.0.1
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
FROM golang:1.12.1-alpine3.9 as builder
MAINTAINER Monax <[email protected]>

RUN apk add --update --no-cache git
RUN apk add --update --no-cache make git bash

ARG REPO=$GOPATH/src/github.com/monax/hoard
COPY . $REPO
WORKDIR $REPO

ENV GO111MODULE=on
# Build purely static binaries
RUN go build --ldflags '-extldflags "-static"' -o bin/hoard ./cmd/hoard
RUN go build --ldflags '-extldflags "-static"' -o bin/hoarctl ./cmd/hoarctl
RUN make build

# This will be our base container image
FROM alpine:3.9
Expand Down
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

export GO111MODULE := on

# Gets implicit default GOPATH if not set
GOPATH?=$(shell go env GOPATH)
BIN_PATH?=${GOPATH}/bin

SHELL := /bin/bash
REPO := $(shell pwd)
GOFILES := $(shell find . -name '*.pb.go' -prune -o -not -path './vendor/*' -type f -name '*.go' -print)
Expand All @@ -29,6 +33,8 @@ PROTO_FILES = $(shell find . -path ./hoard-js -prune -o -path ./node_modules -pr
PROTO_GO_FILES = $(patsubst %.proto, %.pb.go, $(PROTO_FILES))
PROTO_GO_FILES_REAL = $(shell find . -type f -name '*.pb.go' -print)

GO_BUILD_ARGS = -ldflags "-extldflags '-static' -X $(shell go list)/project.commit=$(shell cat commit_hash.txt) -X $(shell go list)/project.date=$(shell date '+%Y-%m-%d')"

export DOCKER_HUB := quay.io
export DOCKER_REPO := $(DOCKER_HUB)/monax/hoard
export BUILD_IMAGE := $(DOCKER_REPO):build
Expand Down Expand Up @@ -72,7 +78,7 @@ commit_hash:

.PHONY: protobuf
protobuf: $(PROTO_GO_FILES)
rsync -r .gopath/github.com/monax/hoard/v6/ ./
rsync -r .gopath/github.com/monax/hoard/v7/ ./
rm -rf .gopath

.PHONY: clean_protobuf
Expand All @@ -85,18 +91,19 @@ protobuf_deps:

## build the hoard binary
.PHONY: build_hoard
build_hoard:
@go build -o bin/hoard ./cmd/hoard
build_hoard: commit_hash
go build $(GO_BUILD_ARGS) -o bin/hoard ./cmd/hoard

## build the hoard binary
.PHONY: build_hoarctl
build_hoarctl:
@go build -o bin/hoarctl ./cmd/hoarctl
build_hoarctl: commit_hash
go build $(GO_BUILD_ARGS) -o bin/hoarctl ./cmd/hoarctl

.PHONY: install
install:
@go install ./cmd/hoard
@go install ./cmd/hoarctl
install: build_hoarctl build_hoard
mkdir -p ${BIN_PATH}
install -T ${REPO}/bin/hoarctl ${BIN_PATH}/hoarctl
install -T ${REPO}/bin/hoard ${BIN_PATH}/hoard

## build all targets in github.com/monax/hoard
.PHONY: build
Expand Down
11 changes: 9 additions & 2 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### Added
- Document streaming service
This release makes some changes to the Hoard protobuf and service that are backwards compatible for clients - Hoard v6 clients should work with Hoard v7 but hoard-js v7 will not work entirely correctly with Hoard v6 due to removal of oneof.

### Changed
- [API] Drop use of oneof in protobuf files - allow singleton fields to be sent with streamable fields
- [API] Enforce that we only receive exactly one salt and grant spec in streams and that they come first
- [NODEJS] Expose streaming promise client-side API to take advantage of streaming rather than loading entire file into buffer

### Fixed
- Ignoring Spec if Salt present in single message

Loading

0 comments on commit 92dad7c

Please sign in to comment.