8000 [backport] Renaming in docker-related files by sergio-mena · Pull Request #123 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[backport] Renaming in docker-related files #123

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

Merged
merged 11 commits into from
Jan 18, 2023
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Docker
# Build & Push rebuilds the Tendermint docker image on every push to main and creation of tags
# and pushes the image to https://hub.docker.com/r/cometbft/tendermint
# Build & Push rebuilds the CometBFT docker image on every push to main and creation of tags
# and pushes the image to https://hub.docker.com/r/cometbft/cometbft
on:
push:
branches:
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=cometbft/tendermint
DOCKER_IMAGE=cometbft/cometbft
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
Expand Down
2 changes: 1 addition & 1 deletion DOCKER/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tendermint
cometbft
22 changes: 11 additions & 11 deletions DOCKER/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
# hopefully current, go version.
ARG GOLANG_BASE_IMAGE=golang:1.18-alpine

# stage 1 Generate Tendermint Binary
# stage 1 Generate CometBFT Binary
FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder
RUN apk update && \
apk upgrade && \
apk --no-cache add make
COPY / /tendermint
WORKDIR /tendermint
COPY / /cometbft
WORKDIR /cometbft
RUN TARGETPLATFORM=$TARGETPLATFORM make build-linux

# stage 2
FROM $GOLANG_BASE_IMAGE
LABEL maintainer="hello@tendermint.com"< 8000 /td>
LABEL maintainer="hello@informal.systems"

# Tendermint will be looking for the genesis file in /tendermint/config/genesis.json
# CometBFT will be looking for the genesis file in /cometbft/config/genesis.json
# (unless you change `genesis_file` in config.toml). You can put your config.toml and
# private validator file into /tendermint/config.
# private validator file into /cometbft/config.
#
# The /tendermint/data dir is used by tendermint to store state.
ENV TMHOME /tendermint
# The /cometbft/data dir is used by CometBFT to store state.
ENV TMHOME /cometbft

# OS environment setup
# Set user right away for determinism, create directory for persistence and give our user ownership
# jq and curl used for extracting `pub_key` from private validator while
# deploying tendermint with Kubernetes. It is nice to have bash so the users
# deploying CometBFT with Kubernetes. It is nice to have bash so the users
# could execute bash commands.
RUN apk update && \
apk upgrade && \
Expand All @@ -43,11 +43,11 @@ EXPOSE 26656 26657 26660

STOPSIGNAL SIGTERM

COPY --from=builder /tendermint/build/tendermint /usr/bin/tendermint
COPY --from=builder /cometbft/build/cometbft /usr/bin/cometbft

# You can overwrite these before the first run to influence
# config.json and genesis.json. Additionally, you can override
# CMD to add parameters to `tendermint node`.
# CMD to add parameters to `cometbft node`.
ENV PROXY_APP=kvstore MONIKER=dockernode CHAIN_ID=dockerchain

COPY ./DOCKER/docker-entrypoint.sh /usr/local/bin/
Expand Down
6 changes: 3 additions & 3 deletions DOCKER/Dockerfile.build_c-amazonlinux
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ ENV PATH=$PATH:/usr/local/go/bin:/go/bin
ENV GOBIN=/go/bin
ENV GOPATH=/go/src

RUN mkdir -p /tendermint
WORKDIR /tendermint
RUN mkdir -p /cometbft
WORKDIR /cometbft

CMD ["/usr/bin/make", "build", "TENDERMINT_BUILD_OPTIONS=cleveldb"]
CMD ["/usr/bin/make", "build", "COMETBFT_BUILD_OPTIONS=cleveldb"]

4 changes: 2 additions & 2 deletions DOCKER/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ push:
@sh -c "'$(CURDIR)/push.sh'"

build_testing:
docker build --tag tendermint/testing -f ./Dockerfile.testing .
docker build --tag cometbft/testing -f ./Dockerfile.testing .

build_amazonlinux_buildimage:
docker build -t "tendermint/tendermint:build_c-amazonlinux" -f Dockerfile.build_c-amazonlinux .
docker build -t "cometbft/cometbft:build_c-amazonlinux" -f Dockerfile.build_c-amazonlinux .

.PHONY: build push build_testing build_amazonlinux_buildimage
34 changes: 17 additions & 17 deletions DOCKER/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@

## Supported tags and respective `Dockerfile` links

