Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Update docker script and circleci to automatically upload core image #334

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ jobs:
if [ -z "${TERRAD_VERSION}" ]; then
docker build .
else
docker build -t tendermint/terra:$TERRAD_VERSION .
# docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS
# docker push tendermint/terra:$TERRAD_VERSION
docker build -t terraproject/core:$TERRAD_VERSION .
docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS
docker push terraproject/core:$TERRAD_VERSION
fi
docker-tagged:
Expand All @@ -289,9 +289,9 @@ jobs:
- setup_remote_docker:
docker_layer_caching: true
- run: |
docker build -t tendermint/terra:$CIRCLE_TAG .
# docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS
# docker push tendermint/terra:$CIRCLE_TAG
docker build -t terraproject/core:$CIRCLE_TAG .
docker login --password-stdin -u $DOCKER_USER \<<<$DOCKER_PASS
docker push terraproject/core:$CIRCLE_TAG
reproducible-builds:
executor: golang
Expand All @@ -318,27 +318,6 @@ jobs:
- store_artifacts:
path: /go/src/github.com/terra-project/core/terra-windows-res.yml

# FIXME: The `setup-contract-tests-data` make target is broken as it completely
# overrides the .terrad directory.
#
# contract-tests:
# executor: golang
# steps:
# - attach_workspace:
# at: /tmp/workspace
# - checkout
# - setup_remote_docker:
# docker_layer_caching: true
# - run:
# name: Get Node.js and test REST implementation against swagger documentation at https://swagger.terra.money/rpc/
# command: |
# go get github.com/snikch/goodman/cmd/goodman
# make build
# make build-contract-tests-hooks
# make setup-contract-tests-data
# export PATH=~/.local/bin:$PATH
# ./contrib/get_node.sh && make contract-tests

workflows:
version: 2
test-suite:
Expand Down Expand Up @@ -414,6 +393,3 @@ workflows:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
# - contract-tests:
# requires:
# - setup-dependencies
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Simple usage with a mounted data directory:
# > docker build -t terra .
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start
FROM golang:alpine AS build-env

# Set up dependencies
Expand Down
26 changes: 1 addition & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,41 +169,17 @@ build-docker-terradnode:

# Run a 4-node testnet locally
localnet-start: localnet-stop
@if ! [ -f build/node0/terrad/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/terrad:Z tendermint/terradnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi
@if ! [ -f build/node0/terrad/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/terrad:Z terraproject/core testnet --v 4 -o . --starting-ip-address 192.168.10.2 ; fi
docker-compose up -d

# Stop testnet
localnet-stop:
docker-compose down

setup-contract-tests-data:
echo 'Prepare data for the contract tests'
rm -rf /tmp/contract_tests ; \
mkdir /tmp/contract_tests ; \
cp "${GOPATH}/pkg/mod/${CORE_PACK}/client/lcd/swagger-ui/swagger.yaml" /tmp/contract_tests/swagger.yaml ; \
./build/terrad init --home /tmp/contract_tests/.terrad --chain-id lcd contract-tests ; \
tar -xzf lcd_test/testdata/state.tar.gz -C /tmp/contract_tests/

start-terra: setup-contract-tests-data
./build/terrad --home /tmp/contract_tests/.terrad start &
@sleep 2s

setup-transactions: start-terra
@bash ./lcd_test/testdata/setup.sh

run-lcd-contract-tests:
@echo "Running Terra LCD for contract tests"
./build/terracli rest-server --laddr tcp://0.0.0.0:8080 --home /tmp/contract_tests/.terracli --node http://localhost:26657 --chain-id lcd --trust-node true

contract-tests: setup-transactions
@echo "Running Terra LCD for contract tests"
dredd && pkill terrad

# include simulations
include sims.mk

.PHONY: all build-linux install install-debug \
go-mod-cache draw-deps clean build \
setup-transactions setup-contract-tests-data start-terra run-lcd-contract-tests contract-tests \
test test-all test-build test-cover test-unit test-race

8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
services:
terradnode0:
container_name: terradnode0
image: "tendermint/terradnode"
image: "terraproject/core"
ports:
- "26656-26657:26656-26657"
environment:
Expand All @@ -17,7 +17,7 @@ services:

terradnode1:
container_name: terradnode1
image: "tendermint/terradnode"
image: "terraproject/core"
ports:
- "26659-26660:26656-26657"
environment:
Expand All @@ -31,7 +31,7 @@ services:

terradnode2:
container_name: terradnode2
image: "tendermint/terradnode"
image: "terraproject/core"
environment:
- ID=2
- LOG=$${LOG:-terrad.log}
Expand All @@ -45,7 +45,7 @@ services:

terradnode3:
container_name: terradnode3
image: "tendermint/terradnode"
image: "terraproject/core"
environment:
- ID=3
- LOG=$${LOG:-terrad.log}
Expand Down
2 changes: 1 addition & 1 deletion networks/local/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for the "terradnode" docker image.

all:
docker build --tag tendermint/terradnode terradnode
docker build --tag terraproject/core core

.PHONY: all

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apk update && \
apk upgrade && \
apk --no-cache add curl jq file

VOLUME [ /terrad ]
VOLUME ["/terrad"]
WORKDIR /terrad
EXPOSE 26656 26657
ENTRYPOINT ["/usr/bin/wrapper.sh"]
Expand Down
File renamed without changes.