Skip to content

Commit 3487b8c

Browse files
committed
fixup: Update to use refactored antithesis tooling from avalanchego
1 parent 0ed5db9 commit 3487b8c

File tree

10 files changed

+142
-217
lines changed

10 files changed

+142
-217
lines changed

.github/workflows/publish_antithesis_images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
run: bash -x ./scripts/build_antithesis_images.sh
3030
env:
3131
IMAGE_PREFIX: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
32-
TAG: latest
32+
IMAGE_TAG: latest
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Trigger Antithesis
2+
3+
on:
4+
# TODO(marun) Add a schedule
5+
workflow_dispatch:
6+
inputs:
7+
duration:
8+
description: 'The duration (in hours) to run the test for'
9+
default: '0.5'
10+
required: true
11+
type: string
12+
recipients:
13+
description: 'Comma-seperated email addresses to send the test report to'
14+
required: true
15+
type: string
16+
image_tag:
17+
description: 'The image tag to target'
18+
default: latest
19+
required: true
20+
type: string
21+
22+
jobs:
23+
antithesis:
24+
name: Run Antithesis
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: antithesishq/[email protected]
28+
with:
29+
notebook_name: avalanche
30+
tenant: avalanche
31+
username: ${{ secrets.ANTITHESIS_USERNAME }}
32+
password: ${{ secrets.ANTITHESIS_PASSWORD }}
33+
github_token: ${{ secrets.ANTITHESIS_GH_PAT }}
34+
config_image: antithesis-subnet-evm-config:${{ github.event.inputs.image_tag || 'latest' }}
35+
images: antithesis-subnet-evm-workload:${{ github.event.inputs.image_tag || 'latest' }};antithesis-subnet-evm-node:${{ github.event.inputs.image_tag || 'latest' }}
36+
email_recipients: ${{ github.event.inputs.recipients || secrets.ANTITHESIS_RECIPIENTS }}
37+
additional_parameters: |-
38+
custom.duration=${{ github.event.inputs.duration || '11.25' }} # Duration is in hours
39+
custom.workload=subnet-evm

go.mod

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.21.12
44

