Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #646 from hyperledger/develop
Browse files Browse the repository at this point in the history
Release 0.17.0
  • Loading branch information
Casey Kuhlman authored Sep 4, 2017
2 parents 2ba8dec + 401d312 commit 9c70b8c
Show file tree
Hide file tree
Showing 143 changed files with 3,636 additions and 2,598 deletions.
92 changes: 92 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Some resuable sections, note the top-level keys 'defaults' and 'tag_filters'
# have no special meaning, they just exist so I can alias them and import them
# in later blocks
defaults: &defaults
working_directory: /go/src/github.com/hyperledger/burrow
docker:
- image: circleci/golang:1.8.1

tag_filters: &tags_filters
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/

version: 2
jobs:
checkout_code:
<<: *defaults
steps:
- checkout
- run: go get github.com/Masterminds/glide
- run: glide install

# Just persist the entire working dir (burrow checkout)
- persist_to_workspace:
root: .
paths:
- .
test:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: make test

test_integration:
<<: *defaults
steps:
- attach_workspace:
at: .
- run: make test_integration

release:
<<: *defaults
steps:
# restore checkout
- attach_workspace:
at: .
# This allows us to perform our docker builds
- setup_remote_docker:
version: 17.06.1-ce
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
# build docker image and tag the image with the version, date, and commit hash
- run: make build_docker_db
- run: docker push quay.io/monax/db


workflows:
version: 2

test_and_release:
jobs:
- checkout_code:
# Rather annoyingly we need this boilerplate on all transitive
# dependencies if we want the deploy job to build against a version
# tag.
# Also note jobs build against all branches by default
filters:
<<: *tags_filters
- test:
requires:
- checkout_code
filters:
<<: *tags_filters

- test_integration:
requires:
- checkout_code
filters:
<<: *tags_filters

- release:
requires:
- test
- test_integration
filters:
<<: *tags_filters
branches:
# Although we seem to exclude the master branch below, since
# matching on tags is independent we will still build tags that
# happen to point to a commit on master
# We push dev pre-release images for every commit on develop
only: develop

11 changes: 8 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.github
.git
.gitignore
.project
run.sh
build
build_tool.sh
Makefile
Vagrantfile
Dockerfile
CHANGELOG.md
README.md
circle.yml
api.md
.circleci
docs
vendor
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# burrow changelog
## v0.17.0
This is a service release with some significant ethereum/solidity compatibility improvements and new logging features. It includes:

- [Upgrade to use Tendermint v0.9.2](https://github.com/hyperledger/burrow/pull/595)
- [Implemented dynamic memory](https://github.com/hyperledger/burrow/pull/607) assumed by the EVM bytecode produce by solidity, fixing various issues.
- Logging sinks and configuration - providing a flexible mechanism for configuring log flows and outputs see [logging section in readme](https://github.com/hyperledger/burrow#logging). Various other logging enhancements.
- Fix event unsubscription
- Remove module-specific versioning
- Rename suicide to selfdestruct
- SNative tweaks

Known issues:

- SELFDESTRUCT opcode causes a panic when an account is removed. A [fix](https://github.com/hyperledger/burrow/pull/605) was produced but was [reverted](https://github.com/hyperledger/burrow/pull/636) pending investigation of a possible regression.

## v0.16.3
This release adds an stop-gap fix to the `Transact` method so that it never
transfers value with the `CallTx` is generates.
Expand Down
42 changes: 31 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
FROM quay.io/monax/build:0.16
# We use a multistage build to avoid bloating our deployment image with build dependencies
FROM golang:1.9.0-alpine3.6 as builder
MAINTAINER Monax <[email protected]>

ENV TARGET burrow
ENV REPO $GOPATH/src/github.com/hyperledger/$TARGET
RUN apk add --no-cache --update git
RUN go get github.com/Masterminds/glide

ADD ./glide.yaml $REPO/
ADD ./glide.lock $REPO/
ENV REPO $GOPATH/src/github.com/hyperledger/burrow
COPY . $REPO
WORKDIR $REPO
RUN glide install

COPY . $REPO/.
RUN cd $REPO/cmd/$TARGET && \
go build --ldflags '-extldflags "-static"' -o $INSTALL_BASE/$TARGET
# Build purely static binaries
RUN go build --ldflags '-extldflags "-static"' -o bin/burrow ./cmd/burrow
RUN go build --ldflags '-extldflags "-static"' -o bin/burrow-client ./client/cmd/burrow-client

# build customizations start here
RUN cd $REPO/client/cmd/burrow-client && \
go build --ldflags '-extldflags "-static"' -o $INSTALL_BASE/burrow-client
# This will be our base container image
FROM alpine:3.6

# There does not appear to be a way to share environment variables between stages
ENV REPO /go/src/github.com/hyperledger/burrow

ENV USER monax
ENV MONAX_PATH /home/$USER/.monax
RUN addgroup -g 101 -S $USER && adduser -S -D -u 1000 $USER $USER
VOLUME $MONAX_PATH
WORKDIR $MONAX_PATH
USER $USER:$USER

# Copy binaries built in previous stage
COPY --from=builder $REPO/bin/* /usr/local/bin/

# Expose ports for 1337:burrow API; 46656:tendermint-peer; 46657:tendermint-rpc
EXPOSE 1337
EXPOSE 46656
EXPOSE 46657

CMD [ "burrow", "serve" ]
23 changes: 0 additions & 23 deletions Dockerfile.deploy

This file was deleted.

49 changes: 23 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SHELL := /bin/bash
REPO := $(shell pwd)
GOFILES_NOVENDOR := $(shell find ${REPO} -type f -name '*.go' -not -path "${REPO}/vendor/*")
PACKAGES_NOVENDOR := $(shell go list github.com/hyperledger/burrow/... | grep -v /vendor/)
VERSION := $(shell cat ${REPO}/version/version.go | tail -n 1 | cut -d \ -f 4 | tr -d '"')
VERSION := $(shell go run ./util/version/cmd/main.go)
VERSION_MIN := $(shell echo ${VERSION} | cut -d . -f 1-2)
COMMIT_SHA := $(shell echo `git rev-parse --short --verify HEAD`)

Expand All @@ -21,6 +21,10 @@ DOCKER_NAMESPACE := quay.io/monax
greet:
@echo "Hi! I'm the marmot that will help you with burrow v${VERSION}"

.PHONY: version
version:
@echo "${VERSION}"

### Formatting, linting and vetting

# check the code for style standards; currently enforces go formatting.
Expand All @@ -31,6 +35,11 @@ check:
@gofmt -l -d ${GOFILES_NOVENDOR}
@gofmt -l ${GOFILES_NOVENDOR} | read && echo && echo "Your marmot has found a problem with the formatting style of the code." 1>&2 && exit 1 || true

# Just fix it
.PHONY: fix
fix:
@goimports -l -w ${GOFILES_NOVENDOR}

# fmt runs gofmt -w on the code, modifying any files that do not match
# the style guide.
.PHONY: fmt
Expand All @@ -54,6 +63,12 @@ vet:
@echo "Running go vet."
@go vet ${PACKAGES_NOVENDOR}

# run the megacheck tool for code compliance
.PHONY: megacheck
megacheck:
@go get honnef.co/go/tools/cmd/megacheck
@for pkg in ${PACKAGES_NOVENDOR}; do megacheck "$$pkg"; done

### Dependency management for github.com/hyperledger/burrow

# erase vendor wipes the full vendor directory
Expand All @@ -67,12 +82,6 @@ install_vendor:
go get github.com/Masterminds/glide
glide install

# hell runs utility tool hell to selectively update glide dependencies
.PHONY: hell
hell:
go build -o ${REPO}/target/hell ./util/hell/cmd/hell/main.go
./target/hell $(filter-out $@,$(MAKECMDGOALS))

# Dumps Solidity interface contracts for SNatives
.PHONY: snatives
snatives:
Expand Down Expand Up @@ -112,8 +121,12 @@ build_race_client:

# test burrow
.PHONY: test
test: build
@go test ${PACKAGES_NOVENDOR} -tags integration
test:
@go test ${PACKAGES_NOVENDOR}

.PHONY: test_integration
test_integration:
@go test ./rpc/tendermint/test -tags integration

# test burrow with checks for race conditions
.PHONY: test_race
Expand All @@ -125,23 +138,7 @@ test_race: build_race
# build docker image for burrow
.PHONY: build_docker_db
build_docker_db: check
@mkdir -p ${REPO}/target/docker
docker build -t ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} ${REPO}
docker run --rm --entrypoint cat ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} /usr/local/bin/burrow > ${REPO}/target/docker/burrow.dockerartefact
docker run --rm --entrypoint cat ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} /usr/local/bin/burrow-client > ${REPO}/target/docker/burrow-client.dockerartefact
docker build -t ${DOCKER_NAMESPACE}/db:${VERSION} -f Dockerfile.deploy ${REPO}

@rm ${REPO}/target/docker/burrow.dockerartefact
@rm ${REPO}/target/docker/burrow-client.dockerartefact
docker rmi ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA}

### Test docker images for github.com/hyperledger/burrow

# test docker image for burrow
.PHONY: test_docker_db
test_docker_db: check
docker build -t ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} ${REPO}
docker run ${DOCKER_NAMESPACE}/db:build-${COMMIT_SHA} glide nv | xargs go test -tags integration
@./build_tool.sh

### Clean up

Expand Down
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,46 @@ Once the server has started, it will begin syncing up with the network. At that

A commented template config will be written as part of the `monax chains make` [process](https://monax.io/docs/getting-started) and can be edited prior to the `monax chains start` [process](https://monax.io/docs/getting-started).

### Logging
Logging is highly configurable through the `config.toml` `[logging]` section. Each log line is a list of key-value pairs that flows from the root sink through possible child sinks. Each sink can have an output, a transform, and sinks that it outputs to. Below is a more involved example of than the one appearing in the default generated config of what you can configure:

```toml
# This is a top level config section within the main Burrow config
[logging]
# All log lines are sent to the root sink from all sources
[logging.root_sink]
# We define two child sinks that each receive all log lines
[[logging.root_sink.sinks]]
# We send all output to stderr
[logging.root_sink.sinks.output]
output_type = "stderr"

[[logging.root_sink.sinks]]
# But for the second sink we define a transform that filters log lines from Tendermint's p2p module
[logging.root_sink.sinks.transform]
transform_type = "filter"
filter_mode = "exclude_when_all_match"

[[logging.root_sink.sinks.transform.predicates]]
key_regex = "module"
value_regex = "p2p"

[[logging.root_sink.sinks.transform.predicates]]
key_regex = "captured_logging_source"
value_regex = "tendermint_log15"

# The child sinks of this filter transform sink are syslog and file and will omit log lines originating from p2p
[[logging.root_sink.sinks.sinks]]
[logging.root_sink.sinks.sinks.output]
output_type = "syslog"
url = ""
tag = "Burrow-network"

[[logging.root_sink.sinks.sinks]]
[logging.root_sink.sinks.sinks.output]
output_type = "file"
path = "/var/log/burrow-network.log"
```
## Contribute

We welcome all contributions and have submitted the code base to the Hyperledger project governance during incubation phase. As an integral part of this effort we want to invite new contributors, not just to maintain but also to steer the future direction of the code in an active and open process.
Expand Down
Loading

0 comments on commit 9c70b8c

Please sign in to comment.