You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

313 lines
10 KiB

[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
[RPC] Static swagger (#3880) * manually swagging Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * three definitions with polymorphism Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added blockchain and block Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * low quality generation, commit, block_response and validators Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * genesis and consensus states endpoints Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * consensus parameters Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * fix indentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add height to consensus parameters endpoint Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * unconfirmed_txs and num_unconfirmed_txs Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing query parameter Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add ABCI queries Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * added index document for swagger documentation Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * add missing routes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests added on CCI Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * contract tests job should be in the test suite Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify requirements to test Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * typo Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * build is a prerequisite to start localnet Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * reduce nodejs size, move goodman to get_tools, add docs, fix comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Update scripts/get_tools.sh That's cleaner, thanks! Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com> * xz not supported by cci image, let's keep it simple Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * REMOVE-indirect debug of CCI paths Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment, volume is empty but binary has been produced Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * dirty experiment going on Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * locally works, CCI have difficulties with second layaer containers volumes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * restore experiment, use machine instead of docker for contract tests Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * simplify a bit Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * rollback on machine golang Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Document the changes Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * Changelog Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com> * comments Signed-off-by: Karoly Albert Szabo <szabo.karoly.a@gmail.com>
5 years ago
  1. version: 2.1
  2. executors:
  3. golang:
  4. docker:
  5. - image: tendermintdev/docker-tendermint-build
  6. working_directory: /go/src/github.com/tendermint/tendermint
  7. environment:
  8. GOBIN: /tmp/bin
  9. release:
  10. machine: true
  11. docs:
  12. docker:
  13. - image: tendermintdev/docker-website-deployment
  14. environment:
  15. AWS_REGION: us-east-1
  16. commands:
  17. run_test:
  18. parameters:
  19. script_path:
  20. type: string
  21. steps:
  22. - attach_workspace:
  23. at: /tmp/bin
  24. - restore_cache:
  25. name: "Restore source code cache"
  26. keys:
  27. - go-src-v1-{{ .Revision }}
  28. - checkout
  29. - restore_cache:
  30. name: "Restore go modules cache"
  31. keys:
  32. - go-mod-v1-{{ checksum "go.sum" }}
  33. - run:
  34. name: "Running test"
  35. command: |
  36. bash << parameters.script_path >>
  37. jobs:
  38. setup_dependencies:
  39. executor: golang
  40. steps:
  41. - checkout
  42. - restore_cache:
  43. name: "Restore go modules cache"
  44. keys:
  45. - go-mod-v1-{{ checksum "go.sum" }}
  46. - run:
  47. command: |
  48. mkdir -p /tmp/bin
  49. - run:
  50. name: Cache go modules
  51. command: make go-mod-cache
  52. - run:
  53. name: tools
  54. command: make tools
  55. - run:
  56. name: "Build binaries"
  57. command: make install install_abci
  58. - save_cache:
  59. name: "Save go modules cache"
  60. key: go-mod-v1-{{ checksum "go.sum" }}
  61. paths:
  62. - "/go/pkg/mod"
  63. - save_cache:
  64. name: "Save source code cache"
  65. key: go-src-v1-{{ .Revision }}
  66. paths:
  67. - ".git"
  68. - persist_to_workspace:
  69. root: "/tmp/bin"
  70. paths:
  71. - "."
  72. test_persistence:
  73. executor: golang
  74. steps:
  75. - run_test:
  76. script_path: test/persist/test_failure_indices.sh
  77. test_p2p:
  78. environment:
  79. GOBIN: /home/circleci/.go_workspace/bin
  80. GOPATH: /home/circleci/.go_workspace
  81. machine:
  82. image: circleci/classic:latest
  83. parameters:
  84. ipv:
  85. type: integer
  86. default: 4
  87. steps:
  88. - checkout
  89. - run: mkdir -p $GOPATH/src/github.com/tendermint
  90. - run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint
  91. - run: bash test/p2p/circleci.sh << parameters.ipv >>
  92. - store_artifacts:
  93. path: /home/circleci/project/test/p2p/logs
  94. deploy_docs:
  95. executor: docs
  96. steps:
  97. - checkout
  98. - run:
  99. name: "Pull versions"
  100. command: git fetch origin v0.32 v0.33
  101. - run:
  102. name: "Build docs"
  103. command: make build-docs
  104. - run:
  105. name: "Sync to S3"
  106. command: make sync-docs
  107. prepare_build:
  108. executor: golang
  109. steps:
  110. - restore_cache:
  111. name: "Restore source code cache"
  112. keys:
  113. - go-src-v1-{{ .Revision }}
  114. - checkout
  115. - run:
  116. name: Get next release number
  117. command: |
  118. export LAST_TAG="`git describe --tags --abbrev=0 --match "${CIRCLE_BRANCH}.*"`"
  119. echo "Last tag: ${LAST_TAG}"
  120. if [ -z "${LAST_TAG}" ]; then
  121. export LAST_TAG="${CIRCLE_BRANCH}"
  122. echo "Last tag not found. Possibly fresh branch or feature branch. Setting ${LAST_TAG} as tag."
  123. fi
  124. export NEXT_TAG="`python -u scripts/release_management/bump-semver.py --version "${LAST_TAG}"`"
  125. echo "Next tag: ${NEXT_TAG}"
  126. echo "export CIRCLE_TAG=\"${NEXT_TAG}\"" > release-version.source
  127. - run:
  128. name: Build dependencies
  129. command: make tools
  130. - persist_to_workspace:
  131. root: .
  132. paths:
  133. - "release-version.source"
  134. - save_cache:
  135. key: v2-release-deps-{{ checksum "go.sum" }}
  136. paths:
  137. - "/go/pkg/mod"
  138. build_artifacts:
  139. executor: golang
  140. parallelism: 5
  141. steps:
  142. - restore_cache:
  143. name: "Restore source code cache"
  144. keys:
  145. - go-src-v1-{{ .Revision }}
  146. - checkout
  147. - restore_cache:
  148. name: "Restore release dependencies cache"
  149. keys:
  150. - v2-release-deps-{{ checksum "go.sum" }}
  151. - attach_workspace:
  152. at: /tmp/workspace
  153. - run:
  154. name: Build artifact
  155. command: |
  156. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  157. source /tmp/workspace/release-version.source
  158. if test ${CIRCLE_NODE_INDEX:-0} == 0 ;then export GOOS=linux GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  159. if test ${CIRCLE_NODE_INDEX:-0} == 1 ;then export GOOS=darwin GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  160. if test ${CIRCLE_NODE_INDEX:-0} == 2 ;then export GOOS=windows GOARCH=amd64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  161. if test ${CIRCLE_NODE_INDEX:-0} == 3 ;then export GOOS=linux GOARCH=arm && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  162. if test ${CIRCLE_NODE_INDEX:-0} == 4 ;then export GOOS=linux GOARCH=arm64 && export OUTPUT=build/tendermint_${GOOS}_${GOARCH} && make build && python -u scripts/release_management/zip-file.py ;fi
  163. - persist_to_workspace:
  164. root: build
  165. paths:
  166. - "*.zip"
  167. - "tendermint_linux_amd64"
  168. release_artifacts:
  169. executor: golang
  170. steps:
  171. - restore_cache:
  172. name: "Restore source code cache"
  173. keys:
  174. - go-src-v1-{{ .Revision }}
  175. - checkout
  176. - attach_workspace:
  177. at: /tmp/workspace
  178. - run:
  179. name: "Deploy to GitHub"
  180. command: |
  181. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  182. source /tmp/workspace/release-version.source
  183. echo "---"
  184. ls -la /tmp/workspace/*.zip
  185. echo "---"
  186. python -u scripts/release_management/sha-files.py
  187. echo "---"
  188. cat /tmp/workspace/SHA256SUMS
  189. echo "---"
  190. export RELEASE_ID="`python -u scripts/release_management/github-draft.py`"
  191. echo "Release ID: ${RELEASE_ID}"
  192. #Todo: Parallelize uploads
  193. export GOOS=linux GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  194. export GOOS=darwin GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  195. export GOOS=windows GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  196. export GOOS=linux GOARCH=arm && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  197. export GOOS=linux GOARCH=arm64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  198. python -u scripts/release_management/github-upload.py --file "/tmp/workspace/SHA256SUMS" --id "${RELEASE_ID}"
  199. python -u scripts/release_management/github-publish.py --id "${RELEASE_ID}"
  200. reproducible_builds:
  201. executor: golang
  202. steps:
  203. - attach_workspace:
  204. at: /tmp/workspace
  205. - checkout
  206. - setup_remote_docker:
  207. docker_layer_caching: true
  208. - run:
  209. name: Build tendermint
  210. no_output_timeout: 20m
  211. command: |
  212. sudo apt-get update
  213. sudo apt-get install -y ruby
  214. bash -x ./scripts/gitian-build.sh all
  215. for os in darwin linux windows; do
  216. cp gitian-build-${os}/result/tendermint-${os}-res.yml .
  217. cp gitian-build-${os}/build/out/tendermint-*.tar.gz .
  218. rm -rf gitian-build-${os}/
  219. done
  220. - store_artifacts:
  221. path: /go/src/github.com/tendermint/tendermint/tendermint-darwin-res.yml
  222. - store_artifacts:
  223. path: /go/src/github.com/tendermint/tendermint/tendermint-linux-res.yml
  224. - store_artifacts:
  225. path: /go/src/github.com/tendermint/tendermint/tendermint-windows-res.yml
  226. - store_artifacts:
  227. path: /go/src/github.com/tendermint/tendermint/tendermint-*.tar.gz
  228. # # Test RPC implementation against the swagger documented specs
  229. # contract_tests:
  230. # working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  231. # machine:
  232. # image: circleci/classic:latest
  233. # environment:
  234. # GOBIN: /home/circleci/.go_workspace/bin
  235. # GOPATH: /home/circleci/.go_workspace/
  236. # GOOS: linux
  237. # GOARCH: amd64
  238. # parallelism: 1
  239. # steps:
  240. # - checkout
  241. # - run:
  242. # name: Test RPC endpoints against swagger documentation
  243. # command: |
  244. # set -x
  245. # export PATH=~/.local/bin:$PATH
  246. # # install node and dredd
  247. # ./scripts/get_nodejs.sh
  248. # # build the binaries with a proper version of Go
  249. # docker run --rm -v "$PWD":/go/src/github.com/tendermint/tendermint -w /go/src/github.com/tendermint/tendermint golang make build-linux build-contract-tests-hooks
  250. # # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
  251. # go get github.com/snikch/goodman/cmd/goodman
  252. # make contract-tests
  253. workflows:
  254. version: 2
  255. test-suite:
  256. jobs:
  257. - deploy_docs:
  258. context: tendermint-docs
  259. filters:
  260. branches:
  261. only:
  262. - master
  263. tags:
  264. only:
  265. - /^v.*/
  266. - deploy_docs:
  267. context: tendermint-docs-staging
  268. filters:
  269. branches:
  270. only:
  271. - docs-staging
  272. - setup_dependencies
  273. - test_persistence:
  274. requires:
  275. - setup_dependencies
  276. - test_p2p
  277. - test_p2p:
  278. name: test_p2p_ipv6
  279. ipv: 6
  280. - reproducible_builds:
  281. filters:
  282. branches:
  283. only:
  284. - master
  285. - /v[0-9]+\.[0-9]+/
  286. # - contract_tests:
  287. # requires:
  288. # - setup_dependencies
  289. release:
  290. jobs:
  291. - prepare_build
  292. - build_artifacts:
  293. requires:
  294. - prepare_build
  295. - release_artifacts:
  296. requires:
  297. - prepare_build
  298. - build_artifacts
  299. filters:
  300. branches:
  301. only:
  302. - /v[0-9]+\.[0-9]+/