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

ci: Test with CometBFT v0.38.2 #210

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Expand Up @@ -31,15 +31,15 @@ test:
go test -cover -race ./...
.PHONY: test

# Builds a Docker image called "tendermint/localnode", which is based on
# Builds a Docker image called "cometbft/localnode", which is based on
# Tendermint Core. Takes the current system user and group ID as the user/group
# IDs for the tmuser user within the container so as to eliminate permissions
# issues when generating testnet files in the localnet target.
localnode:
@docker build -f ./test/localnode/Dockerfile \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
-t tendermint/localnode:latest \
-t cometbft/localnode:latest \
./test/localnode/
.PHONY: localnode

Expand All @@ -48,9 +48,9 @@ localnet: localnode
mkdir -p build && \
docker run \
--rm \
-v $(BUILD_DIR):/tendermint:Z \
tendermint/localnode \
testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.168.10.2; \
-v $(BUILD_DIR):/cometbft:Z \
cometbft/localnode \
testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.168.10.2; \
fi
.PHONY: localnet

Expand Down
24 changes: 12 additions & 12 deletions test/docker-compose.yml
Expand Up @@ -6,56 +6,56 @@ version: '3'
services:
node0:
container_name: node0
image: "tendermint/localnode"
image: "cometbft/localnode"
ports:
- "26656-26657:26656-26657"
environment:
- ID=0
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.2

node1:
container_name: node1
image: "tendermint/localnode"
image: "cometbft/localnode"
ports:
- "26659-26660:26656-26657"
environment:
- ID=1
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.3

node2:
container_name: node2
image: "tendermint/localnode"
image: "cometbft/localnode"
environment:
- ID=2
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
ports:
- "26661-26662:26656-26657"
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.4

node3:
container_name: node3
image: "tendermint/localnode"
image: "cometbft/localnode"
environment:
- ID=3
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
ports:
- "26663-26664:26656-26657"
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.5
Expand Down
10 changes: 6 additions & 4 deletions test/localnode/Dockerfile
@@ -1,4 +1,4 @@
FROM tendermint/tendermint:v0.34.24
FROM cometbft/cometbft:v0.38.2
LABEL maintainer="hello@informal.systems"

ARG UID
Expand All @@ -10,19 +10,21 @@ RUN apk update && \
apk upgrade && \
apk --no-cache add curl jq file shadow

RUN groupadd -g ${GID} tmgroup || true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a problem in CI.


# Set the tmuser's UID and GID to the preconfigured values to match the host's
# UID/GID combo. Otherwise permissions become difficult to manage.
RUN usermod -u ${UID} -g ${GID} tmuser

USER tmuser

VOLUME /tendermint
WORKDIR /tendermint
VOLUME /cometbft
WORKDIR /cometbft

EXPOSE 26656 26657
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD ["node", "--proxy_app", "kvstore"]
STOPSIGNAL SIGTERM

COPY entrypoint.sh /usr/bin/entrypoint.sh
COPY config-template.toml /etc/tendermint/config-template.toml
COPY config-template.toml /etc/cometbft/config-template.toml
16 changes: 8 additions & 8 deletions test/localnode/entrypoint.sh
Expand Up @@ -3,15 +3,15 @@
##
## Input parameters
##
BINARY=${BINARY:-/usr/bin/tendermint}
BINARY=${BINARY:-/usr/bin/cometbft}
ID=${ID:-0}
LOG=${LOG:-tendermint.log}
LOG=${LOG:-cometbft.log}

##
## Assert linux binary
##
if ! [ -f "${BINARY}" ]; then
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'tendermint' E.g.: -e BINARY=tendermint_my_test_version"
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'cometbft' E.g.: -e BINARY=cometbft_my_test_version"
exit 1
fi
BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')"
Expand All @@ -25,14 +25,14 @@ id
##
## Run binary with all parameters
##
export TMHOME="/tendermint/node${ID}"
export CMTHOME="/cometbft/node${ID}"

if [ -d "`dirname ${TMHOME}/${LOG}`" ]; then
"$BINARY" "$@" | tee "${TMHOME}/${LOG}"
if [ -d "`dirname ${CMTHOME}/${LOG}`" ]; then
"$BINARY" "$@" | tee "${CMTHOME}/${LOG}"
else
"$BINARY" "$@"
fi

find /tendermint -type d -exec chmod ug=rwx,o=rx {} \;
find /tendermint -type f -exec chmod ug=rw,o=r {} \;
find /cometbft -type d -exec chmod ug=rwx,o=rx {} \;
find /cometbft -type f -exec chmod ug=rw,o=r {} \;