Skip to content

Commit

Permalink
chore: update docker e2e (#415)
Browse files Browse the repository at this point in the history
* fix: docker release

* chore: move and rename e2e docker to contrib/images

* update e2e_setup_test

* ci: add concurrency option

* use ubuntu rolling release

* comments
  • Loading branch information
robert-zaremba authored Dec 20, 2022
1 parent 62de3e9 commit c8b024a
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 51 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build
on: [push, pull_request]

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

# This workflow makes amd64 and arm64 binaries for macOS and Linux.
jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
required: false
default: "false"

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
ssh-debug:
runs-on: ubuntu-latest
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- "v[0-9]+\\.[0-9]+\\.[0-9]+" # Official release version tags e.g. v2.0.5
- "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" # Release candidate tags e.g. v1.0.3-rc4

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
umeed-docker:
name: umee Docker
Expand All @@ -18,13 +22,13 @@ jobs:

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: umee-network/peggo

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand All @@ -42,4 +46,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

4 changes: 4 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- edited
- synchronize

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
lint-pr:
name: Run PR Title Linter
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- main

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
golangci:
name: Run golangci-lint
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10

concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ on:
- main
- release/**

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
concurrency:
group: ci-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
install-tparse:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -84,6 +80,7 @@ jobs:
if: env.GIT_DIFF
run: |
DOCKER_BUILDKIT=1 make docker-build-debug
- name: Test E2E
if: env.GIT_DIFF
run: |
Expand Down
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ solidity-wrappers: $(SOLIDITY_DIR)/contracts/*.sol
###############################################################################

docker-build:
@docker build -t umeenet/peggo --platform=linux/amd64 .
@docker build -t umeenet/peggo-e2e --platform=linux/amd64 -f contrib/images/e2e.dockerfile .

docker-build-debug:
@docker build -t umeenet/peggo --build-arg IMG_TAG=debug .
@docker build -t umeenet/peggo-e2e --build-arg IMG_TAG=debug -f contrib/images/e2e.dockerfile .

.PHONY: docker-build docker-build-debug
11 changes: 4 additions & 7 deletions contrib/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
## image for e2e tests
## image for docker Peggo release

# Fetch base packages
FROM golang:1.19-alpine AS builder
ENV PACKAGES make git libc-dev gcc linux-headers
RUN apk add --no-cache $PACKAGES
WORKDIR /src/app/
FROM golang:1.19-bullseye AS builder
WORKDIR /src/peggo/
COPY . .
RUN make install

FROM alpine:3.14
RUN apk add bash curl jq
FROM ubuntu:rolling
COPY --from=builder /go/bin/peggo /usr/local/bin/
CMD ["peggo"]
STOPSIGNAL SIGTERM
27 changes: 27 additions & 0 deletions contrib/images/e2e.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## image for e2e tests
## docker build -t peggo-e2e -f ./contrib/images/e2e.dockerfile .

# Fetch base packages
FROM golang:1.19-bullseye AS builder

# Compile the peggo binary
WORKDIR /src/peggo/
COPY . .
RUN go mod download
RUN make install

# download umeed
WORKDIR /src/umee
RUN wget https://github.com/umee-network/umee/releases/download/v3.3.0-rc3/umeed-v3.3.0-rc3-linux-amd64 && \
chmod +x umeed-v* && \
cp umeed-v* umeed && \
wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.x86_64.so

# Prepare final image
# FROM gcr.io/distroless/cc:debug
FROM ubuntu:rolling
ARG IMG_TAG=latest
COPY --from=builder /go/bin/peggo /usr/local/bin/
COPY --from=builder /src/umee/umeed /usr/local/bin/
COPY --from=builder /src/umee/libwasmvm.x86_64.so /lib/
EXPOSE 26656 26657 1317 9090
6 changes: 3 additions & 3 deletions test/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ func (s *IntegrationTestSuite) runValidators() {
Mounts: []string{
fmt.Sprintf("%s/:/root/.umee", val.configDir()),
},
Repository: "umeenet/peggo",
Repository: "umeenet/peggo-e2e",
Entrypoint: []string{
"umeed",
"start",
Expand Down Expand Up @@ -578,7 +578,7 @@ func (s *IntegrationTestSuite) runContractDeployment() {
&dockertest.RunOptions{
Name: "gravity-contract-deployer",
NetworkID: s.dkrNet.Network.ID,
Repository: "umeenet/peggo",
Repository: "umeenet/peggo-e2e",
// NOTE: container names are prefixed with '/'
Env: []string{"PEGGO_ETH_PK=" + ethMinerPK},
Entrypoint: []string{
Expand Down Expand Up @@ -671,7 +671,7 @@ func (s *IntegrationTestSuite) runOrchestrators() {
&dockertest.RunOptions{
Name: s.chain.orchestrators[i].instanceName(),
NetworkID: s.dkrNet.Network.ID,
Repository: "umeenet/peggo",
Repository: "umeenet/peggo-e2e",
Env: []string{
"PEGGO_ETH_PK=" + orch.ethereumKey.privateKey,
"PEGGO_COSMOS_PK=" + hexutil.Encode(s.chain.orchestrators[i].privateKey.Bytes()),
Expand Down

0 comments on commit c8b024a

Please sign in to comment.