From 5facf158b294a8b78cddcd9520bd1864417c50f3 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 11 Sep 2024 20:37:49 +0000 Subject: [PATCH 1/6] document goreleaser local build usage --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a2fbe8e8..d87d89b5 100644 --- a/README.md +++ b/README.md @@ -40,4 +40,17 @@ Running the tests locally doesn't require publishing the `subnet-evm` commit sin > Locally running E2E tests using local checkout of `subnet-evm` will install `avalanchego` version specified by the `AVALANCHEGO_VERSION` in that working tree's `./scripts/versions.sh`. > [!TIP] -> Using the local checkout it's possible to run tests against a `tmpnet` consisting of nodes using a different version of `avalanchego` than the application being tested which might be helpful when troubleshooting. \ No newline at end of file +> Using the local checkout it's possible to run tests against a `tmpnet` consisting of nodes using a different version of `avalanchego` than the application being tested which might be helpful when troubleshooting. + +## Releases +GoReleaser is used to build the binaries of the services and also Docker images with those binaries. The monorepo feature of GoReleaser Pro is used to automate the release flow in response to tags like `signature-aggregator/v0.0.0`. The release actions in .github/workflows automate this, but the release build can also be run locally. Be sure to install the "pro" distribution of the command line utility, so that it can parse the `monorepo` key. For example: + +```bash +$ goreleaser release --single-target --clean --snapshot --config signature-aggregator/.goreleaser.yml +... + • creating archive=dist/linux_amd64/signature-aggregator_0.1.0-rc0-SNAPSHOT-3c2ae78_linux_amd64.tar.gz + • docker images + • building docker image image=avaplatform/signature-aggregator:v0.1.0-rc0-amd64 +... +$ docker run avaplatform/signature-aggregator:v0.1.0-rc0-amd64 +``` From 93fdbebe206e3fc39222b6412cd69ded1bd5d741 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 11 Sep 2024 21:31:33 +0000 Subject: [PATCH 2/6] install CA certificates in docker images before this, running the binaries (with a valid config file) in the images was resulting in: ``` panic: failed to issue request: Post "https://api.avax-test.network/ext/info": tls: failed to verify certificate: x509: certificate signed by unknown authority goroutine 1 [running]: main.main() /home/gene/dev/awm-relayer/signature-aggregator/main/main.go:95 +0xd5b ``` --- relayer/Dockerfile | 1 + signature-aggregator/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/relayer/Dockerfile b/relayer/Dockerfile index 87461e5f..8b001da4 100644 --- a/relayer/Dockerfile +++ b/relayer/Dockerfile @@ -1,4 +1,5 @@ FROM debian:11-slim +RUN apt update && apt --yes install ca-certificates COPY awm-relayer /usr/bin/awm-relayer EXPOSE 8080 USER 1001 diff --git a/signature-aggregator/Dockerfile b/signature-aggregator/Dockerfile index 891fdebb..b2112c83 100644 --- a/signature-aggregator/Dockerfile +++ b/signature-aggregator/Dockerfile @@ -1,5 +1,6 @@ FROM debian:11-slim COPY signature-aggregator /usr/bin/signature-aggregator +RUN apt update && apt --yes install ca-certificates EXPOSE 8080 EXPOSE 8081 CMD ["start"] From dd04b06b1d442d38006a8ab5f20ba5e0944290a6 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 11 Sep 2024 22:27:13 +0000 Subject: [PATCH 3/6] document easily passing in cfg to docker run --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d87d89b5..4bf5deff 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,14 @@ $ goreleaser release --single-target --clean --snapshot --config signature-aggre • creating archive=dist/linux_amd64/signature-aggregator_0.1.0-rc0-SNAPSHOT-3c2ae78_linux_amd64.tar.gz • docker images • building docker image image=avaplatform/signature-aggregator:v0.1.0-rc0-amd64 -... -$ docker run avaplatform/signature-aggregator:v0.1.0-rc0-amd64 +``` + +Then: + +```bash +$ docker run -v $(pwd)/signature-aggregator/sample-signature-aggregator-config.json:/config.json avaplatform/signature-aggregator:v0.1.0-rc0-amd64 --config-file /config.json +{"level":"info","timestamp":"2024-09-11T22:25:03.001Z","logger":"signature-aggregator","caller":"main/main.go:76","msg":"Initializing signature-aggregator"} +{"level":"info","timestamp":"2024-09-11T22:25:03.001Z","logger":"signature-aggregator","caller":"main/main.go:79","msg":"Initializing app request network"} +{"level":"debug","timestamp":"2024-09-11T22:25:03.086Z","logger":"p2p-network","caller":"dialer/dialer.go:52","msg":"creating dialer","throttleRPS":50,"dialTimeout":30000000000} +{"level":"info","timestamp":"2024-09-11T22:25:03.086Z","logger":"signature-aggregator","caller":"main/main.go:134","msg":"Initialization complete"} ``` From fec35a10579e4c2af25a4daba4670cd23fe66c90 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 11 Sep 2024 22:49:12 +0000 Subject: [PATCH 4/6] Dockerfiles: debian 12, not 11 --- relayer/Dockerfile | 2 +- signature-aggregator/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/relayer/Dockerfile b/relayer/Dockerfile index 8b001da4..fdaf71b2 100644 --- a/relayer/Dockerfile +++ b/relayer/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:11-slim +FROM debian:12-slim RUN apt update && apt --yes install ca-certificates COPY awm-relayer /usr/bin/awm-relayer EXPOSE 8080 diff --git a/signature-aggregator/Dockerfile b/signature-aggregator/Dockerfile index b2112c83..1d39ac66 100644 --- a/signature-aggregator/Dockerfile +++ b/signature-aggregator/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:11-slim +FROM debian:12-slim COPY signature-aggregator /usr/bin/signature-aggregator RUN apt update && apt --yes install ca-certificates EXPOSE 8080 From 17879e99fa29624956cfc9c133db2c13bb7f0661 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 11 Sep 2024 22:53:22 +0000 Subject: [PATCH 5/6] README: example for relayer release build & run --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 4bf5deff..7339c7dd 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,11 @@ $ docker run -v $(pwd)/signature-aggregator/sample-signature-aggregator-config.j {"level":"debug","timestamp":"2024-09-11T22:25:03.086Z","logger":"p2p-network","caller":"dialer/dialer.go:52","msg":"creating dialer","throttleRPS":50,"dialTimeout":30000000000} {"level":"info","timestamp":"2024-09-11T22:25:03.086Z","logger":"signature-aggregator","caller":"main/main.go:134","msg":"Initialization complete"} ``` + +Or, for the relayer: + +```bash +$ goreleaser release --single-target --clean --snapshot --config signature-aggregator/.goreleaser.yml +... +$ docker run -v $(pwd)/signature-aggregator/sample-signature-aggregator-config.json:/config.json avaplatform/signature-aggregator:v0.1.0-rc0-amd64 --config-file /config.json +``` From 89c7a91a35c26a117fdb118e857d11e837ffc9eb Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Thu, 12 Sep 2024 18:21:04 +0000 Subject: [PATCH 6/6] fixup relayer example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7339c7dd..79e0708f 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ $ docker run -v $(pwd)/signature-aggregator/sample-signature-aggregator-config.j Or, for the relayer: ```bash -$ goreleaser release --single-target --clean --snapshot --config signature-aggregator/.goreleaser.yml +$ goreleaser release --single-target --clean --snapshot --config relayer/.goreleaser.yml ... -$ docker run -v $(pwd)/signature-aggregator/sample-signature-aggregator-config.json:/config.json avaplatform/signature-aggregator:v0.1.0-rc0-amd64 --config-file /config.json +$ docker run -v $(pwd)/sample-relayer-config.json:/config.json avaplatform/awm-relayer:v1.0.4-test12-amd64 --config-file /config.json ```