Skip to content

Commit

Permalink
Merge branch 'develop' into feature/shm-stateful-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsa committed Feb 22, 2018
2 parents 017eb60 + b3559a3 commit 36d79e0
Show file tree
Hide file tree
Showing 55 changed files with 1,235 additions and 723 deletions.
104 changes: 51 additions & 53 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ defaults: &defaults
environment:
IROHA_HOME: /opt/iroha
IROHA_BUILD: /opt/iroha/build
CCACHE_DIR: /opt/.ccache
SONAR_DIR: /opt/.sonar


defaults: &version
environment:
Expand All @@ -20,24 +17,25 @@ jobs:
docker:
- image: hyperledger/iroha-docker-develop:v1
- image: postgres:9.5
- image: redis:3.2.8
steps:
- checkout
- run: echo $(eval echo "$IROHA_VERSION")
- restore_cache:
keys:
- v1-build-cache-debug-{{ arch }}-{{ .Branch }}-
- v1-build-cache-debug-{{ arch }}-
- build-linux-debug-{{ arch }}-{{ .Branch }}-
- build-linux-debug-{{ arch }}-
- build-linux-debug-
paths:
- $CCACHE_DIR
- ~/.ccache

- run:
name: ccache setup
command: |
ccache --version
ccache --show-stats
ccache --zero-stats
ccache --max-size=1G
# debug/coverage builds produce 2G cache
ccache --max-size=5G
- run:
name: cmake
command: >
Expand All @@ -50,16 +48,8 @@ jobs:
- run:
name: make
command: |
cmake --build $IROHA_BUILD -- -j4
- run:
name: ccache teardown
command: |
ccache --cleanup
ccache --show-stats
- save_cache:
key: v1-build-cache-debug-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
- $CCACHE_DIR
cmake --build $IROHA_BUILD -- -j3
- run: ccache --show-stats
- run:
name: unit tests, generate xunit-*.xml
command: cmake --build $IROHA_BUILD --target test
Expand All @@ -72,6 +62,11 @@ jobs:
- run:
name: codecov.io
command: bash <(curl -s https://codecov.io/bash) -f $IROHA_BUILD/reports/gcovr.xml || echo "Codecov did not collect coverage reports"
- save_cache:
key: build-linux-debug-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
- ~/.ccache
when: always
- persist_to_workspace:
root: /opt/iroha/build
paths:
Expand All @@ -89,17 +84,19 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-build-cache-release-{{ arch }}-{{ .Branch }}-
- v1-build-cache-release-{{ arch }}-
- build-linux-release-{{ arch }}-{{ .Branch }}-
- build-linux-release-{{ arch }}-
- build-linux-release-
paths:
- $CCACHE_DIR
- ~/.ccache
- run:
name: ccache setup
command: |
ccache --version
ccache --show-stats
ccache --zero-stats
ccache --max-size=1G
# release builds produce cache <100M
ccache --max-size=500M
- run:
name: cmake
command: >
Expand All @@ -116,15 +113,12 @@ jobs:
name: make and package
command: |
cmake --build $IROHA_BUILD --target package -- -j4
- run:
name: ccache teardown
command: |
ccache --cleanup
ccache --show-stats
- run: ccache --show-stats
- save_cache:
key: v1-build-cache-release-{{ arch }}-{{ .Branch }}-{{ epoch }}
key: build-linux-release-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
- $CCACHE_DIR
- ~/.ccache
when: always
- run:
name: copy deb file
command: |
Expand Down Expand Up @@ -198,7 +192,7 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-sonar-
- v3-sonar-
- attach_workspace:
at: /opt/iroha/build
- run:
Expand All @@ -220,9 +214,10 @@ jobs:
echo "required env vars not found"
fi
- save_cache:
key: v1-sonar-{{ epoch }}
key: v3-sonar-{{ epoch }}
paths:
- $SONAR_DIR
- ~/.sonar
when: always


# executed only for develop, master and release branches
Expand All @@ -235,7 +230,7 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-sonar-
- v3-sonar-
- attach_workspace:
at: /opt/iroha/build
- run:
Expand All @@ -252,9 +247,10 @@ jobs:
echo "required env vars not found"
fi
- save_cache:
key: v1-sonar-{{ epoch }}
key: v3-sonar-{{ epoch }}
paths:
- $SONAR_DIR
- ~/.sonar
when: always


build-macos-release:
Expand All @@ -265,25 +261,29 @@ jobs:
- checkout
- restore_cache:
keys:
- v1-brew-{{ arch }}
- brew-
paths:
- Library/Caches/Homebrew
- ~/Library/Caches/Homebrew
- run:
name: install dev dependencies
command: brew install cmake boost postgres grpc autoconf automake libtool ccache
- save_cache:
key: brew-{{ arch }}-{{ epoch }}
key: brew-{{ epoch }}
paths:
- Library/Caches/Homebrew
- ~/Library/Caches/Homebrew
when: always
- restore_cache:
keys:
- v1-build-cache-{{ arch }}-{{ .Branch }}
- build-mac-release-{{ arch }}-{{ .Branch }}-
- build-mac-release-{{ arch }}-
- build-mac-release-
paths:
- $CCACHE_DIR
- ~/.ccache
- restore_cache:
keys:
- v1-external-{{ arch }}-{{ .Branch }}
- v1-external-{{ arch }}
- mac-external-{{ arch }}-{{ .Branch }}-
- mac-external-{{ arch }}-
- mac-external-
paths:
- external
- run:
Expand All @@ -292,7 +292,8 @@ jobs:
ccache --version
ccache --show-stats
ccache --zero-stats
ccache --max-size=1G
# release build produces <20M cache per build
ccache --max-size=100M
- run:
name: cmake
command: >
Expand All @@ -306,20 +307,17 @@ jobs:
name: make
command: |
cmake --build build --target package -- -j$(sysctl -n hw.ncpu)
- run:
name: ccache teardown
command: |
ccache --cleanup
ccache --show-stats
- run: ccache --show-stats
- save_cache:
key: v1-build-cache-{{ arch }}-{{ .Branch }}-{{ epoch }}
key: build-mac-release-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
- $CCACHE_DIR
- ~/.ccache
when: always
- save_cache:
key: v1-external-{{ arch }}-{{ .Branch }}-{{ epoch }}
key: mac-external-{{ arch }}-{{ .Branch }}-{{ epoch }}
paths:
- external
- run: ccache --show-stats
when: always
- run:
name: rename artifacts
command: |
Expand Down
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/postgres_block_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace iroha {
PostgresBlockIndex::PostgresBlockIndex(pqxx::nontransaction &transaction)
: transaction_(transaction),
log_(logger::log("PostgresBlockIndex")),
execute_{makeExecute(transaction_, log_)} {}
execute_{makeExecuteOptional(transaction_, log_)} {}

auto PostgresBlockIndex::indexAccountIdHeight(const std::string &account_id,
const std::string &height) {
Expand Down
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/postgres_block_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace iroha {

pqxx::nontransaction &transaction_;
logger::Logger log_;
using ExecuteType = decltype(makeExecute(transaction_, log_));
using ExecuteType = decltype(makeExecuteOptional(transaction_, log_));
ExecuteType execute_;

// TODO: refactor to return Result when it is introduced IR-775
Expand Down
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/postgres_block_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace iroha {
: block_store_(file_store),
transaction_(transaction),
log_(logger::log("PostgresBlockIndex")),
execute_{makeExecute(transaction_, log_)} {}
execute_{makeExecuteOptional(transaction_, log_)} {}

rxcpp::observable<model::Block> PostgresBlockQuery::getBlocks(
uint32_t height, uint32_t count) {
Expand Down
2 changes: 1 addition & 1 deletion irohad/ametsuchi/impl/postgres_block_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace iroha {
FlatFile &block_store_;
pqxx::nontransaction &transaction_;
logger::Logger log_;
using ExecuteType = decltype(makeExecute(transaction_, log_));
using ExecuteType = decltype(makeExecuteOptional(transaction_, log_));
ExecuteType execute_;
model::converters::JsonBlockFactory serializer_;
};
Expand Down
Loading

0 comments on commit 36d79e0

Please sign in to comment.