forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into hotfix/try-catch
- Loading branch information
Showing
11 changed files
with
116 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,45 @@ | ||
machine: | ||
services: | ||
- docker | ||
environment: | ||
IROHA_HOME: $(pwd)/iroha | ||
PATH: $PATH:/opt/cmake-3.5.2-Linux-x86_64/bin | ||
JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64/ | ||
java: | ||
version: 'oraclejdk8' | ||
pre: | ||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
- sudo apt-get update | ||
- sudo apt-get install g++-5 | ||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20 | ||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 20 | ||
- g++ -v | ||
|
||
- sudo apt-get -y install build-essential libtcmalloc-minimal4 && sudo ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc_minimal.so | ||
- sudo apt-get -y install xsltproc | ||
- sudo apt-get -y install libhdf5-serial-dev libleveldb-dev libsnappy-dev liblmdb-dev | ||
- sudo apt-get -y install autoconf automake libtool unzip | ||
|
||
|
||
checkout: | ||
post: | ||
- git submodule init | ||
- git submodule update | ||
|
||
- cd $IROHA_HOME | ||
- cd $IROHA_HOME/core/vendor/leveldb; make -j 4 | ||
- cd $IROHA_HOME/core/vendor/ed25519; make -j 4 | ||
- cd $IROHA_HOME/core/vendor/Cappuccino; git pull origin master | ||
- cd $IROHA_HOME/core/vendor/KeccakCodePackage; make; make generic64/libkeccak.a | ||
- cd $IROHA_HOME/core/infra/crypto/; make | ||
- git submodule sync | ||
- git submodule update --init --recursive | ||
|
||
dependencies: | ||
cache_directories: | ||
- ~/iroha/core/vendor/ | ||
- /tmp/protobuf | ||
- /tmp/grpc | ||
pre: | ||
- if [[ ! -e /tmp/protobuf ]]; then git clone -b v3.0.0 https://github.com/google/protobuf.git /tmp/protobuf; cd /tmp/protobuf; (git cherry-pick 1760feb621a913189b90fe8595fffb74bce84598; echo Force continue); cd /tmp/protobuf; ./autogen.sh; ./configure --prefix=/usr; make -j 4; fi; | ||
- cd /tmp/protobuf; sudo make install | ||
- protoc --version | ||
- ~/docker | ||
override: | ||
# one way to cache iroha-dev container is to save it to tar image. 2 mins vs 10 mins without caching. | ||
- if [[ -e ~/docker/iroha-dev.tar ]]; then docker load -i ~/docker/iroha-dev.tar; fi | ||
# build iroha-dev (if it is in cache, this step will be skipped) and iroha-docker (production) images | ||
- ${IROHA_HOME}/docker/build.sh | ||
# cache iroha-dev image. takes 30 sec to save into file | ||
- mkdir -p ~/docker; docker save hyperledger/iroha-dev > ~/docker/iroha-dev.tar | ||
|
||
- if [[ ! -e /tmp/grpc ]]; then git clone -b $(curl -L http://grpc.io/release) https://github.com/grpc/grpc /tmp/grpc; cd /tmp/grpc; git submodule update --init; make -j 4; fi; | ||
- cd /tmp/grpc; sudo make install | ||
- which grpc_cpp_plugin | ||
|
||
test: | ||
pre: | ||
- mkdir build; cd build; cmake ..; make | ||
override: | ||
- ./test.sh | ||
# TESTS: | ||
# first, run ctest inside a container | ||
- docker run -p 1204:1204 hyperledger/iroha-docker /test.sh | ||
# then, run iroha with dummy config (1 node) and test curl request | ||
- docker run -d -p 1204:1204 hyperledger/iroha-docker /run.sh && sleep 5 && curl -X POST http://127.0.0.1:1204/account/register -d '{"publicKey":"WdvM/DPabapmtA7ISbTYPywbHxk8gWu2221LzmcmAgw=","alias":"yonezu","timestamp":1482053586}' | ||
|
||
|
||
deployment: | ||
hub: | ||
branch: master | ||
commands: | ||
- docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} | ||
- docker push hyperledger/iroha-docker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#----------------------------------------------------------------------- | ||
# iroha-rel - IROHA container for Release | ||
# | ||
# build : docker build -t hyperledger/iroha . | ||
# build : docker build -t hyperledger/iroha-docker . | ||
# | ||
# Copyright (c) 2016 Soramitsu,Co.,Ltd. | ||
# All Rights Reserved. | ||
|
@@ -11,8 +11,8 @@ FROM ubuntu | |
|
||
MAINTAINER Takeshi Yonezu <[email protected]> / Bogdan Vaneev <[email protected]> | ||
|
||
LABEL BUILD="docker build -t hyperledger/iroha ." | ||
LABEL RUN="docker run -d --name iroha hyperledger/iroha" | ||
LABEL BUILD="docker build -t hyperledger/iroha-docker ." | ||
LABEL RUN="docker run -d --name iroha hyperledger/iroha-docker" | ||
|
||
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 | ||
# IROHA_HOME here should be the same as IROHA_RELEASE in iroha-dev | ||
|
@@ -21,17 +21,20 @@ ENV IROHA_HOME=/usr/local/iroha | |
# this copies iroha and unpacks its binaries | ||
ADD ./iroha.tar / | ||
ADD ./scripts / | ||
ADD ./config/sumeragi.json /tmp/sumeragi.json | ||
|
||
RUN groupadd -g 168 iroha && \ | ||
useradd -u 168 -c "IROHA Administrator" -s /bin/bash -m -d ${IROHA_HOME} -p $(perl -e "print(crypt('passw0rd', 'sa'));") -g iroha iroha && \ | ||
usermod -G adm,sudo iroha && \ | ||
echo "export IROHA_HOME=${IROHA_HOME}" >> ${IROHA_HOME}/.bashrc && \ | ||
echo "export JAVA_HOME=${JAVA_HOME}" >> ${IROHA_HOME}/.bashrc; \ | ||
|
||
apt update && apt -y upgrade && apt -y install default-jdk netcat libsnappy-dev; \ | ||
|
||
echo /usr/local/lib >>/etc/ld.so.conf && \ | ||
echo ${IROHA_HOME}/lib >>/etc/ld.so.conf && \ | ||
|
||
mkdir -p ${IROHA_HOME}/config && \ | ||
cp /tmp/sumeragi.json ${IROHA_HOME}/config/sumeragi.json && \ | ||
|
||
ldconfig | ||
|
||
CMD ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"group": [ | ||
{ | ||
"ip": "127.0.0.1", | ||
"name": "da77880a3da4", | ||
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8=" | ||
} | ||
], | ||
"me": { | ||
"ip": "127.0.0.1", | ||
"name": "da77880a3da4", | ||
"privateKey": "cPY84e0BXGUHBjT4QdlPI0LI3BPIfUfSZjB8jdWURkNQ+pEagT/ysrewbt2YUo/Qbfd5vczW5oDooGSNUBTj9g==", | ||
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8=" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
total=0 | ||
for file in ${IROHA_HOME}/test_bin/*; do | ||
./${file} | ||
total=$((total + $?)) | ||
done | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters