Skip to content

Commit 5b43786

Browse files
committed
feat: update attester Dockerfile and integration test workflow for improved image building and caching
1 parent f2048e0 commit 5b43786

3 files changed

Lines changed: 18 additions & 9 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ services:
7575

7676
# Attester service
7777
attester:
78-
build:
79-
context: ../..
80-
dockerfile: .github/integration-tests/docker/Dockerfile.attester
78+
image: attester:latest
8179
container_name: gm-attester
8280
volumes:
8381
- ../integration-tests/scripts:/home/attester/scripts:ro

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
FROM golang:1.24-alpine as builder
22

3-
# Install dependencies
3+
# Install system dependencies - this layer will be cached
44
RUN apk add --no-cache git make gcc musl-dev
55

66
# Set working directory
77
WORKDIR /workspace
88

9-
# Copy ev-abci (repo root) and the scaffolded gm chain
9+
# Copy ev-abci source code
1010
COPY . /workspace/ev-abci
11-
# Ensure attester sources are present (attester/main.go, etc.)
12-
COPY attester /workspace/ev-abci/attester
11+
1312
# Build the attester binary (it has its own go.mod)
1413
WORKDIR /workspace/ev-abci/attester
15-
## Align module replacements and fetch deps
16-
# attester lives at /workspace/ev-abci/attester, so the ev-abci root is one level up
14+
15+
# Align module replacements and fetch deps - cached if dependencies don't change
1716
RUN go mod edit -dropreplace github.com/evstack/ev-abci || true \
1817
&& go mod edit -replace github.com/evstack/ev-abci=.. \
1918
&& go mod edit -dropreplace github.com/evstack/ev-node || true \
2019
&& go mod tidy
20+
21+
# Build attester binary - rebuilds only if source code changes
2122
RUN go build -o /workspace/attester .
2223

2324
# Runtime stage

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ jobs:
5454
cache-from: type=gha,scope=gm-chain
5555
cache-to: type=gha,mode=max,scope=gm-chain
5656

57+
- name: Build and cache attester image
58+
uses: docker/build-push-action@v6
59+
with:
60+
context: .
61+
file: .github/integration-tests/docker/Dockerfile.attester
62+
tags: attester:latest
63+
load: true
64+
cache-from: type=gha,scope=attester
65+
cache-to: type=gha,mode=max,scope=attester
66+
5767
- name: Run integration tests (compose orchestrator)
5868
env:
5969
VERBOSE: "true"

0 commit comments

Comments
 (0)