Skip to content

Commit

Permalink
CI Performance (0xPolygonHermez#1506)
Browse files Browse the repository at this point in the history
* perf(ci): kurtosis runs parallel

* perf(ci): Dockerfile lite, docker login

* fix(test): remove dupe flag on unwind tests

---------

Co-authored-by: Valentin Staykov <[email protected]>
  • Loading branch information
revitteth and V-Staykov authored Dec 3, 2024
1 parent b22fa1d commit 9a5adcb
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci_zkevm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches:
- zkevm
- zkevm-2.60
- stable*
types:
- opened
- reopened
Expand All @@ -19,9 +20,15 @@ concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

jobs:
tests:
strategy:
max-parallel: 2
fail-fast: true
matrix:
os: [ ubuntu-22.04, macos-14-xlarge ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
Expand All @@ -37,7 +44,7 @@ jobs:
run: sudo apt update && sudo apt install build-essential

- name: Build
run: make BUILD_TAGS=nosqlite,noboltdb,nosilkworm all
run: make BUILD_TAGS=nosqlite,noboltdb,nosilkworm cdk-erigon

- name: Reproducible build test
run: |
Expand Down Expand Up @@ -76,6 +83,7 @@ jobs:
- name: Setup kurtosis
uses: ./.github/actions/setup-kurtosis


- name: Run process with CPU monitoring
working-directory: ./cdk-erigon
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-resequence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
- synchronize
- ready_for_review

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

jobs:
resequence-test:
runs-on: ubuntu-latest
Expand Down
71 changes: 71 additions & 0 deletions Dockerfile.lite
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# syntax = docker/dockerfile:1.2
FROM docker.io/library/golang:1.21-alpine3.17 AS builder

RUN apk --no-cache add build-base linux-headers git bash ca-certificates libstdc++

WORKDIR /app
ADD go.mod go.mod
ADD go.sum go.sum
ADD erigon-lib/go.mod erigon-lib/go.mod
ADD erigon-lib/go.sum erigon-lib/go.sum

RUN go mod download
ADD . .

RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/tmp/go-build \
--mount=type=cache,target=/go/pkg/mod \
make BUILD_TAGS=nosqlite,noboltdb,nosilkworm cdk-erigon

FROM docker.io/library/alpine:3.17

# install required runtime libs, along with some helpers for debugging
RUN apk add --no-cache ca-certificates libstdc++ tzdata
RUN apk add --no-cache curl jq bind-tools

# Setup user and group
#
# from the perspective of the container, uid=1000, gid=1000 is a sensible choice
# (mimicking Ubuntu Server), but if caller creates a .env (example in repo root),
# these defaults will get overridden when make calls docker-compose
ARG UID=1000
ARG GID=1000
RUN adduser -D -u $UID -g $GID erigon
USER erigon
RUN mkdir -p ~/.local/share/erigon
WORKDIR /home/erigon

## add pre-defined run configs
ADD hermezconfig-mainnet.yaml.example mainnet.yaml
ADD hermezconfig-cardona.yaml.example cardona.yaml
ADD hermezconfig-bali.yaml.example bali.yaml

## then give each binary its own layer
COPY --from=builder /app/build/bin/cdk-erigon /usr/local/bin/cdk-erigon

EXPOSE 8545 \
8551 \
8546 \
30303 \
30303/udp \
42069 \
42069/udp \
8080 \
9090 \
6060

# https://github.com/opencontainers/image-spec/blob/main/annotations.md
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.description="Erigon ZKEVM Client" \
org.label-schema.name="ZKEVM Erigon" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://torquem.ch" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/0xPolygonHermez/cdk-erigon.git" \
org.label-schema.vendor="Torquem" \
org.label-schema.version=$VERSION

ENTRYPOINT ["cdk-erigon"]
1 change: 0 additions & 1 deletion zk/tests/unwinds/unwind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ echo -e '\nRun Erigon to BlockHeight: ' "${firstStop}" '\n'
./build/bin/cdk-erigon \
--datadir="$dataPath/rpc-datadir" \
--config="zk/tests/unwinds/config/dynamic-integration8.yaml" \
--debug.limit=1 \
--debug.limit="${firstStop}"

echo -e '\nDumping data \n'
Expand Down

0 comments on commit 9a5adcb

Please sign in to comment.