Skip to content

Commit

Permalink
Merge pull request #1821 from mesg-foundation/dev
Browse files Browse the repository at this point in the history
Release v0.24.0
  • Loading branch information
Nicolas Mahé authored May 12, 2020
2 parents 36eab7f + 1adf685 commit 7f2705c
Show file tree
Hide file tree
Showing 59 changed files with 1,395 additions and 1,762 deletions.
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ run_on_machine: &run_on_machine

run_on_docker: &run_on_docker
docker:
- image: circleci/golang:1.13.0
- image: circleci/golang:1.13.10

go_path: &go_path /tmp/go/path

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
name: "Install Go"
command: |
sudo rm -rf /usr/local/go
curl -sSL "https://dl.google.com/go/go1.13.linux-amd64.tar.gz" | sudo tar -xz -C /usr/local/
curl -sSL "https://dl.google.com/go/go1.13.10.linux-amd64.tar.gz" | sudo tar -xz -C /usr/local/
echo "export PATH=$PATH:/usr/local/go/bin" >> $BASH_ENV
- run: docker swarm init
- <<: *restore_go_cache
Expand All @@ -79,33 +79,33 @@ jobs:
- image: golangci/golangci-lint:v1.21
steps:
- checkout
- run: make lint
- run: golangci-lint

"publish_docker_dev":
"publish_docker_unstable":
<<: *run_on_machine
steps:
- checkout
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: make docker-publish-dev version=`echo $CIRCLE_SHA1 | cut -c1-7`
- run: make publish-docker-unstable version=`echo $CIRCLE_SHA1 | cut -c1-7`

"publish_docker_prod":
<<: *run_on_machine
steps:
- checkout
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: make docker-publish version=$CIRCLE_TAG
- run: make publish-docker-prod version=$CIRCLE_TAG

"release_cli_dev":
"release_cli_unstable":
<<: *run_on_docker
steps:
- checkout
- run: make publish-cmds version="dev build `echo $CIRCLE_SHA1 | cut -c1-7`" release-type=dev
- run: make publish version="`echo $CIRCLE_SHA1 | cut -c1-7`" release-type=unstable

"release_cli_prod":
<<: *run_on_docker
steps:
- checkout
- run: make publish-cmds version=$CIRCLE_TAG release-type=prod
- run: make publish version=$CIRCLE_TAG release-type=prod

workflows:
version: 2
Expand Down Expand Up @@ -133,7 +133,7 @@ workflows:
- "test"
- "lint"

release_dev:
release_unstable:
jobs:
- "lint":
filters:
Expand All @@ -151,10 +151,10 @@ workflows:
requires:
- "test"
- "lint"
- "publish_docker_dev":
- "publish_docker_unstable":
requires:
- "test_e2e"
- "release_cli_dev":
- "release_cli_unstable":
requires:
- "test_e2e"

Expand Down
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Dockerfile

# build
/bin
!/bin/engine

# repo files
README.md
Expand All @@ -11,7 +10,6 @@ CONTRIBUTING.md
schema1.svg
.github

/scripts
/examples

# test & debug files
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## [v0.24.0](https://github.com/mesg-foundation/engine/releases/tag/v0.24.0)

#### Breaking Changes

