Skip to content

Commit 90e9705

Browse files
fix checkout in kurtosis ci (#12084)
made format change in interpreter so that `make docker` task runs (it doesn't run if the changes are only in .github/ dir)
1 parent e63e77c commit 90e9705

File tree

4 files changed

+188
-7
lines changed

4 files changed

+188
-7
lines changed

Diff for: .github/workflows/ci-cd-main-branch-docker-images.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ env:
1111
LABEL_DESCRIPTION: "[docker image built on a last commit id from the main branch] Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency frontier. Archive Node by default."
1212

1313
on:
14+
pull_request:
15+
branches:
16+
- main
17+
types:
18+
- opened
19+
- reopened
20+
- synchronize
21+
- ready_for_review
1422
push:
1523
branches:
1624
- 'main'
17-
paths-ignore:
18-
- '.github/**'
1925
workflow_dispatch:
2026

2127
jobs:
+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: 2CI-CD build and deploy docker images based on the last commit in the main branch
2+
run-name: "Commit id ${{ github.sha }}: CI-CD build and deploy docker images based on the commit id in the main branch"
3+
4+
env:
5+
APPLICATION: "erigon"
6+
BUILDER_IMAGE: "golang:1.23.1-alpine3.20"
7+
TARGET_BASE_IMAGE: "alpine:3.20.3"
8+
APP_REPO: "erigontech/erigon"
9+
CHECKOUT_REF: "main"
10+
DOCKERHUB_REPOSITORY: "erigontech/erigon"
11+
LABEL_DESCRIPTION: "[docker image built on a last commit id from the main branch] Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency frontier. Archive Node by default."
12+
13+
on:
14+
push:
15+
branches:
16+
- 'main'
17+
paths-ignore:
18+
- '.github/**'
19+
workflow_dispatch:
20+
21+
jobs:
22+
23+
Build:
24+
runs-on: ubuntu-22.04
25+
timeout-minutes: 45
26+
27+
steps:
28+
- name: Fast checkout git repository
29+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
30+
with:
31+
repository: ${{ env.APP_REPO }}
32+
fetch-depth: 1
33+
ref: ${{ env.CHECKOUT_REF }}
34+
path: 'erigon'
35+
36+
- name: Setup go env and cache
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version: '>=1.22'
40+
go-version-file: 'erigon/go.mod'
41+
cache-dependency-path: |
42+
erigon/go.sum
43+
44+
- name: Get commit id
45+
id: getCommitId
46+
run: |
47+
cd erigon
48+
echo "id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
49+
echo "short_commit_id=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
50+
cd ..
51+
52+
- name: Login to Docker Hub
53+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 ## v3.3.0
54+
with:
55+
username: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
56+
password: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
57+
58+
- name: Set up QEMU
59+
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf ## v3.2.0
60+
61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db ## v3.6.1
63+
64+
- name: Build arm64
65+
run: |
66+
docker run --platform linux/arm64 \
67+
--rm -v $(pwd)/erigon:/erigon:ro \
68+
-v $(pwd)/build-arm64:/erigon-build \
69+
-v ${HOME}/.cache/go-build/arm64:/root/.cache/go-build \
70+
-v ${HOME}/go/pkg/mod:/go/pkg/mod \
71+
-w /erigon --entrypoint /bin/sh \
72+
${{ env.BUILDER_IMAGE }} \
73+
-c "apk update; apk add make git gcc libstdc++ build-base linux-headers bash ca-certificates; git config --global --add safe.directory /erigon; make GOARCH=arm64 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm erigon integration rpcdaemon"
74+
75+
- name: Build amd64
76+
run: |
77+
docker run --platform linux/amd64 \
78+
--rm -v $(pwd)/erigon:/erigon:ro \
79+
-v $(pwd)/build-amd64:/erigon-build \
80+
-v ${HOME}/.cache/go-build/amd64:/root/.cache/go-build \
81+
-v ${HOME}/go/pkg/mod:/go/pkg/mod \
82+
-w /erigon --entrypoint /bin/sh \
83+
${{ env.BUILDER_IMAGE }} \
84+
-c "apk update; apk add make git gcc libstdc++ build-base linux-headers bash ca-certificates; git config --global --add safe.directory /erigon; make GOARCH=amd64 GOAMD64=v2 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm erigon integration rpcdaemon"
85+
86+
- name: Build and push multi-platform docker image based on the commit id ${{ steps.getCommitId.outputs.short_commit_id }} in the main branch
87+
env:
88+
BUILD_VERSION: "main-${{ steps.getCommitId.outputs.short_commit_id }}"
89+
DOCKER_URL: ${{ env.DOCKERHUB_REPOSITORY }}
90+
DOCKERFILE_PATH: Dockerfile.release
91+
run: |
92+
cp -vr build-amd64 erigon/
93+
cp -vr build-arm64 erigon/
94+
cd erigon
95+
docker buildx build \
96+
--file ${{ env.DOCKERFILE_PATH }} \
97+
--target ci-cd-main-branch \
98+
--attest type=provenance,mode=max \
99+
--sbom=true \
100+
--build-arg CI_CD_MAIN_TARGET_BASE_IMAGE=${{ env.TARGET_BASE_IMAGE }} \
101+
--build-arg CI_CD_MAIN_BUILDER_IMAGE=${{ env.BUILDER_IMAGE }} \
102+
--tag ${{ env.DOCKER_URL }}:${{ env.BUILD_VERSION }} \
103+
--tag ${{ env.DOCKER_URL }}:main-latest \
104+
--label org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
105+
--label org.opencontainers.image.authors="https://github.com/erigontech/erigon/graphs/contributors" \
106+
--label org.opencontainers.image.url="https://github.com/erigontech/erigon/blob/main/Dockerfile" \
107+
--label org.opencontainers.image.documentation="https://github.com/erigontech/erigon/blob/main/Dockerfile" \
108+
--label org.opencontainers.image.source="https://github.com/erigontech/erigon/blob/main/Dockerfile" \
109+
--label org.opencontainers.image.version=${{ steps.getCommitId.outputs.id }} \
110+
--label org.opencontainers.image.revision=${{ steps.getCommitId.outputs.id }} \
111+
--label org.opencontainers.image.vcs-ref-short=${{ steps.getCommitId.outputs.short_commit_id }} \
112+
--label org.opencontainers.image.vendor="${{ github.repository_owner }}" \
113+
--label org.opencontainers.image.description="${{ env.LABEL_DESCRIPTION }}" \
114+
--label org.opencontainers.image.base.name="${{ env.TARGET_BASE_IMAGE }}" \
115+
--push \
116+
--platform linux/amd64,linux/arm64 .
117+
118+
- name: Print docker images published
119+
run: |
120+
echo The following docker images have been published:
121+
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-${{ steps.getCommitId.outputs.short_commit_id }}"
122+
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-latest"
123+
124+
## upload commit id for use in test-kurtosis-assertoor.yml
125+
## reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#using-data-from-the-triggering-workflow
126+
- name: Save commit id
127+
run: |
128+
mkdir -p ./COMMIT_ID_DOCKER_BUILD
129+
echo "${{ steps.getCommitId.outputs.short_commit_id }}" >> ./COMMIT_ID_DOCKER_BUILD/commit
130+
131+
- uses: actions/upload-artifact@v4
132+
with:
133+
name: commit
134+
path: COMMIT_ID_DOCKER_BUILD
135+

Diff for: .github/workflows/test-kurtosis-assertoor.yml

+45-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ name: Kurtosis Assertoor GitHub Action
22

33
env:
44
DOCKERHUB_REPOSITORY: "erigontech/erigon"
5+
APP_REPO: "erigontech/erigon"
56

67
on:
78
workflow_run:
8-
workflows: ["CI-CD build and deploy docker images based on the last commit in the main branch"]
9+
workflows: ["2CI-CD build and deploy docker images based on the last commit in the main branch"]
910
types:
1011
- completed
1112
# schedule:
@@ -50,7 +51,49 @@ jobs:
5051
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
5152
run: exit 1
5253

53-
- uses: actions/checkout@v4
54+
- name: 'Download Artifact'
55+
uses: actions/github-script@v6
56+
with:
57+
script: |
58+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
run_id: context.payload.workflow_run.id,
62+
});
63+
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
64+
return artifact.name == "commit"
65+
})[0];
66+
let download = await github.rest.actions.downloadArtifact({
67+
owner: context.repo.owner,
68+
repo: context.repo.repo,
69+
artifact_id: matchArtifact.id,
70+
archive_format: 'zip',
71+
});
72+
let fs = require('fs');
73+
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/commit.zip`, Buffer.from(download.data));
74+
75+
- name: 'Extract commit id from triggering workflow artifact'
76+
id: extractCommitId
77+
run: |
78+
unzip commit.zip
79+
echo "commitId=$(cat commit)" >> "$GITHUB_OUTPUT
80+
81+
82+
- name: Fast checkout git repository
83+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
84+
with:
85+
repository: ${{ env.APP_REPO }}
86+
fetch-depth: 1
87+
ref: ${{ steps.extractCommitId.outputs.commitId }}
88+
path: 'erigon'
89+
90+
- name: Setup go env and cache
91+
uses: actions/setup-go@v5
92+
with:
93+
go-version: '>=1.22'
94+
go-version-file: 'erigon/go.mod'
95+
cache-dependency-path: |
96+
erigon/go.sum
5497
5598
- name: Get commit id
5699
id: getCommitId

Diff for: core/vm/interpreter.go

-3
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,6 @@ func (in *EVMInterpreter) Depth() int {
339339
return in.depth
340340
}
341341

342-
func (vm *VM) disableReadonly() { vm.readOnly = false }
343-
func (vm *VM) noop() {}
344-
345342
func (vm *VM) setReadonly(outerReadonly bool) func() {
346343
if outerReadonly && !vm.readOnly {
347344
vm.readOnly = true

0 commit comments

Comments
 (0)