Skip to content

Commit f2048e0

Browse files
committed
feat: optimize Dockerfile.gm and docker-compose for improved caching and integration testing
1 parent 2307219 commit f2048e0

3 files changed

Lines changed: 26 additions & 19 deletions

File tree

.github/integration-tests/docker-compose.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ services:
4545

4646
# GM chain (with rollkit)
4747
gm-chain:
48-
build:
49-
context: ../..
50-
dockerfile: .github/integration-tests/docker/Dockerfile.gm
51-
args:
52-
IGNITE_VERSION: ${IGNITE_VERSION:-v29.3.1}
53-
IGNITE_EVOLVE_APP_VERSION: ${IGNITE_EVOLVE_APP_VERSION:-main}
54-
EVNODE_VERSION: ${EVNODE_VERSION:-v1.0.0-beta.2.0.20250908090838-0584153217ed}
48+
image: gm-chain:latest
5549
container_name: gm-chain
5650
ports:
5751
- "26757:26757" # RPC

.github/integration-tests/docker/Dockerfile.gm

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,40 @@
33
##########
44
FROM golang:1.24-bookworm AS builder
55

6-
ARG IGNITE_VERSION=latest
7-
ARG IGNITE_EVOLVE_APP_VERSION=main
8-
ARG EVNODE_VERSION=v1.0.0-beta.2
9-
6+
# Install system dependencies - this layer will be cached
107
RUN apt-get update && apt-get install -y --no-install-recommends \
118
git curl bash ca-certificates make gcc musl-dev && \
129
rm -rf /var/lib/apt/lists/*
1310

14-
# Install Ignite CLI at requested version
11+
# Install Ignite CLI at requested version - cached if IGNITE_VERSION doesn't change
12+
ARG IGNITE_VERSION=latest
1513
RUN curl -sSL https://get.ignite.com/cli@${IGNITE_VERSION}! | bash
1614

1715
WORKDIR /workspace
1816

19-
# Copy ev-abci repo (root)
20-
COPY . /workspace/ev-abci
21-
22-
# Scaffold GM app and apply evolve plugin
17+
# Scaffold GM app - cached if IGNITE_EVOLVE_APP_VERSION doesn't change
18+
ARG IGNITE_EVOLVE_APP_VERSION=main
2319
RUN ignite scaffold chain gm --no-module --skip-git --address-prefix gm
2420
WORKDIR /workspace/gm
2521
RUN ignite app install github.com/ignite/apps/evolve@${IGNITE_EVOLVE_APP_VERSION}
2622
RUN ignite evolve add
2723

24+
# Copy ev-abci repo after scaffolding to avoid cache invalidation on code changes
25+
COPY . /workspace/ev-abci
26+
2827
# Inject App wiring for ev-abci network module before building
2928
COPY .github/integration-tests/patches/app-wiring/patch-app-wiring.sh /workspace/patch-app-wiring.sh
3029
RUN chmod +x /workspace/patch-app-wiring.sh && \
3130
echo "===== Running network module patch =====" && \
3231
bash /workspace/patch-app-wiring.sh
3332

34-
35-
# Align module versions like in CI
33+
# Align module versions like in CI - cached if EVNODE_VERSION doesn't change
34+
ARG EVNODE_VERSION=v1.0.0-beta.2
3635
RUN go mod edit -replace github.com/evstack/ev-node=github.com/evstack/ev-node@${EVNODE_VERSION} \
3736
&& go mod edit -replace github.com/evstack/ev-abci=../ev-abci \
3837
&& go mod tidy
3938

40-
# Build gmd binary
39+
# Build gmd binary - this will rebuild if source code changes
4140
ENV GOBIN=/workspace/bin
4241
RUN ignite chain build --skip-proto && \
4342
test -x "${GOBIN}/gmd"

.github/workflows/attester-mode-integration-test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ jobs:
4040
cache-from: type=gha,scope=local-da
4141
cache-to: type=gha,mode=max,scope=local-da
4242

43+
- name: Build and cache gm-chain image
44+
uses: docker/build-push-action@v6
45+
with:
46+
context: .
47+
file: .github/integration-tests/docker/Dockerfile.gm
48+
tags: gm-chain:latest
49+
load: true
50+
build-args: |
51+
IGNITE_VERSION=${{ env.IGNITE_VERSION }}
52+
IGNITE_EVOLVE_APP_VERSION=${{ env.IGNITE_EVOLVE_APP_VERSION }}
53+
EVNODE_VERSION=${{ env.EVNODE_VERSION }}
54+
cache-from: type=gha,scope=gm-chain
55+
cache-to: type=gha,mode=max,scope=gm-chain
56+
4357
- name: Run integration tests (compose orchestrator)
4458
env:
4559
VERBOSE: "true"

0 commit comments

Comments
 (0)