- ([#1810](https://github.com/mesg-foundation/engine/pull/1810)) Switch to CLI based Engine.

#### Added

- ([#1798](https://github.com/mesg-foundation/engine/pull/1798)) Add tx commands for service, process, execution and runner modules.
- ([#1801](https://github.com/mesg-foundation/engine/pull/1801)) Add orchestrator command to CLI.
- ([#1806](https://github.com/mesg-foundation/engine/pull/1806)) Create pre-configured dev docker image.
- ([#1808](https://github.com/mesg-foundation/engine/pull/1808)) Add cli dockerfile.
- ([#1812](https://github.com/mesg-foundation/engine/pull/1812)) Add logs to orchestrator.

#### Changed

- ([#1802](https://github.com/mesg-foundation/engine/pull/1802)) Rename in cosmos lcd and rpc clients minGasPrices by simply gasPrices.
- ([#1803](https://github.com/mesg-foundation/engine/pull/1803)) Update readme.
- ([#1817](https://github.com/mesg-foundation/engine/pull/1817)) Use docker container in e2e tests.

#### Fixed

- ([#1760](https://github.com/mesg-foundation/engine/pull/1760)) Set grace period to 1m in dev script.
- ([#1809](https://github.com/mesg-foundation/engine/pull/1809)) Fix runner e2e that block the tests on error.

#### Dependencies

- ([#1745](https://github.com/mesg-foundation/engine/pull/1745)) Bump github.com/sirupsen/logrus from 1.4.2 to 1.5.0.
- ([#1777](https://github.com/mesg-foundation/engine/pull/1777)) Bump github.com/spf13/viper from 1.6.2 to 1.6.3.
- ([#1782](https://github.com/mesg-foundation/engine/pull/1782)) Bump github.com/golang/protobuf from 1.3.4 to 1.4.0.
- ([#1794](https://github.com/mesg-foundation/engine/pull/1794)) Bump google.golang.org/grpc from 1.28.0 to 1.29.1.
- ([#1800](https://github.com/mesg-foundation/engine/pull/1800)) Bump github.com/prometheus/client_golang from 1.5.0 to 1.6.0.
- ([#1811](https://github.com/mesg-foundation/engine/pull/1811)) Revert golang/protobuf to v1.3.5 and prometheus/client_golang to v1.5.1.

## [v0.23.0](https://github.com/mesg-foundation/engine/releases/tag/v0.23.0)

#### Added
Expand Down
28 changes: 17 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# base Go image version.
FROM golang:1.13.0-stretch AS build

WORKDIR /project
# base Go image version for building the binaries
FROM golang:1.13.10 AS build
WORKDIR /app

# install dependencies
COPY go.mod go.sum ./
RUN go mod download

COPY . .
ARG version
RUN go build -mod=readonly -o ./bin/engine -ldflags="-X 'github.com/mesg-foundation/engine/version.Version=$version'" core/main.go

RUN go build -mod=readonly -o ./bin/mesg-cli -ldflags="-s -w -X 'github.com/cosmos/cosmos-sdk/version.Name=mesg' -X 'github.com/cosmos/cosmos-sdk/version.ServerName=mesg-daemon' -X 'github.com/cosmos/cosmos-sdk/version.ClientName=mesg-cli' -X 'github.com/cosmos/cosmos-sdk/version.Version=$version'" ./cmd/mesg-cli/
RUN go build -mod=readonly -o ./bin/mesg-daemon -ldflags="-s -w -X 'github.com/cosmos/cosmos-sdk/version.Name=mesg' -X 'github.com/cosmos/cosmos-sdk/version.ServerName=mesg-daemon' -X 'github.com/cosmos/cosmos-sdk/version.ClientName=mesg-cli' -X 'github.com/cosmos/cosmos-sdk/version.Version=$version'" ./cmd/mesg-daemon/

# ubuntu image with binaries for distribution
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates=20180409 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
apt-get install -y --no-install-recommends ca-certificates=20180409 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY --from=build /project/bin/engine .
CMD ["./engine"]
ENV PATH="/app:${PATH}"

COPY --from=build /app/bin/mesg-cli .
COPY --from=build /app/bin/mesg-daemon .

CMD ["mesg-daemon", "start"]
15 changes: 8 additions & 7 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates=20180409 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY ./bin/engine .
CMD [ "./engine" ]
ARG from
FROM $from

COPY ./dev-chain/cli /root/.mesg-cli
COPY ./dev-chain/validator /root/.mesg-node
COPY ./scripts/dev-starter.sh .

CMD ["bash", "dev-starter.sh"]
4 changes: 2 additions & 2 deletions Dockerfile.tools
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# base Go image version.
FROM golang:1.13.0-stretch
FROM golang:1.13.10

WORKDIR /project

Expand All @@ -9,7 +9,7 @@ RUN apt-get update -y && \
rm -rf /var/lib/apt/lists/*

# protobuf(protoc) version.
ARG protobuf=3.9.1
ARG protobuf=3.11.4
ARG gogoprotobuf=1.3.1

# install protobuf(protoc).
Expand Down
115 changes: 55 additions & 60 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,92 +1,87 @@
.PHONY: all build build-cmd-cosmos changelog check-version clean clean-build clean-docker dep dev dev-mon dev-start dev-stop docker-build docker-dev docker-publish docker-publish-dev docker-tools genesis lint protobuf test publish-cmds
.PHONY: build build-docker publish publish-docker-prod publish-docker-unstable test e2e dep lint build-tools protobuf changelog clean dev dev-mon

version ?= local
MAJOR_VERSION := $(shell echo $(version) | cut -d . -f 1)
MINOR_VERSION := $(shell echo $(version) | cut -d . -f 1-2)
PATCH_VERSION := $(version)

all: clean lint build test e2e
# Build

check-version:
ifndef version
$(error version is undefined)
endif
build: dep
./scripts/build-cli.sh "$(version)"

docker-build: check-version
build-docker:
docker build \
--build-arg version=$(PATCH_VERSION) \
-t mesg/engine:$(MAJOR_VERSION) \
-t mesg/engine:$(MINOR_VERSION) \
-t mesg/engine:$(PATCH_VERSION) \
-t mesg/engine:latest \
--build-arg version=$(version) \
-t mesg/engine:$(version) \
.
docker build \
-f ./Dockerfile.dev \
--build-arg from=mesg/engine:$(version) \
-t mesg/engine:$(version)-dev \
.

docker-dev: dep
./scripts/build-engine.sh
# Publish

docker-publish: docker-build
docker push mesg/engine:$(MAJOR_VERSION)
publish: build
./scripts/publish-cli.sh "$(version)" "$(release-type)"

publish-docker-prod: build-docker
docker tag mesg/engine:$(version) mesg/engine:$(MINOR_VERSION)
docker tag mesg/engine:$(version) mesg/engine:$(MAJOR_VERSION)
docker tag mesg/engine:$(version) mesg/engine:latest

docker push mesg/engine:$(version)
docker push mesg/engine:$(MINOR_VERSION)
docker push mesg/engine:$(PATCH_VERSION)
docker push mesg/engine:$(MAJOR_VERSION)
docker push mesg/engine:latest

docker-publish-dev: check-version
docker build -t mesg/engine:dev --build-arg version=$(version) .
docker push mesg/engine:dev
docker tag mesg/engine:$(version)-dev mesg/engine:$(MINOR_VERSION)-dev
docker tag mesg/engine:$(version)-dev mesg/engine:$(MAJOR_VERSION)-dev
docker tag mesg/engine:$(version)-dev mesg/engine:latest-dev

docker-tools:
docker build -t mesg/tools:local -f Dockerfile.tools .

dev: docker-dev
- ./scripts/dev.sh
docker push mesg/engine:$(version)-dev
docker push mesg/engine:$(MINOR_VERSION)-dev
docker push mesg/engine:$(MAJOR_VERSION)-dev
docker push mesg/engine:latest-dev

dev-mon: docker-dev
- ./scripts/dev.sh -m
publish-docker-unstable: build-docker
docker tag mesg/engine:$(version) mesg/engine:unstable
docker push mesg/engine:unstable

dev-start: docker-dev
./scripts/dev.sh -q
docker tag mesg/engine:$(version)-dev mesg/engine:unstable-dev
docker push mesg/engine:unstable-dev

dev-stop: docker-dev
./scripts/dev.sh -m stop
# Test

dep:
go mod download
test: dep
go test -short -mod=readonly -v -coverprofile=coverage.txt ./...

build: check-version dep
go build -mod=readonly -o ./bin/engine -ldflags="-X 'github.com/mesg-foundation/engine/version.Version=$(version)'" core/main.go
e2e: build-docker
./scripts/run-e2e.sh "$(version)"

publish-cmds: check-version dep
./scripts/publish-cmds.sh "$(version)" "$(release-type)"
dev: build-docker
./scripts/dev.sh "$(version)"

build-cmd: dep
go build -mod=readonly -o ./bin/mesg-cli ./cmd/mesg-cli/
go build -mod=readonly -o ./bin/mesg-daemon ./cmd/mesg-daemon/
dev-mon: build-docker
./scripts/dev.sh "$(version)" "monitoring"

e2e: docker-dev
./scripts/run-e2e.sh
# MISC

test: dep
go test -short -mod=readonly -v -coverprofile=coverage.txt ./...
dep:
go mod download

lint:
golangci-lint run
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.21 golangci-lint run

protobuf: docker-tools
build-tools:
docker build -t mesg/tools:local -f Dockerfile.tools .

protobuf: build-tools
docker run --rm -v $(PWD):/project mesg/tools:local ./scripts/build-proto.sh

changelog:
./scripts/changelog.sh $(milestone)

clean-build:
clean:
- rm -rf bin

clean-docker:
- docker image rm \
mesg/engine:$(version) \
mesg/engine:latest \
mesg/engine:local \
mesg/engine:dev 2>/dev/null

clean: clean-build clean-docker

genesis:
go run internal/tools/gen-genesis/main.go --path $(path) --chain-id $(chain-id) --validators $(validators)
- docker image rm $(docker images | grep 'mesg')
Loading

0 comments on commit 7f2705c

Please sign in to comment.