DockerHub tags for official releases are [here](https://hub.docker.com/r/tendermint/tendermint/tags/). The "latest" tag will always point to the highest version number.
DockerHub tags for official releases are [here](https://hub.docker.com/r/cometbft/cometbft/tags/). The "latest" tag will always point to the highest version number.

Official releases can be found [here](https://github.com/tendermint/tendermint/releases F438 ).
Official releases can be found [here](https://github.com/cometbft/cometbft/releases).

The Dockerfile for Tendermint is not expected to change in the near future. The main file used for all builds can be found [here](https://raw.githubusercontent.com/tendermint/tendermint/main/DOCKER/Dockerfile).
The Dockerfile for CometBFT is not expected to change in the near future. The main file used for all builds can be found [here](https://raw.githubusercontent.com/cometbft/cometbft/main/DOCKER/Dockerfile).

Respective versioned files can be found <https://raw.githubusercontent.com/tendermint/tendermint/vX.XX.XX/DOCKER/Dockerfile> (replace the Xs with the version number).
Respective versioned files can be found <https://raw.githubusercontent.com/cometbft/cometbft/vX.XX.XX/DOCKER/Dockerfile> (replace the Xs with the version number).

## Quick reference

- **Where to get help:** <https://tendermint.com/>
- **Where to file issues:** <https://github.com/tendermint/tendermint/issues>
- **Where to get help:** <https://cometbft.com/>
- **Where to file issues:** <https://github.com/cometbft/cometbft/issues>
- **Supported Docker versions:** [the latest release](https://github.com/moby/moby/releases) (down to 1.6 on a best-effort basis)

## Tendermint
## CometBFT

Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines.
CometBFT is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines.

For more background, see the [the docs](https://docs.tendermint.com/v0.37/introduction/#quick-start).
For more background, see the [the docs](https://docs.cometbft.com/v0.37/introduction/#quick-start).

To get started developing applications, see the [application developers guide](https://docs.tendermint.com/v0.37/introduction/quick-start.html).
To get started developing applications, see the [application developers guide](https://docs.cometbft.com/v0.37/introduction/quick-start.html).

## How to use this image

### Start one instance of the Tendermint core with the `kvstore` app
### Start one instance of the CometBFT with the `kvstore` app

A quick example of a built-in app and Tendermint core in one container.
A quick example of a built-in app and CometBFT in one container.

```sh
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint node --proxy_app=kvstore
docker run -it --rm -v "/tmp:/cometbft" cometbft/cometbft init
docker run -it --rm -v "/tmp:/cometbft" cometbft/cometbft node --proxy_app=kvstore
```

## Local cluster

To run a 4-node network, see the `Makefile` in the root of [the repo](https://github.com/tendermint/tendermint/blob/v0.37.x/Makefile) and run:
To run a 4-node network, see the `Makefile` in the root of [the repo](https://github.com/cometbft/cometbft/blob/v0.37.x/Makefile) and run:

```sh
make build-linux
Expand All @@ -49,8 +49,8 @@ Note that this will build and use a different image than the ones provided here.

## License

- Tendermint's license is [Apache 2.0](https://github.com/tendermint/tendermint/blob/main/LICENSE).
- CometBFT's license is [Apache 2.0](https://github.com/cometbft/cometbft/blob/main/LICENSE).

## Contributing

Contributions are most welcome! See the [contributing file](https://github.com/tendermint/tendermint/blob/v0.37.x/CONTRIBUTING.md) for more information.
Contributions are most welcome! See the [contributing file](https://github.com/cometbft/cometbft/blob/v0.37.x/CONTRIBUTING.md) for more information.
2 changes: 1 addition & 1 deletion DOCKER/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_N
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker build -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .
docker build -t "cometbft/cometbft" -t "cometbft/cometbft:$TAG" -t "cometbft/cometbft:$TAG_NO_PATCH" .
fi
6 changes: 3 additions & 3 deletions DOCKER/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e

if [ ! -d "$TMHOME/config" ]; then
echo "Running tendermint init to create (default) configuration for docker run."
tendermint init
echo "Running cometbft init to create (default) configuration for docker run."
cometbft init

sed -i \
-e "s/^proxy_app\s*=.*/proxy_app = \"$PROXY_APP\"/" \
Expand All @@ -20,4 +20,4 @@ if [ ! -d "$TMHOME/config" ]; then
mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json"
fi

exec tendermint "$@"
exec cometbft "$@"
6 changes: 3 additions & 3 deletions DOCKER/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker push "tendermint/tendermint:latest"
docker push "tendermint/tendermint:$TAG"
docker push "tendermint/tendermint:$TAG_NO_PATCH"
docker push "cometbft/cometbft:latest"
docker push "cometbft/cometbft:$TAG"
docker push "cometbft/cometbft:$TAG_NO_PATCH"
fi
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PACKAGES=$(shell go list ./...)
BUILDDIR?=$(CURDIR)/build
OUTPUT?=$(BUILDDIR)/tendermint
OUTPUT?=$(BUILDDIR)/cometbft

BUILD_TAGS?=tendermint
BUILD_TAGS?=cometbft

# If building a release, please checkout the version tag to get the correct version setting
ifneq ($(shell git symbolic-ref -q --short HEAD),)
Expand All @@ -13,40 +13,40 @@ endif

LD_FLAGS = -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
HTTPS_GIT := https://github.com/tendermint/tendermint.git
HTTPS_GIT := https://github.com/cometbft/cometbft.git
CGO_ENABLED ?= 0

# handle nostrip
ifeq (,$(findstring nostrip,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (,$(findstring nostrip,$(COMETBFT_BUILD_OPTIONS)))
BUILD_FLAGS += -trimpath
LD_FLAGS += -s -w
endif

# handle race
ifeq (race,$(findstring race,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (race,$(findstring race,$(COMETBFT_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_FLAGS += -race
endif

# handle cleveldb
ifeq (cleveldb,$(findstring cleveldb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (cleveldb,$(findstring cleveldb,$(COMETBFT_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += cleveldb
endif

# handle badgerdb
ifeq (badgerdb,$(findstring badgerdb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (badgerdb,$(findstring badgerdb,$(COMETBFT_BUILD_OPTIONS)))
BUILD_TAGS += badgerdb
endif

# handle rocksdb
ifeq (rocksdb,$(findstring rocksdb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (rocksdb,$(findstring rocksdb,$(COMETBFT_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += rocksdb
endif

# handle boltdb
ifeq (boltdb,$(findstring boltdb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (boltdb,$(findstring boltdb,$(COMETBFT_BUILD_OPTIONS)))
BUILD_TAGS += boltdb
endif

Expand Down Expand Up @@ -236,7 +236,7 @@ go.sum: go.mod
draw_deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
@goviz -i github.com/cometbft/cometbft/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
.PHONY: draw_deps

get_deps_bin_size:
Expand All @@ -252,9 +252,9 @@ get_deps_bin_size:

# generates certificates for TLS testing in remotedb and RPC server
gen_certs: clean_certs
certstrap init --common-name "tendermint.com" --passphrase ""
certstrap init --common-name "cometbft.com" --passphrase ""
certstrap request-cert --common-name "server" -ip "127.0.0.1" --passphrase ""
certstrap sign "server" --CA "tendermint.com" --passphrase ""
certstrap sign "server" --CA "cometbft.com" --passphrase ""
mv out/server.crt rpc/jsonrpc/server/test.crt
mv out/server.key rpc/jsonrpc/server/test.key
rm -rf out
Expand All @@ -272,7 +272,7 @@ clean_certs:

format:
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w -local github.com/tendermint/tendermint
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w -local github.com/cometbft/cometbft
.PHONY: format

lint:
Expand All @@ -290,7 +290,7 @@ DESTINATION = ./index.html.md
### Documentation ###
###############################################################################

DOCS_OUTPUT?=/tmp/tendermint-core-docs
DOCS_OUTPUT?=/tmp/cometbft-core-docs

# This builds a docs site for each branch/tag in `./docs/versions` and copies
# each site to a version prefixed path. The last entry inside the `versions`
Expand Down Expand Up @@ -335,9 +335,9 @@ check-docs-toc:
###############################################################################

build-docker: build-linux
cp $(OUTPUT) DOCKER/tendermint
docker build --label=tendermint --tag="tendermint/tendermint" DOCKER
rm -rf DOCKER/tendermint
cp $(OUTPUT) DOCKER/cometbft
docker build --label=cometbft --tag="cometbft/cometbft" DOCKER
rm -rf DOCKER/cometbft
.PHONY: build-docker

###############################################################################
Expand All @@ -353,17 +353,17 @@ build-docker-localnode:
@cd networks/local && make
.PHONY: build-docker-localnode

# Runs `make build TENDERMINT_BUILD_OPTIONS=cleveldb` from within an Amazon
# Runs `make build COMETBFT_BUILD_OPTIONS=cleveldb` from within an Amazon
# Linux (v2)-based Docker build container in order to build an Amazon
# Linux-compatible binary. Produces a compatible binary at ./build/tendermint
# Linux-compatible binary. Produces a compatible binary at ./build/cometbft
build_c-amazonlinux:
$(MAKE) -C ./DOCKER build_amazonlinux_buildimage
docker run --rm -it -v `pwd`:/tendermint tendermint/tendermint:build_c-amazonlinux
docker run --rm -it -v `pwd`:/cometbft cometbft/cometbft:build_c-amazonlinux
.PHONY: build_c-amazonlinux

# Run a 4-node testnet locally
localnet-start: localnet-stop build-docker-localnode
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/cometbft:Z cometbft/localnode testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
docker-compose up
.PHONY: localnet-start

Expand Down
Loading
0