This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from EOSIO/merge-release-1.0.x-to-master
Merge release/1.0.x to master for v1.0.0
- Loading branch information
Showing
45 changed files
with
7,855 additions
and
1,620 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# Create the environment variable that needs to be uploaded | ||
GIT_SHORT_HASH=$(git log -1 --pretty=%h) | ||
|
||
# export created environment variables (we do this separately, see: https://github.com/koalaman/shellcheck/wiki/SC2155) | ||
export GIT_SHORT_HASH | ||
|
||
IMAGE_BRANCH_TAG=$( echo ${BUILDKITE_BRANCH} | tr '/' '_' ) | ||
if [ $IMAGE_BRANCH_TAG = 'master' ]; then | ||
IMAGE_BRANCH_TAG=latest | ||
fi | ||
|
||
export IMAGE_BRANCH_TAG | ||
|
||
DOCKER_FILE_COMMIT_SHORT_HASH=$(git --no-pager log Dockerfile | head -1 | cut -d' ' -f2 | cut -c-7) | ||
export DOCKER_FILE_COMMIT_SHORT_HASH |
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,2 @@ | ||
FROM postgres | ||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* |
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,44 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function wait_nodeos_ready { | ||
for (( i=0 ; i<10; i++ )); do | ||
! curl -fs http://nodeos:8888/v1/chain/get_info || break | ||
sleep 3 | ||
done | ||
} | ||
|
||
function block_info_row_number { | ||
psql -c 'SELECT COUNT(*) from chain.block_info;' | head -3 | tail -1 | sed 's/^[ \t]*//' | ||
} | ||
|
||
wait_nodeos_ready | ||
|
||
sleep 10 | ||
|
||
## first lets check the number of tables created in the chain schema | ||
num_tables=$(psql -c "select count(*) from pg_stat_all_tables where schemaname='chain'" | head -3 | tail -1 | sed 's/^[ \t]*//') | ||
|
||
if [[ $num_tables < 24 ]]; then | ||
>&2 echo "expected at least 24 tables existed in the chain schema, only got ${num_tables}" | ||
exit 1 | ||
fi | ||
|
||
sleep 30 | ||
|
||
psql -c "select relname from pg_stat_all_tables where schemaname='chain' and (n_tup_ins - n_tup_del)=0;" > empty_tables | ||
let num_empty_tables="$( cat empty_tables | wc -l ) - 4" | ||
|
||
if [[ $num_empty_tables > 3 ]]; then | ||
>&2 echo "expected no more than 3 empty tables, got $num_empty_tables empty tables" | ||
tail +3 empty_tables | head -n -2 >&2 | ||
exit 1 | ||
fi | ||
|
||
old_num_blocks=$(block_info_row_number) | ||
sleep 10 | ||
if [[ $(block_info_row_number) = $old_num_blocks ]]; then | ||
>&2 echo the number of rows in block_info did not increase after 10 seconds | ||
exit 1 | ||
fi |
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,16 @@ | ||
version: "3.9" | ||
services: | ||
postgres-query: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.db_query | ||
command: | ||
- db-query.sh | ||
environment: | ||
- PGUSER=postgres | ||
- PGPASSWORD=password | ||
- PGHOST=postgres | ||
volumes: | ||
- ./db-query.sh:/usr/local/bin/db-query.sh | ||
depends_on: | ||
- postgres |
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,16 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
cd $DIR | ||
|
||
[ -f snapshot.bin ] || ./get_snapshot.sh | ||
[ -f docker-compose.yaml ] || cp ../../docker-compose.yaml . | ||
|
||
export DOCKER_EOSIO_TAG=${1:-develop} | ||
if [[ "$BUILDKITE" == 'true' ]]; then | ||
export DOCKER_HISTORY_TOOLS_TAG=$BUILDKITE_COMMIT | ||
fi | ||
|
||
docker-compose -f docker-compose.yaml -f docker-compose.test.yaml up -V --exit-code-from postgres-query |
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,24 @@ | ||
#get xml with info about snapshots | ||
curl -L https://snapshot.testnet.eos.io > snapshots.xml | ||
|
||
#parse xml to get latest snaspshot | ||
read_dom () { | ||
local IFS=\> | ||
read -d \< ENTITY CONTENT | ||
} | ||
|
||
LATEST_SNAPSHOT="" | ||
|
||
while read_dom; do | ||
if [[ $ENTITY = "Key" ]]; then | ||
if [[ $CONTENT =~ "snapshots" ]]; then | ||
LATEST_SNAPSHOT=$CONTENT | ||
fi | ||
fi | ||
done < snapshots.xml | ||
|
||
#get actual snapshot file and unzip | ||
curl -L https://snapshot.testnet.eos.io/$LATEST_SNAPSHOT | tar -xzf - | ||
|
||
mv snapshots/`ls snapshots` snapshot.bin | ||
rm -rf snapshots.xml snapshots |
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,45 @@ | ||
env: | ||
IMAGE_REPO: eosio/history-tools | ||
# | ||
# The following environment variables are exported by `hooks/pre-command` | ||
# - IMAGE_BRANCH_TAG | ||
# - GIT_SHORT_HASH | ||
# - DOCKER_FILE_COMMIT_SHORT_HASH | ||
|
||
steps: | ||
- label: "Build docker image" | ||
command: | ||
- | | ||
docker build --target base \ | ||
--cache-from ${IMAGE_REPO}:builder_base-${DOCKER_FILE_COMMIT_SHORT_HASH} \ | ||
--tag ${IMAGE_REPO}:builder_base-${DOCKER_FILE_COMMIT_SHORT_HASH} \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
"." | ||
- | | ||
docker build --cache-from ${IMAGE_REPO}:builder_base-${DOCKER_FILE_COMMIT_SHORT_HASH} \ | ||
--cache-from ${IMAGE_REPO}:${IMAGE_BRANCH_TAG} \ | ||
--tag ${IMAGE_REPO}:${GIT_SHORT_HASH} \ | ||
--tag ${IMAGE_REPO}:${IMAGE_BRANCH_TAG} \ | ||
--build-arg BUILDKIT_INLINE_CACHE=1 \ | ||
"." | ||
- docker push ${IMAGE_REPO}:builder_base-${DOCKER_FILE_COMMIT_SHORT_HASH} | ||
- docker push ${IMAGE_REPO}:${GIT_SHORT_HASH} | ||
- docker push ${IMAGE_REPO}:${IMAGE_BRANCH_TAG} | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
|
||
- wait | ||
|
||
- label: "Run integration test against eos(develop)" | ||
timeout: ${TIMEOUT:-10} | ||
command: .cicd/helpers/execute_test.sh develop | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
|
||
- wait | ||
|
||
- label: "Run integration test against eos(release/2.1.x)" | ||
timeout: ${TIMEOUT:-10} | ||
command: .cicd/helpers/execute_test.sh release_2.1.x | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" |
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 |
---|---|---|
|
@@ -10,4 +10,5 @@ _book | |
*/dist | ||
*/node_modules | ||
*/package-lock.json | ||
build* | ||
build | ||
.cicd |
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 |
---|---|---|
|
@@ -8,3 +8,5 @@ package-lock.json | |
_book | ||
*.o | ||
/CMakeLists.txt.user | ||
.cicd/helpers/docker-compose.yaml | ||
.cicd/helpers/snapshot.bin |
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,18 +0,0 @@ | ||
[submodule "external/abieos"] | ||
path = external/abieos | ||
url = https://github.com/EOSIO/abieos.git | ||
[submodule "external/fc"] | ||
path = external/fc | ||
url = https://github.com/EOSIO/fc.git | ||
[submodule "external/appbase"] | ||
path = external/appbase | ||
url = https://github.com/EOSIO/appbase.git | ||
[submodule "external/eos-vm"] | ||
path = external/eos-vm | ||
url = https://github.com/EOSIO/eos-vm.git | ||
[submodule "external/libpqxx"] | ||
path = external/libpqxx | ||
url = https://github.com/jtv/libpqxx.git | ||
[submodule "external/rocksdb"] | ||
path = external/rocksdb | ||
url = https://github.com/facebook/rocksdb.git | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.