Skip to content

Commit

Permalink
goreleaser: signature aggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
feuGeneA committed Aug 22, 2024
1 parent 6cd26a9 commit 161e6df
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 10 deletions.
59 changes: 56 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,64 @@ builds:
ignore:
- goos: darwin
goarch: amd64
- id: signature-aggregator
main: ./signature-aggregator/main/main.go
binary: signature-aggregator
flags:
- -v
# windows is ignored by default, as the `goos` field by default only
# contains linux and darwin
goos:
- linux
- darwin
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
- CGO_CFLAGS=-O -D__BLST_PORTABLE__ # Set the CGO flags to use the portable version of BLST
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang
ignore:
- goos: darwin
goarch: amd64
dockers:
- image_templates:
- 'avaplatform/awm-relayer:{{ .Tag }}-amd64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--build-arg=GO_VERSION={{ .Env.GO_VERSION }}"
dockerfile: "relayer/Dockerfile"
- image_templates:
- 'avaplatform/awm-relayer:{{ .Tag }}-arm64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--build-arg=GO_VERSION={{ .Env.GO_VERSION }}"
dockerfile: "relayer/Dockerfile"
goarch: arm64
- image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-amd64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
dockerfile: "signature-aggregator/Dockerfile"
- image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-arm64'
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
dockerfile: "signature-aggregator/Dockerfile"
goarch: arm64
docker_manifests:
- name_template: 'avaplatform/awm-relayer:{{ .Tag }}'
Expand All @@ -55,11 +98,21 @@ docker_manifests:
- 'avaplatform/awm-relayer:{{ .Tag }}-arm64'
# If tag is an rc, do not push the latest tag
skip_push: auto
- name_template: 'avaplatform/signature-aggregator:{{ .Tag }}'
image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-amd64'
- 'avaplatform/signature-aggregator:{{ .Tag }}-arm64'
- name_template: 'avaplatform/signature-aggregator:latest'
image_templates:
- 'avaplatform/signature-aggregator:{{ .Tag }}-amd64'
- 'avaplatform/signature-aggregator:{{ .Tag }}-arm64'
# If tag is an rc, do not push the latest tag
skip_push: auto
release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.
github:
owner: ava-labs
name: awm-relayer
# If tag indicates rc, will mark it as prerelease
prerelease: auto
prerelease: auto
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

6 changes: 6 additions & 0 deletions relayer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:11-slim
COPY awm-relayer /usr/bin/awm-relayer
EXPOSE 8080
USER 1001
CMD ["start"]
ENTRYPOINT [ "/usr/bin/awm-relayer" ]
26 changes: 26 additions & 0 deletions scripts/build_signature_aggregator_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Use this script to build the approver docker image in your local working copy
# of the repository. Be prepared to repeatedly hit your YubiKey during the `go
# mod download` step of the image build, just like you need to do for a
# non-Docker build.

set -o errexit
set -o nounset
set -o xtrace

REPO_PATH=$(git rev-parse --show-toplevel)
source "$REPO_PATH/scripts/versions.sh"
source "$REPO_PATH/scripts/constants.sh"

docker_repo=avaplatform/signature-aggregator

docker --debug build \
--build-arg="GO_VERSION=${GO_VERSION}" \
--build-arg="API_PORT=${SIGNATURE_AGGREGATOR_API_PORT}" \
--build-arg="METRICS_PORT=${SIGNATURE_AGGREGATOR_METRICS_PORT}" \
--file "$REPO_PATH/signature-aggregator/Dockerfile" \
--ssh default \
--tag "${docker_repo}:$(git rev-parse HEAD)" \
--tag "${docker_repo}:$(git rev-parse --abbrev-ref HEAD | sed 's/\//-/g')" \
.
5 changes: 5 additions & 0 deletions scripts/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ SIGNATURE_AGGREGATOR_PATH=$(
relayer_path="$BASE_PATH/build/awm-relayer"
signature_aggregator_path="$BASE_PATH/build/signature-aggregator"

# these are duplicated here from signature-aggregator/config so they can be
# used as arguments to the docker image build.
export SIGNATURE_AGGREGATOR_API_PORT=8080
export SIGNATURE_AGGREGATOR_METRICS_PORT=8081

# Set the PATHS
GOPATH="$(go env GOPATH)"

Expand Down
6 changes: 6 additions & 0 deletions signature-aggregator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:11-slim
COPY signature-aggregator /usr/bin/signature-aggregator
EXPOSE 8080
EXPOSE 8081
CMD ["start"]
ENTRYPOINT [ "/usr/bin/signature-aggregator" ]

0 comments on commit 161e6df

Please sign in to comment.