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.

336 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: 5
  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. 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
  160. - persist_to_workspace:
  161. root: build
  162. paths:
  163. - "*.zip"
  164. - "tendermint_linux_amd64"
  165. release_artifacts:
  166. executor: golang
  167. steps:
  168. - restore_cache:
  169. name: "Restore source code cache"
  170. keys:
  171. - go-src-v1-{{ .Revision }}
  172. - checkout
  173. - attach_workspace:
  174. at: /tmp/workspace
  175. - run:
  176. name: "Deploy to GitHub"
  177. command: |
  178. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  179. source /tmp/workspace/release-version.source
  180. echo "---"
  181. ls -la /tmp/workspace/*.zip
  182. echo "---"
  183. python -u scripts/release_management/sha-files.py
  184. echo "---"
  185. cat /tmp/workspace/SHA256SUMS
  186. echo "---"
  187. export RELEASE_ID="`python -u scripts/release_management/github-draft.py`"
  188. echo "Release ID: ${RELEASE_ID}"
  189. #Todo: Parallelize uploads
  190. export GOOS=linux GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  191. export GOOS=darwin GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  192. export GOOS=windows GOARCH=amd64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  193. export GOOS=linux GOARCH=arm && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  194. export GOOS=linux GOARCH=arm64 && python -u scripts/release_management/github-upload.py --id "${RELEASE_ID}"
  195. python -u scripts/release_management/github-upload.py --file "/tmp/workspace/SHA256SUMS" --id "${RELEASE_ID}"
  196. python -u scripts/release_management/github-publish.py --id "${RELEASE_ID}"
  197. release_docker:
  198. machine:
  199. image: ubuntu-1604:201903-01
  200. steps:
  201. - checkout
  202. - attach_workspace:
  203. at: /tmp/workspace
  204. - run:
  205. name: "Deploy to Docker Hub"
  206. command: |
  207. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  208. source /tmp/workspace/release-version.source
  209. cp /tmp/workspace/tendermint_linux_amd64 DOCKER/tendermint
  210. docker build --label="tendermint" --tag="tendermint/tendermint:${CIRCLE_TAG}" --tag="tendermint/tendermint:latest" "DOCKER"
  211. docker login -u "${DOCKERHUB_USER}" --password-stdin \<<< "${DOCKERHUB_PASS}"
  212. docker push "tendermint/tendermint"
  213. docker logout
  214. reproducible_builds:
  215. executor: golang
  216. steps:
  217. - attach_workspace:
  218. at: /tmp/workspace
  219. - checkout
  220. - setup_remote_docker:
  221. docker_layer_caching: true
  222. - run:
  223. name: Build tendermint
  224. no_output_timeout: 20m
  225. command: |
  226. sudo apt-get update
  227. sudo apt-get install -y ruby
  228. bash -x ./scripts/gitian-build.sh all
  229. for os in darwin linux windows; do
  230. cp gitian-build-${os}/result/tendermint-${os}-res.yml .
  231. cp gitian-build-${os}/build/out/tendermint-*.tar.gz .
  232. rm -rf gitian-build-${os}/
  233. done
  234. - store_artifacts:
  235. path: /go/src/github.com/tendermint/tendermint/tendermint-darwin-res.yml
  236. - store_artifacts:
  237. path: /go/src/github.com/tendermint/tendermint/tendermint-linux-res.yml
  238. - store_artifacts:
  239. path: /go/src/github.com/tendermint/tendermint/tendermint-windows-res.yml
  240. - store_artifacts:
  241. path: /go/src/github.com/tendermint/tendermint/tendermint-*.tar.gz
  242. # # Test RPC implementation against the swagger documented specs
  243. # contract_tests:
  244. # working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  245. # machine:
  246. # image: circleci/classic:latest
  247. # environment:
  248. # GOBIN: /home/circleci/.go_workspace/bin
  249. # GOPATH: /home/circleci/.go_workspace/
  250. # GOOS: linux
  251. # GOARCH: amd64
  252. # parallelism: 1
  253. # steps:
  254. # - checkout
  255. # - run:
  256. # name: Test RPC endpoints against swagger documentation
  257. # command: |
  258. # set -x
  259. # export PATH=~/.local/bin:$PATH
  260. # # install node and dredd
  261. # ./scripts/get_nodejs.sh
  262. # # build the binaries with a proper version of Go
  263. # 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
  264. # # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
  265. # go get github.com/snikch/goodman/cmd/goodman
  266. # make contract-tests
  267. workflows:
  268. version: 2
  269. test-suite:
  270. jobs:
  271. - deploy_docs:
  272. context: tendermint-docs
  273. filters:
  274. branches:
  275. only:
  276. - master
  277. tags:
  278. only:
  279. - /^v.*/
  280. - deploy_docs:
  281. context: tendermint-docs-staging
  282. filters:
  283. branches:
  284. only:
  285. - docs-staging
  286. - setup_dependencies
  287. - test_persistence:
  288. requires:
  289. - setup_dependencies
  290. - test_p2p
  291. - test_p2p:
  292. name: test_p2p_ipv6
  293. ipv: 6
  294. - reproducible_builds:
  295. filters:
  296. branches:
  297. only:
  298. - master
  299. - /v[0-9]+\.[0-9]+/
  300. # - contract_tests:
  301. # requires:
  302. # - setup_dependencies
  303. release:
  304. jobs:
  305. - prepare_build
  306. - build_artifacts:
  307. requires:
  308. - prepare_build
  309. - release_artifacts:
  310. requires:
  311. - prepare_build
  312. - build_artifacts
  313. filters:
  314. branches:
  315. only:
  316. - /v[0-9]+\.[0-9]+/
  317. - release_docker:
  318. requires:
  319. - prepare_build
  320. - build_artifacts
  321. filters:
  322. branches:
  323. only:
  324. - /v[0-9]+\.[0-9]+/
  325. - master