-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Test e2e upgrade test with current `dev` branch - 5f8af8c Applied from PRs babylonchain/babylon#730 and babylonchain/babylon#727
- Loading branch information
1 parent
e1a7749
commit cf0f881
Showing
27 changed files
with
795 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:build e2e | ||
|
||
package app | ||
|
||
import "github.com/babylonlabs-io/babylon/app/upgrades/vanilla" | ||
|
||
func init() { | ||
Upgrades = append(Upgrades, vanilla.Upgrade) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
RELAYER_TAG := $(shell grep '^ENV RELAYER_TAG' cosmos-relayer/Dockerfile | cut -f3 -d\ ) | ||
BABYLON_FULL_PATH := $(shell git rev-parse --show-toplevel) | ||
BABYLON_VERSION_BEFORE_UPGRADE ?= v0.9.0 | ||
|
||
all: babylond cosmos-relayer | ||
|
||
babylond: babylond-rmi | ||
docker build --tag babylonlabs-io/babylond -f babylond/Dockerfile \ | ||
$(shell git rev-parse --show-toplevel) | ||
docker build --tag babylonlabs-io/babylond -f babylond/Dockerfile ${BABYLON_FULL_PATH} | ||
|
||
babylond-e2e: babylond-rmi | ||
docker build --tag babylonlabs-io/babylond -f babylond/Dockerfile ${BABYLON_FULL_PATH} \ | ||
--build-arg BUILD_TAGS="e2e" | ||
|
||
babylond-before-upgrade: | ||
docker rmi babylonlabs-io/babylond-before-upgrade 2>/dev/null; true && \ | ||
docker build --tag babylonlabs-io/babylond-before-upgrade -f babylond/Dockerfile \ | ||
--build-arg VERSION="${BABYLON_VERSION_BEFORE_UPGRADE}" ${BABYLON_FULL_PATH} | ||
|
||
babylond-rmi: | ||
docker rmi babylonlabs-io/babylond 2>/dev/null; true | ||
|
||
e2e-init-chain: | ||
@DOCKER_BUILDKIT=1 docker build -t babylonlabs-io/babylond-e2e-init-chain --build-arg E2E_SCRIPT_NAME=chain --platform=linux/x86_64 \ | ||
-f e2e-initialization/init.Dockerfile ${BABYLON_FULL_PATH} | ||
|
||
cosmos-relayer: cosmos-relayer-rmi | ||
docker build --tag babylonlabs-io/cosmos-relayer:${RELAYER_TAG} -f cosmos-relayer/Dockerfile \ | ||
$(shell git rev-parse --show-toplevel)/contrib/images/cosmos-relayer | ||
${BABYLON_FULL_PATH}/contrib/images/cosmos-relayer | ||
docker tag babylonlabs-io/cosmos-relayer:${RELAYER_TAG} babylonlabs-io/cosmos-relayer:latest | ||
|
||
cosmos-relayer-rmi: | ||
docker rmi babylonlabs-io/cosmos-relayer 2>/dev/null; true | ||
|
||
.PHONY: all babylond cosmos-relayer babylond-rmi cosmos-relayer-rmi | ||
.PHONY: all babylond babylond-before-upgrade cosmos-relayer e2e-init-chain babylond-rmi cosmos-relayer-rmi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
FROM golang:1.21 as build-env | ||
|
||
ARG E2E_SCRIPT_NAME | ||
|
||
# Install cli tools for building and final image | ||
RUN apt-get update && apt-get install -y make git bash gcc curl jq | ||
|
||
WORKDIR /go/src/github.com/babylonlabs-io/babylon | ||
|
||
# First cache dependencies | ||
COPY go.mod go.sum /go/src/github.com/babylonlabs-io/babylon/ | ||
RUN go mod download | ||
|
||
# Copy everything else | ||
COPY ./ /go/src/github.com/babylonlabs-io/babylon/ | ||
|
||
RUN LEDGER_ENABLED=false LINK_STATICALLY=false E2E_SCRIPT_NAME=${E2E_SCRIPT_NAME} make e2e-build-script | ||
|
||
FROM debian:bookworm-slim AS run | ||
|
||
# Create a user | ||
RUN addgroup --gid 1137 --system babylon && adduser --uid 1137 --gid 1137 --system --home /home/babylon babylon | ||
RUN apt-get update && apt-get install -y bash curl jq wget | ||
|
||
COPY --from=build-env /go/src/github.com/babylonlabs-io/babylon/go.mod /tmp | ||
RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2) && \ | ||
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.$(uname -m).so \ | ||
-O /lib/libwasmvm.$(uname -m).so && \ | ||
# verify checksum | ||
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \ | ||
sha256sum /lib/libwasmvm.$(uname -m).so | grep $(cat /tmp/checksums.txt | grep libwasmvm.$(uname -m) | cut -d ' ' -f 1) | ||
|
||
# Args only last for a single build stage - renew | ||
ARG E2E_SCRIPT_NAME | ||
|
||
COPY --from=build-env /go/src/github.com/babylonlabs-io/babylon/build/${E2E_SCRIPT_NAME} /bin/${E2E_SCRIPT_NAME} | ||
|
||
# Docker ARGs are not expanded in ENTRYPOINT in the exec mode. At the same time, | ||
# it is impossible to add CMD arguments when running a container in the shell mode. | ||
# As a workaround, we create the entrypoint.sh script to bypass these issues. | ||
RUN echo "#!/bin/bash\n${E2E_SCRIPT_NAME} \"\$@\"" >> entrypoint.sh && chmod +x entrypoint.sh | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.