-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat: add e2e-init-chain #46
Changes from 7 commits
e16f735
4f4fa69
857ac3e
0906422
a36c5ba
13ebf61
88f66f4
4bf9af9
997de7c
26a3fc9
07b4094
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
RELAYER_TAG := $(shell grep '^ENV RELAYER_TAG' cosmos-relayer/Dockerfile | cut -f3 -d\ ) | ||
BABYLON_FULL_PATH := $(shell git rev-parse --show-toplevel) | ||
|
||
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: | ||
docker build --tag babylonlabs-io/babylond -f babylond/Dockerfile ${BABYLON_FULL_PATH} \ | ||
--build-arg BUILD_TAGS="e2e" | ||
|
||
babylond-rmi: | ||
docker rmi babylonlabs-io/babylond 2>/dev/null; true | ||
|
||
e2e-init-chain-rmi: | ||
docker rmi babylonlabs-io/babylond-e2e-init-chain --force 2>/dev/null; true | ||
|
||
e2e-init-chain: | ||
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 cosmos-relayer babylond-e2e e2e-init-chain e2e-init-chain-rmi babylond-rmi cosmos-relayer-rmi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM golang:1.21 as build-env | ||
|
||
ARG E2E_SCRIPT_NAME | ||
|
||
# Copy All | ||
WORKDIR /go/src/github.com/babylonlabs-io/babylon | ||
COPY ./ /go/src/github.com/babylonlabs-io/babylon/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't it need to be:
i.e we should be able to configure binary version here ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since we want this fixed version for testing, we don't need to have the version argument There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm correct me if I am wrong, but I have had imagined that this is needed similiary to i.e for babylon before upgrade we call :
to actually build the image with some old version. I thought this will happen here too i.e
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will have But if you feel more comfortable I could add it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets add it for the sake of completeness, the worst case scenario it will be unused There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added version argument to dockerfile At the makefile to build the docker I did not set any argument |
||
|
||
RUN LEDGER_ENABLED=false LINK_STATICALLY=false E2E_SCRIPT_NAME=${E2E_SCRIPT_NAME} make e2e-build-script | ||
|
||
FROM debian:bookworm-slim AS wasm-link | ||
|
||
RUN apt-get update && apt-get install -y wget bash | ||
|
||
# Label should match your github repo | ||
LABEL org.opencontainers.image.source="https://github.com/babylonlabs-io/babylond:${VERSION}" | ||
|
||
# Install libraries | ||
# Cosmwasm - Download correct libwasmvm version | ||
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) | ||
RUN rm -f /tmp/go.mod | ||
|
||
# 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"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether
--platform
shouldn't be configurable by some env variable, as when I run test locally on arm mac those fail due to native binding to bls libraries and changing platform fixes thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know that, I will add --platform tag to docker builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if this 997de7c
solved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I have checked it locally and got:
so it seems
--platform=local
does not really work on m1 macs 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking out loud, why do we even need this
--platform=linux/x86_64
in this particular target ? Other docker building commands do not specify thisThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the
--platform
tag at 07b4094