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.

334 lines
11 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: "Build docs"
  100. command: make build-docs
  101. - run:
  102. name: "Sync to S3"
  103. command: make sync-docs
  104. prepare_build:
  105. executor: golang
  106. steps:
  107. - restore_cache:
  108. name: "Restore source code cache"
  109. keys:
  110. - go-src-v1-{{ .Revision }}
  111. - checkout
  112. - run:
  113. name: Get next release number
  114. command: |
  115. export LAST_TAG="`git describe --tags --abbrev=0 --match "${CIRCLE_BRANCH}.*"`"
  116. echo "Last tag: ${LAST_TAG}"
  117. if [ -z "${LAST_TAG}" ]; then
  118. export LAST_TAG="${CIRCLE_BRANCH}"
  119. echo "Last tag not found. Possibly fresh branch or feature branch. Setting ${LAST_TAG} as tag."
  120. fi
  121. export NEXT_TAG="`python -u scripts/release_management/bump-semver.py --version "${LAST_TAG}"`"
  122. echo "Next tag: ${NEXT_TAG}"
  123. echo "export CIRCLE_TAG=\"${NEXT_TAG}\"" > release-version.source
  124. - run:
  125. name: Build dependencies
  126. command: make tools
  127. - persist_to_workspace:
  128. root: .
  129. paths:
  130. - "release-version.source"
  131. - save_cache:
  132. key: v2-release-deps-{{ checksum "go.sum" }}
  133. paths:
  134. - "/go/pkg/mod"
  135. build_artifacts:
  136. executor: golang
  137. parallelism: 4
  138. steps:
  139. - restore_cache:
  140. name: "Restore source code cache"
  141. keys:
  142. - go-src-v1-{{ .Revision }}
  143. - checkout
  144. - restore_cache:
  145. name: "Restore release dependencies cache"
  146. keys:
  147. - v2-release-deps-{{ checksum "go.sum" }}
  148. - attach_workspace:
  149. at: /tmp/workspace
  150. - run:
  151. name: Build artifact
  152. command: |
  153. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  154. source /tmp/workspace/release-version.source
  155. 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
  156. 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
  157. 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
  158. 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
  159. - persist_to_workspace:
  160. root: build
  161. paths:
  162. - "*.zip"
  163. - "tendermint_linux_amd64"
  164. release_artifacts:
  165. executor: golang
  166. steps:
  167. - restore_cache:
  168. name: "Restore source code cache"
  169. keys:
  170. - go-src-v1-{{ .Revision }}
  171. - checkout
  172. - attach_workspace:
  173. at: /tmp/workspace
  174. - run:
  175. name: "Deploy to GitHub"
  176. command: |
  177. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  178. source /tmp/workspace/release-version.source
  179. echo "---"
  180. ls -la /tmp/workspace/*.zip
  181. echo "---"
  182. python -u scripts/release_management/sha-files.py
  183. echo "---"
  184. cat /tmp/workspace/SHA256SUMS
  185. echo "---"
  186. export RELEASE_ID="`python -u scripts/release_management/github-draft.py`"
  187. echo "Release ID: ${RELEASE_ID}"
  188. #Todo: Parallelize uploads
  189. export GOOS=linux GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  190. export GOOS=darwin GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  191. export GOOS=windows GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  192. export GOOS=linux GOARCH=arm && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  193. python -u scripts/release_management/github-upload.py --file "/tmp/workspace/SHA256SUMS" --id "${RELEASE_ID}"
  194. python -u scripts/release_management/github-publish.py --id "${RELEASE_ID}"
  195. release_docker:
  196. machine:
  197. image: ubuntu-1604:201903-01
  198. steps:
  199. - checkout
  200. - attach_workspace:
  201. at: /tmp/workspace
  202. - run:
  203. name: "Deploy to Docker Hub"
  204. command: |
  205. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  206. source /tmp/workspace/release-version.source
  207. cp /tmp/workspace/tendermint_linux_amd64 DOCKER/tendermint
  208. docker build --label="tendermint" --tag="tendermint/tendermint:${CIRCLE_TAG}" --tag="tendermint/tendermint:latest" "DOCKER"
  209. docker login -u "${DOCKERHUB_USER}" --password-stdin \<<< "${DOCKERHUB_PASS}"
  210. docker push "tendermint/tendermint"
  211. docker logout
  212. reproducible_builds:
  213. executor: golang
  214. steps:
  215. - attach_workspace:
  216. at: /tmp/workspace
  217. - checkout
  218. - setup_remote_docker:
  219. docker_layer_caching: true
  220. - run:
  221. name: Build tendermint
  222. no_output_timeout: 20m
  223. command: |
  224. sudo apt-get update
  225. sudo apt-get install -y ruby
  226. bash -x ./scripts/gitian-build.sh all
  227. for os in darwin linux windows; do
  228. cp gitian-build-${os}/result/tendermint-${os}-res.yml .
  229. cp gitian-build-${os}/build/out/tendermint-*.tar.gz .
  230. rm -rf gitian-build-${os}/
  231. done
  232. - store_artifacts:
  233. path: /go/src/github.com/tendermint/tendermint/tendermint-darwin-res.yml
  234. - store_artifacts:
  235. path: /go/src/github.com/tendermint/tendermint/tendermint-linux-res.yml
  236. - store_artifacts:
  237. path: /go/src/github.com/tendermint/tendermint/tendermint-windows-res.yml
  238. - store_artifacts:
  239. path: /go/src/github.com/tendermint/tendermint/tendermint-*.tar.gz
  240. # # Test RPC implementation against the swagger documented specs
  241. # contract_tests:
  242. # working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  243. # machine:
  244. # image: circleci/classic:latest
  245. # environment:
  246. # GOBIN: /home/circleci/.go_workspace/bin
  247. # GOPATH: /home/circleci/.go_workspace/
  248. # GOOS: linux
  249. # GOARCH: amd64
  250. # parallelism: 1
  251. # steps:
  252. # - checkout
  253. # - run:
  254. # name: Test RPC endpoints against swagger documentation
  255. # command: |
  256. # set -x
  257. # export PATH=~/.local/bin:$PATH
  258. # # install node and dredd
  259. # ./scripts/get_nodejs.sh
  260. # # build the binaries with a proper version of Go
  261. # 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
  262. # # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
  263. # go get github.com/snikch/goodman/cmd/goodman
  264. # make contract-tests
  265. workflows:
  266. version: 2
  267. test-suite:
  268. jobs:
  269. - deploy_docs:
  270. context: tendermint-docs
  271. filters:
  272. branches:
  273. only:
  274. - master
  275. tags:
  276. only:
  277. - /^v.*/
  278. - deploy_docs:
  279. context: tendermint-docs-staging
  280. filters:
  281. branches:
  282. only:
  283. - docs-staging
  284. - setup_dependencies
  285. - test_persistence:
  286. requires:
  287. - setup_dependencies
  288. - test_p2p
  289. - test_p2p:
  290. name: test_p2p_ipv6
  291. ipv: 6
  292. - reproducible_builds:
  293. filters:
  294. branches:
  295. only:
  296. - master
  297. - /v[0-9]+\.[0-9]+/
  298. # - contract_tests:
  299. # requires:
  300. # - setup_dependencies
  301. release:
  302. jobs:
  303. - prepare_build
  304. - build_artifacts:
  305. requires:
  306. - prepare_build
  307. - release_artifacts:
  308. requires:
  309. - prepare_build
  310. - build_artifacts
  311. filters:
  312. branches:
  313. only:
  314. - /v[0-9]+\.[0-9]+/
  315. - release_docker:
  316. requires:
  317. - prepare_build
  318. - build_artifacts
  319. filters:
  320. branches:
  321. only:
  322. - /v[0-9]+\.[0-9]+/
  323. - master