From 820e5d2e06914037ca1c89236683a9c64cd227e9 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Thu, 7 Sep 2023 13:39:09 +0200 Subject: [PATCH] rm old dockerfiles from e2e; update .gitignore --- .gitignore | 4 +++ Dockerfile | 4 +-- Dockerfile.gaia | 4 +-- e2e/Dockerfile | 58 ------------------------------- e2e/Dockerfile.gaia | 83 --------------------------------------------- e2e/main.go | 2 +- 6 files changed, 9 insertions(+), 146 deletions(-) delete mode 100644 e2e/Dockerfile delete mode 100644 e2e/Dockerfile.gaia diff --git a/.gitignore b/.gitignore index a0a3488545..6ad26fb68e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ docs/tla/states/ vendor/ .vscode .idea + +# Go workspace files should not be pushed. +go.work +go.work.sum diff --git a/Dockerfile b/Dockerfile index dee88dae7c..f858fba0a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain COPY --from=is-builder /go/bin/interchain-security-sd /usr/local/bin/interchain-security-sd # Copy in the shell scripts that run the testnet -ADD ./tests/e2e/testnet-scripts /testnet-scripts +ADD ./e2e/testnet-scripts /testnet-scripts # Copy in the hermes config -ADD ./tests/e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml +ADD ./e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml diff --git a/Dockerfile.gaia b/Dockerfile.gaia index b9f6ff007f..0c4527b377 100644 --- a/Dockerfile.gaia +++ b/Dockerfile.gaia @@ -77,7 +77,7 @@ COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain COPY --from=is-builder /go/bin/interchain-security-sd /usr/local/bin/interchain-security-sd # Copy in the shell scripts that run the testnet -ADD ./tests/e2e/testnet-scripts /testnet-scripts +ADD ./e2e/testnet-scripts /testnet-scripts # Copy in the hermes config -ADD ./tests/e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml +ADD ./e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml diff --git a/e2e/Dockerfile b/e2e/Dockerfile deleted file mode 100644 index dee88dae7c..0000000000 --- a/e2e/Dockerfile +++ /dev/null @@ -1,58 +0,0 @@ -# syntax=docker/dockerfile:1 - - -FROM golang:1.20-alpine AS is-builder - -ENV PACKAGES curl make git libc-dev bash gcc linux-headers -RUN apk add --no-cache $PACKAGES - -ENV CGO_ENABLED=0 -ENV GOOS=linux -ENV GOFLAGS="-buildvcs=false" - -# cache go modules - done before the files are copied to allow docker to better cache -COPY go.mod /go.mod -COPY go.sum /go.sum -RUN go mod download - - -# Copy in the repo under test -ADD . /interchain-security - -WORKDIR /interchain-security - -# Do not specify version here. It leads to odd replacement behavior -RUN if [ -d "./cosmos-sdk" ]; then go mod edit -replace github.com/cosmos/cosmos-sdk=./cosmos-sdk; fi -RUN go mod tidy - -# Install interchain security binary -RUN make install - -# Get Hermes build -FROM ghcr.io/informalsystems/hermes:1.4.1 AS hermes-builder - -# Get CometMock -FROM informalofftermatt/cometmock:latest as cometmock-builder - -# Get GoRelayer -FROM informalofftermatt/gorelayer:nogas AS gorelayer-builder - -FROM --platform=linux/amd64 fedora:36 -RUN dnf update -y -RUN dnf install -y which iproute iputils procps-ng vim-minimal tmux net-tools htop jq -USER root - -COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ -COPY --from=cometmock-builder /usr/local/bin/cometmock /usr/local/bin/cometmock -COPY --from=gorelayer-builder /bin/rly /usr/local/bin/ - -COPY --from=is-builder /go/bin/interchain-security-pd /usr/local/bin/interchain-security-pd -COPY --from=is-builder /go/bin/interchain-security-cd /usr/local/bin/interchain-security-cd -COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain-security-cdd -COPY --from=is-builder /go/bin/interchain-security-sd /usr/local/bin/interchain-security-sd - -# Copy in the shell scripts that run the testnet -ADD ./tests/e2e/testnet-scripts /testnet-scripts - -# Copy in the hermes config -ADD ./tests/e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml diff --git a/e2e/Dockerfile.gaia b/e2e/Dockerfile.gaia deleted file mode 100644 index b9f6ff007f..0000000000 --- a/e2e/Dockerfile.gaia +++ /dev/null @@ -1,83 +0,0 @@ -# syntax=docker/dockerfile:1 - -# build latest tagged gaia -FROM golang:1.20-alpine AS gaia-builder -# WORKDIR is set to /go by default -ARG USE_GAIA_TAG -ENV GAIA_TAG=${USE_GAIA_TAG} - -ENV PACKAGES curl make git libc-dev bash gcc linux-headers -RUN apk add --no-cache $PACKAGES - -ENV CGO_ENABLED=0 -ENV GOOS=linux -ENV GOFLAGS="-buildvcs=false" - -# cache go modules - done before the files are copied to allow docker to better cache -COPY go.mod /go.mod -COPY go.sum /go.sum -RUN go mod download - -# Copy host machine's working directory into the container under /interchain-security -ADD . /interchain-security - -RUN git clone https://github.com/cosmos/gaia.git -WORKDIR /go/gaia - -# fetch gaia from tag and build it -RUN if [ -n "${GAIA_TAG}" ]; \ - then git checkout "${GAIA_TAG}"; \ - # if GAIA_TAG is not set, build the latest tagged version - else \ - git checkout $(git tag | tail -1); \ - fi - -# Also replace sdk version in the go.mod if specified -RUN if [ -d "/interchain-security/cosmos-sdk" ]; then \ - go mod edit -replace github.com/cosmos/cosmos-sdk=/interchain-security/cosmos-sdk && \ - echo "local sdk version used in gaia build"; \ - fi - -RUN go mod tidy -# Print the version of the sdk used in the build -RUN go list -m github.com/cosmos/cosmos-sdk -RUN make build - -FROM golang:1.20-alpine AS is-builder - -ENV PACKAGES curl make git libc-dev bash gcc linux-headers -RUN apk add --no-cache $PACKAGES - -ENV CGO_ENABLED=0 -ENV GOOS=linux -ENV GOFLAGS="-buildvcs=false" - -# Copy in the repo under test -ADD . /interchain-security - -WORKDIR /interchain-security - -# Install interchain security binary -RUN make install - -# Get Hermes build -FROM ghcr.io/informalsystems/hermes:1.4.1 AS hermes-builder - -FROM --platform=linux/amd64 fedora:36 -RUN dnf update -y -RUN dnf install -y which iproute iputils procps-ng vim-minimal tmux net-tools htop jq -USER root - -COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ - -# swap interchain-security-pd binary with gaia binary but keep the name -COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/interchain-security-pd -COPY --from=is-builder /go/bin/interchain-security-cd /usr/local/bin/interchain-security-cd -COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain-security-cdd -COPY --from=is-builder /go/bin/interchain-security-sd /usr/local/bin/interchain-security-sd - -# Copy in the shell scripts that run the testnet -ADD ./tests/e2e/testnet-scripts /testnet-scripts - -# Copy in the hermes config -ADD ./tests/e2e/testnet-scripts/hermes-config.toml /root/.hermes/config.toml diff --git a/e2e/main.go b/e2e/main.go index 9943d6f9bd..4a2c7064a8 100644 --- a/e2e/main.go +++ b/e2e/main.go @@ -229,7 +229,7 @@ func (tr *TestRun) startDocker() { } } scriptStr := fmt.Sprintf( - "tests/e2e/testnet-scripts/start-docker.sh %s %s %s %s %s", + "e2e/testnet-scripts/start-docker.sh %s %s %s %s %s", tr.containerConfig.containerName, tr.containerConfig.instanceName, localSdk,