Skip to content

Commit

Permalink
ci: optimize upgrade tests by pulling image
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Jul 8, 2024
1 parent f45a56b commit b471960
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
21 changes: 14 additions & 7 deletions Dockerfile-localnet
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ COPY --from=latest-build /go/bin/zetacored /go/bin/zetaclientd /go/bin/zetaclien

# optional old version build. This old build is used as the genesis version in the upgrade tests.
# use --target latest-runtime to skip
#
# TODO: just download binaries from github release now that we're using glibc
# we can't do this right now since we do not have a v16 release candidate
# https://github.com/zeta-chain/node/issues/2179
FROM base-build as old-build
FROM base-build as old-build-source

ARG OLD_VERSION
RUN git clone https://github.com/zeta-chain/node.git
Expand All @@ -74,8 +70,19 @@ RUN cd node && git fetch
RUN cd node && git checkout ${OLD_VERSION}
RUN cd node && make install

FROM base-runtime AS old-runtime
FROM base-runtime AS old-runtime-source

COPY --from=cosmovisor-build /go/bin/cosmovisor /usr/local/bin
COPY --from=old-build /go/bin/zetacored /go/bin/zetaclientd /usr/local/bin
COPY --from=latest-build /go/bin/zetaclientd-supervisor /usr/local/bin
COPY --from=latest-build /go/bin/zetaclientd-supervisor /usr/local/bin

FROM base-runtime AS old-runtime

ARG BUILDARCH

COPY --from=cosmovisor-build /go/bin/cosmovisor /usr/local/bin
COPY --from=latest-build /go/bin/zetaclientd-supervisor /usr/local/bin
RUN curl -Lo /usr/local/bin/zetacored https://github.com/zeta-chain/ci-testing-node/releases/download/v17.0.1-internal/zetacored-linux-${BUILDARCH} && \
chmod 755 /usr/local/bin/zetacored && \
curl -Lo /usr/local/bin/zetaclientd https://github.com/zeta-chain/ci-testing-node/releases/download/v17.0.1-internal/zetaclientd-linux-${BUILDARCH} && \
chmod 755 /usr/local/bin/zetaclientd
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,18 @@ start-stress-test: zetanode
### Upgrade Tests ###
###############################################################################


# build from source only if requested
ifndef UPGRADE_TEST_FROM_SOURCE
zetanode-upgrade: zetanode
@echo "Building zetanode-upgrade"
@echo "Building zetanode-upgrade from binaries"
$(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime --build-arg OLD_VERSION='release/v17' .
$(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile.fastbuild .
.PHONY: zetanode-upgrade
else
zetanode-upgrade: zetanode
@echo "Building zetanode-upgrade from source"
$(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime-source --build-arg OLD_VERSION='release/v17' .
.PHONY: zetanode-upgrade
endif

start-upgrade-test: zetanode-upgrade
@echo "--> Starting upgrade test"
Expand Down

0 comments on commit b471960

Please sign in to comment.