55
require (
66
github.com/VictoriaMetrics/fastcache v1.12.1
7-
github.com/ava-labs/avalanchego v1.11.9
7+
github.com/ava-labs/avalanchego v1.11.10-0.20240719074835-d5b88594091c
88
github.com/cespare/cp v0.1.0
99
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
1010
github.com/davecgh/go-spew v1.1.1
@@ -66,12 +66,16 @@ require (
6666
github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 // indirect
6767
github.com/cockroachdb/redact v1.1.3 // indirect
6868
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
69+
github.com/compose-spec/compose-go v1.20.2 // indirect
6970
github.com/consensys/bavard v0.1.13 // indirect
7071
github.com/consensys/gnark-crypto v0.12.1 // indirect
7172
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
7273
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
7374
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
75+
github.com/distribution/reference v0.5.0 // indirect
7476
github.com/dlclark/regexp2 v1.7.0 // indirect
77+
github.com/docker/go-connections v0.4.0 // indirect
78+
github.com/docker/go-units v0.5.0 // indirect
7579
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
7680
github.com/getsentry/sentry-go v0.18.0 // indirect
7781
github.com/go-logr/logr v1.4.1 // indirect
@@ -97,12 +101,14 @@ require (
97101
github.com/kr/text v0.2.0 // indirect
98102
github.com/magiconair/properties v1.8.6 // indirect
99103
github.com/mattn/go-runewidth v0.0.13 // indirect
104+
github.com/mattn/go-shellwords v1.0.12 // indirect
100105
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
101106
github.com/mitchellh/mapstructure v1.5.0 // indirect
102107
github.com/mitchellh/pointerstructure v1.2.0 // indirect
103108
github.com/mmcloughlin/addchain v0.4.0 // indirect
104109
github.com/mr-tron/base58 v1.2.0 // indirect
105110
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect
111+
github.com/opencontainers/go-digest v1.0.0 // indirect
106112
github.com/pelletier/go-toml v1.9.5 // indirect
107113
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
108114
github.com/pires/go-proxyproto v0.6.2 // indirect
@@ -114,6 +120,7 @@ require (
114120
github.com/rogpeppe/go-internal v1.10.0 // indirect
115121
github.com/rs/cors v1.7.0 // indirect
116122
github.com/russross/blackfriday/v2 v2.1.0 // indirect
123+
github.com/sirupsen/logrus v1.9.0 // indirect
117124
github.com/spf13/afero v1.8.2 // indirect
118125
github.com/spf13/jwalterweatherman v1.1.0 // indirect
119126
github.com/subosito/gotenv v1.3.0 // indirect

go.sum

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY
5656
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
5757
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
5858
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
59-
github.com/ava-labs/avalanchego v1.11.9 h1:hPmnPADhyl/cOp6WNJKfJNW8zA644RioIMcAXSXG3TA=
60-
github.com/ava-labs/avalanchego v1.11.9/go.mod h1:1dpLzXIVhAmJeRpl59l5GgcCEO9bDdF6Y6qRDTo0QGY=
59+
github.com/ava-labs/avalanchego v1.11.10-0.20240719065532-fbe826a65799 h1:mqZwiq7L2WhYnpmfS+V2/IJYipNNyWLWlB8MPqXgvok=
60+
github.com/ava-labs/avalanchego v1.11.10-0.20240719065532-fbe826a65799/go.mod h1:1dpLzXIVhAmJeRpl59l5GgcCEO9bDdF6Y6qRDTo0QGY=
61+
github.com/ava-labs/avalanchego v1.11.10-0.20240719074835-d5b88594091c h1:gCBLEZ6/uTDk8U3SgUpeJUSi5AC5O3Bg7RZ0QCZwdTg=
62+
github.com/ava-labs/avalanchego v1.11.10-0.20240719074835-d5b88594091c/go.mod h1:1dpLzXIVhAmJeRpl59l5GgcCEO9bDdF6Y6qRDTo0QGY=
6163
github.com/ava-labs/coreth v0.13.6-rc.1 h1:gRXRokmu0WOlPqyx+mTLWB655e8/w++u6qFcq9Mo7qA=
6264
github.com/ava-labs/coreth v0.13.6-rc.1/go.mod h1:vm9T8qzP7RLo/jR2MKkliPfaiGgWeEpu/PG6fvvPmog=
6365
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
@@ -121,6 +123,8 @@ github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ
121123
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
122124
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
123125
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
126+
github.com/compose-spec/compose-go v1.20.2 h1:u/yfZHn4EaHGdidrZycWpxXgFffjYULlTbRfJ51ykjQ=
127+
github.com/compose-spec/compose-go v1.20.2/go.mod h1:+MdqXV4RA7wdFsahh/Kb8U0pAJqkg7mr4PM9tFKU8RM=
124128
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
125129
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
126130
github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=
@@ -150,9 +154,15 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2U
150154
github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
151155
github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4=
152156
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
157+
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
158+
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
153159
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
154160
github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
155161
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
162+
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
163+
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
164+
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
165+
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
156166
github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
157167
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127 h1:qwcF+vdFrvPSEUDSX5RVoRccG8a5DhOdWdQ4zN62zzo=
158168
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
@@ -410,6 +420,8 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
410420
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
411421
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
412422
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
423+
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
424+
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
413425
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
414426
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
415427
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
@@ -462,6 +474,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
462474
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
463475
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
464476
github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
477+
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
478+
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
465479
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
466480
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
467481
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
@@ -508,6 +522,8 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm
508522
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
509523
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
510524
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
525+
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
526+
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
511527
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
512528
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
513529
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
@@ -797,6 +813,7 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc
797813
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
798814
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
799815
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
816+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
800817
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
801818
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
802819
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1023,6 +1040,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
10231040
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
10241041
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
10251042
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1043+
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
1044+
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
10261045
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
10271046
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
10281047
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

scripts/build_antithesis_images.sh

Lines changed: 36 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,87 +5,15 @@ set -euo pipefail
55
# Builds docker images for antithesis testing.
66

77
# e.g.,
8-
# ./scripts/build_antithesis_images.sh # Build local images
9-
# IMAGE_PREFIX=<registry>/<repo> TAG=latest ./scripts/build_antithesis_images.sh # Specify a prefix to enable image push and use a specific tag
8+
# ./scripts/build_antithesis_images.sh # Build local images
9+
# IMAGE_PREFIX=<registry>/<repo> IMAGE_TAG=latest ./scripts/build_antithesis_images.sh # Specify a prefix to enable image push and use a specific tag
1010

1111
# Directory above this script
1212
SUBNET_EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
1313

1414
# Allow configuring the clone path to point to a shared and/or existing clone of the avalanchego repo
1515
AVALANCHEGO_CLONE_PATH="${AVALANCHEGO_CLONE_PATH:-${SUBNET_EVM_PATH}/avalanchego}"
1616

17-
# Specifying an image prefix will ensure the image is pushed after build
18-
IMAGE_PREFIX="${IMAGE_PREFIX:-}"
19-
20-
TAG="${TAG:-}"
21-
if [[ -z "${TAG}" ]]; then
22-
# Default to tagging with the commit hash
23-
source "${SUBNET_EVM_PATH}"/scripts/constants.sh
24-
TAG="${SUBNET_EVM_COMMIT::8}"
25-
fi
26-
27-
# The dockerfiles don't specify the golang version to minimize the changes required to bump
28-
# the version. Instead, the golang version is provided as an argument.
29-
GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
30-
31-
function build_images {
32-
local base_image_name=$1
33-
local uninstrumented_node_dockerfile=$2
34-
local avalanche_node_image=$3
35-
36-
# Define image names
37-
if [[ -n "${IMAGE_PREFIX}" ]]; then
38-
base_image_name="${IMAGE_PREFIX}/${base_image_name}"
39-
fi
40-
local node_image_name="${base_image_name}-node:${TAG}"
41-
local workload_image_name="${base_image_name}-workload:${TAG}"
42-
local config_image_name="${base_image_name}-config:${TAG}"
43-
44-
# Define dockerfiles
45-
local base_dockerfile="${SUBNET_EVM_PATH}/tests/antithesis/Dockerfile"
46-
local node_dockerfile="${base_dockerfile}.node"
47-
if [[ "$(go env GOARCH)" == "arm64" ]]; then
48-
# Antithesis instrumentation is only supported on amd64. On apple silicon (arm64), the
49-
# uninstrumented Dockerfile will be used to build the node image to enable local test
50-
# development.
51-
node_dockerfile="${uninstrumented_node_dockerfile}"
52-
fi
53-
54-
# Define default build command
55-
local docker_cmd="docker buildx build --build-arg GO_VERSION=${GO_VERSION} --build-arg NODE_IMAGE=${node_image_name}"
56-
if [[ -n "${IMAGE_PREFIX}" ]]; then
57-
# Push images with an image prefix since the prefix defines a registry location
58-
docker_cmd="${docker_cmd} --push"
59-
fi
60-
61-
# Build node image first to allow the workload image to be based on it.
62-
${docker_cmd} --build-arg AVALANCHEGO_NODE_IMAGE="${avalanche_node_image}" -t "${node_image_name}" \
63-
-f "${node_dockerfile}" "${SUBNET_EVM_PATH}"
64-
TARGET_PATH="${SUBNET_EVM_PATH}/build/antithesis"
65-
if [[ -d "${TARGET_PATH}" ]]; then
66-
# Ensure the target path is empty before generating the compose config
67-
rm -r "${TARGET_PATH}"
68-
fi
69-
70-
# Ensure avalanchego and subnet-evm binaries are available to create an initial db state that includes subnets.
71-
"${AVALANCHEGO_CLONE_PATH}"/scripts/build.sh
72-
PLUGIN_PATH="${TARGET_PATH}"/plugins
73-
"${SUBNET_EVM_PATH}"/scripts/build.sh "${PLUGIN_PATH}"/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
74-
75-
# Generate compose config and db state for the config image
76-
TARGET_PATH="${TARGET_PATH}"\
77-
IMAGE_TAG="${TAG}"\
78-
AVALANCHEGO_PATH="${AVALANCHEGO_CLONE_PATH}/build/avalanchego"\
79-
AVALANCHEGO_PLUGIN_DIR="${PLUGIN_PATH}"\
80-
go run "${SUBNET_EVM_PATH}/tests/antithesis/gencomposeconfig"
81-
82-
# Build config image
83-
${docker_cmd} -t "${config_image_name}" -f "${base_dockerfile}.config" "${SUBNET_EVM_PATH}"
84-
85-
# Build workload image
86-
${docker_cmd} -t "${workload_image_name}" -f "${base_dockerfile}.workload" "${SUBNET_EVM_PATH}"
87-
}
88-
8917
# Assume it's necessary to build the avalanchego node image from source
9018
# TODO(marun) Support use of a released node image if using a release version of avalanchego
9119

@@ -108,4 +36,37 @@ cd "${SUBNET_EVM_PATH}"
10836
# Build avalanchego node image. Supply an empty tag so the tag can be discovered from the hash of the avalanchego repo.
10937
NODE_ONLY=1 TEST_SETUP=avalanchego TAG='' bash -x "${AVALANCHEGO_CLONE_PATH}"/scripts/build_antithesis_images.sh
11038

111-
build_images antithesis-subnet-evm "${SUBNET_EVM_PATH}/Dockerfile" "antithesis-avalanchego-node:${AVALANCHE_VERSION::8}"
39+
# Specifying an image prefix will ensure the image is pushed after build
40+
IMAGE_PREFIX="${IMAGE_PREFIX:-}"
41+
42+
IMAGE_TAG="${IMAGE_TAG:-}"
43+
if [[ -z "${IMAGE_TAG}" ]]; then
44+
# Default to tagging with the commit hash
45+
source "${SUBNET_EVM_PATH}"/scripts/constants.sh
46+
IMAGE_TAG="${SUBNET_EVM_COMMIT::8}"
47+
fi
48+
49+
# The dockerfiles don't specify the golang version to minimize the changes required to bump
50+
# the version. Instead, the golang version is provided as an argument.
51+
GO_VERSION="$(go list -m -f '{{.GoVersion}}')"
52+
53+
# Import common functions used to build images for antithesis test setups
54+
# shellcheck source=/dev/null
55+
source "${AVALANCHEGO_CLONE_PATH}"/scripts/lib_build_antithesis_images.sh
56+
57+
build_antithesis_builder_image "${GO_VERSION}" "antithesis-subnet-evm-builder:${IMAGE_TAG}" "${AVALANCHEGO_CLONE_PATH}" "${SUBNET_EVM_PATH}"
58+
59+
# Ensure avalanchego and subnet-evm binaries are available to create an initial db state that includes subnets.
60+
"${AVALANCHEGO_CLONE_PATH}"/scripts/build.sh
61+
PLUGIN_PATH="${SUBNET_EVM_PATH}/build/plugins"
62+
mkdir -p "${PLUGIN_PATH}"
63+
"${SUBNET_EVM_PATH}"/scripts/build.sh "${PLUGIN_PATH}/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy"
64+
65+
echo "Generating compose configuration"
66+
gen_antithesis_compose_config "${IMAGE_TAG}" "${SUBNET_EVM_PATH}" "./tests/antithesis/gencomposeconfig" \
67+
"${SUBNET_EVM_PATH}/build/antithesis" \
68+
"AVALANCHEGO_PATH=${AVALANCHEGO_CLONE_PATH}/build/avalanchego AVALANCHEGO_PLUGIN_DIR=${PLUGIN_PATH}"
69+
70+
build_antithesis_images "${GO_VERSION}" "${IMAGE_PREFIX}" "antithesis-subnet-evm" "${IMAGE_TAG}" \
71+
"${AVALANCHE_VERSION::8}" "${SUBNET_EVM_PATH}/tests/antithesis/Dockerfile" \
72+
"${SUBNET_EVM_PATH}/Dockerfile" "${SUBNET_EVM_PATH}"

0 commit comments

Comments
 (0)