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.

339 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: "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. release_docker:
  201. machine:
  202. image: ubuntu-1604:201903-01
  203. steps:
  204. - checkout
  205. - attach_workspace:
  206. at: /tmp/workspace
  207. - run:
  208. name: "Deploy to Docker Hub"
  209. command: |
  210. # Setting CIRCLE_TAG because we do not tag the release ourselves.
  211. source /tmp/workspace/release-version.source
  212. cp /tmp/workspace/tendermint_linux_amd64 DOCKER/tendermint
  213. docker build --label="tendermint" --tag="tendermint/tendermint:${CIRCLE_TAG}" --tag="tendermint/tendermint:latest" "DOCKER"
  214. docker login -u "${DOCKERHUB_USER}" --password-stdin \<<< "${DOCKERHUB_PASS}"
  215. docker push "tendermint/tendermint"
  216. docker logout
  217. reproducible_builds:
  218. executor: golang
  219. steps:
  220. - attach_workspace:
  221. at: /tmp/workspace
  222. - checkout
  223. - setup_remote_docker:
  224. docker_layer_caching: true
  225. - run:
  226. name: Build tendermint
  227. no_output_timeout: 20m
  228. command: |
  229. sudo apt-get update
  230. sudo apt-get install -y ruby
  231. bash -x ./scripts/gitian-build.sh all
  232. for os in darwin linux windows; do
  233. cp gitian-build-${os}/result/tendermint-${os}-res.yml .
  234. cp gitian-build-${os}/build/out/tendermint-*.tar.gz .
  235. rm -rf gitian-build-${os}/
  236. done
  237. - store_artifacts:
  238. path: /go/src/github.com/tendermint/tendermint/tendermint-darwin-res.yml
  239. - store_artifacts:
  240. path: /go/src/github.com/tendermint/tendermint/tendermint-linux-res.yml
  241. - store_artifacts:
  242. path: /go/src/github.com/tendermint/tendermint/tendermint-windows-res.yml
  243. - store_artifacts:
  244. path: /go/src/github.com/tendermint/tendermint/tendermint-*.tar.gz
  245. # # Test RPC implementation against the swagger documented specs
  246. # contract_tests:
  247. # working_directory: /home/circleci/.go_workspace/src/github.com/tendermint/tendermint
  248. # machine:
  249. # image: circleci/classic:latest
  250. # environment:
  251. # GOBIN: /home/circleci/.go_workspace/bin
  252. # GOPATH: /home/circleci/.go_workspace/
  253. # GOOS: linux
  254. # GOARCH: amd64
  255. # parallelism: 1
  256. # steps:
  257. # - checkout
  258. # - run:
  259. # name: Test RPC endpoints against swagger documentation
  260. # command: |
  261. # set -x
  262. # export PATH=~/.local/bin:$PATH
  263. # # install node and dredd
  264. # ./scripts/get_nodejs.sh
  265. # # build the binaries with a proper version of Go
  266. # 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
  267. # # This docker image works with go 1.7, we can install here the hook handler that contract-tests is going to use
  268. # go get github.com/snikch/goodman/cmd/goodman
  269. # make contract-tests
  270. workflows:
  271. version: 2
  272. test-suite:
  273. jobs:
  274. - deploy_docs:
  275. context: tendermint-docs
  276. filters:
  277. branches:
  278. only:
  279. - master
  280. tags:
  281. only:
  282. - /^v.*/
  283. - deploy_docs:
  284. context: tendermint-docs-staging
  285. filters:
  286. branches:
  287. only:
  288. - docs-staging
  289. - setup_dependencies
  290. - test_persistence:
  291. requires:
  292. - setup_dependencies
  293. - test_p2p
  294. - test_p2p:
  295. name: test_p2p_ipv6
  296. ipv: 6
  297. - reproducible_builds:
  298. filters:
  299. branches:
  300. only:
  301. - master
  302. - /v[0-9]+\.[0-9]+/
  303. # - contract_tests:
  304. # requires:
  305. # - setup_dependencies
  306. release:
  307. jobs:
  308. - prepare_build
  309. - build_artifacts:
  310. requires:
  311. - prepare_build
  312. - release_artifacts:
  313. requires:
  314. - prepare_build
  315. - build_artifacts
  316. filters:
  317. branches:
  318. only:
  319. - /v[0-9]+\.[0-9]+/
  320. - release_docker:
  321. requires:
  322. - prepare_build
  323. - build_artifacts
  324. filters:
  325. branches:
  326. only:
  327. - /v[0-9]+\.[0-9]+/
  328. - master