From bc86a8dfdc5e7b3b16f0cbff3ffb03069082ecaf Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Wed, 7 Aug 2024 20:17:03 +0200 Subject: [PATCH] fix ld flag [goreleaser] --- agents/.goreleaser.yml | 2 +- contrib/opbot/.goreleaser.yml | 4 ++-- contrib/screener-api/.goreleaser.yml | 2 +- core/metrics/rookout.go | 8 ++++++-- docker/.dockerignore | 6 ------ docker/agents.Dockerfile | 2 +- docker/cctp-relayer.Dockerfile | 2 -- docker/explorer.Dockerfile | 2 +- docker/git-changes-action.Dockerfile | 2 +- docker/omnirpc.Dockerfile | 2 +- docker/opbot.Dockerfile | 2 +- docker/promexporter.Dockerfile | 2 +- docker/rfq-api.Dockerfile | 2 +- docker/rfq-relayer.Dockerfile | 2 +- docker/screener-api.Dockerfile | 2 +- docker/scribe.Dockerfile | 2 +- ethergo/.goreleaser.yml | 2 +- services/omnirpc/.goreleaser.yml | 2 +- services/rfq/.goreleaser.yml | 6 +++--- 19 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 docker/.dockerignore diff --git a/agents/.goreleaser.yml b/agents/.goreleaser.yml index 782ced38c5..6d68d24548 100644 --- a/agents/.goreleaser.yml +++ b/agents/.goreleaser.yml @@ -12,7 +12,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # required workaround for https://github.com/Shopify/sarama/issues/2206 # See: https://github.com/golang/go/issues/35067#issuecomment-544805311 because we're statically compiling, # without forcing netgo, we use the cgo resolver which will not work for .local (a canonical tld in kubernetes) diff --git a/contrib/opbot/.goreleaser.yml b/contrib/opbot/.goreleaser.yml index 13d429bff2..d12cf96884 100644 --- a/contrib/opbot/.goreleaser.yml +++ b/contrib/opbot/.goreleaser.yml @@ -10,7 +10,7 @@ builds: binary: opbot ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} gcflags: - all=-dwarflocationlists=true # required workaround for https://github.com/Shopify/sarama/issues/2206 @@ -33,7 +33,7 @@ builds: binary: signozexample ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # see above about workaround tags: - netgo diff --git a/contrib/screener-api/.goreleaser.yml b/contrib/screener-api/.goreleaser.yml index 7a596ac06e..5726d77eeb 100644 --- a/contrib/screener-api/.goreleaser.yml +++ b/contrib/screener-api/.goreleaser.yml @@ -12,7 +12,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # required workaround for https://github.com/Shopify/sarama/issues/2206 # See: https://github.com/golang/go/issues/35067#issuecomment-544805311 because we're statically compiling, # without forcing netgo, we use the cgo resolver which will not work for .local (a canonical tld in kubernetes) diff --git a/core/metrics/rookout.go b/core/metrics/rookout.go index eb79c897ad..d28f4002fa 100644 --- a/core/metrics/rookout.go +++ b/core/metrics/rookout.go @@ -4,6 +4,7 @@ import ( rookout "github.com/Rookout/GoSDK" "github.com/Rookout/GoSDK/pkg/config" "github.com/synapsecns/sanguine/core" + synconfig "github.com/synapsecns/sanguine/core/config" "github.com/synapsecns/sanguine/core/metrics/internal" "os" ) @@ -14,8 +15,11 @@ func init() { if core.HasEnv(internal.RookoutToken) { // TODO: Consider doing git stuff here. err := rookout.Start(config.RookOptions{ - Token: os.Getenv(internal.RookoutToken), - Debug: core.HasEnv(internal.RookoutDebug), + Token: os.Getenv(internal.RookoutToken), + Debug: core.HasEnv(internal.RookoutDebug), + GitCommit: synconfig.DefaultCommit, + // note: will chagne on fork + GitOrigin: "https://github.com/synapsecns/sanguine", }) if err != nil { logger.Warn(err) diff --git a/docker/.dockerignore b/docker/.dockerignore deleted file mode 100644 index c2f0f6c1b9..0000000000 --- a/docker/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -# Keep ignoring .git -.git -# Allow specific files with ! -!.git/HEAD -!.git/config -!.git/refs diff --git a/docker/agents.Dockerfile b/docker/agents.Dockerfile index 785b742f42..52a0e74c1e 100644 --- a/docker/agents.Dockerfile +++ b/docker/agents.Dockerfile @@ -12,7 +12,7 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot agents /app/agents -COPY .git /.git + ENTRYPOINT ["/app/agents"] diff --git a/docker/cctp-relayer.Dockerfile b/docker/cctp-relayer.Dockerfile index bf24f0c59d..90074b78fe 100644 --- a/docker/cctp-relayer.Dockerfile +++ b/docker/cctp-relayer.Dockerfile @@ -12,6 +12,4 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot cctp-relayer /app/cctp-relayer -COPY .git /.git - ENTRYPOINT ["/app/cctp-relayer"] diff --git a/docker/explorer.Dockerfile b/docker/explorer.Dockerfile index 9583b2b518..f59834450d 100644 --- a/docker/explorer.Dockerfile +++ b/docker/explorer.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot explorer /app/explorer -COPY .git /.git + ENTRYPOINT ["/app/explorer"] diff --git a/docker/git-changes-action.Dockerfile b/docker/git-changes-action.Dockerfile index 6d6ba0e894..0c7198e9cb 100644 --- a/docker/git-changes-action.Dockerfile +++ b/docker/git-changes-action.Dockerfile @@ -26,6 +26,6 @@ COPY --from=builder /etc/passwd /etc/passwd WORKDIR /git-changes-action COPY git-changes-action /app/git-changes-action -COPY .git /.git + ENTRYPOINT ["/app/git-changes-action"] diff --git a/docker/omnirpc.Dockerfile b/docker/omnirpc.Dockerfile index 0a3f5ecfbe..d6b4ad3895 100644 --- a/docker/omnirpc.Dockerfile +++ b/docker/omnirpc.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot omnirpc /app/omnirpc -COPY .git /.git + ENTRYPOINT ["/app/omnirpc"] diff --git a/docker/opbot.Dockerfile b/docker/opbot.Dockerfile index 91d0e0100f..8d469cb5fa 100644 --- a/docker/opbot.Dockerfile +++ b/docker/opbot.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot opbot /app/opbot -COPY .git /.git + ENTRYPOINT ["/app/opbot"] diff --git a/docker/promexporter.Dockerfile b/docker/promexporter.Dockerfile index 4665ffa546..46d38a2690 100644 --- a/docker/promexporter.Dockerfile +++ b/docker/promexporter.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot promexporter /app/promexporter -COPY .git /.git + ENTRYPOINT ["/app/promexporter"] diff --git a/docker/rfq-api.Dockerfile b/docker/rfq-api.Dockerfile index 50284de7cc..ed450d546f 100644 --- a/docker/rfq-api.Dockerfile +++ b/docker/rfq-api.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot api /app/api -COPY .git /.git + ENTRYPOINT ["/app/api"] diff --git a/docker/rfq-relayer.Dockerfile b/docker/rfq-relayer.Dockerfile index d93a36af3c..19a6cfd39e 100644 --- a/docker/rfq-relayer.Dockerfile +++ b/docker/rfq-relayer.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot relayer /app/relayer -COPY .git /.git + ENTRYPOINT ["/app/relayer"] diff --git a/docker/screener-api.Dockerfile b/docker/screener-api.Dockerfile index 0dd4dd06d3..8d3223c247 100644 --- a/docker/screener-api.Dockerfile +++ b/docker/screener-api.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot screener /app/screener -COPY .git /.git + ENTRYPOINT ["/app/screener"] diff --git a/docker/scribe.Dockerfile b/docker/scribe.Dockerfile index 4b6a61afa5..83d4d04e52 100644 --- a/docker/scribe.Dockerfile +++ b/docker/scribe.Dockerfile @@ -12,6 +12,6 @@ USER nonroot:nonroot WORKDIR /app COPY --chown=nonroot:nonroot scribe /app/scribe -COPY .git /.git + ENTRYPOINT ["/app/scribe"] diff --git a/ethergo/.goreleaser.yml b/ethergo/.goreleaser.yml index ec95c06859..c511f21484 100644 --- a/ethergo/.goreleaser.yml +++ b/ethergo/.goreleaser.yml @@ -12,7 +12,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # required workaround for https://github.com/Shopify/sarama/issues/2206 # See: https://github.com/golang/go/issues/35067#issuecomment-544805311 because we're statically compiling, # without forcing netgo, we use the cgo resolver which will not work for .local (a canonical tld in kubernetes) diff --git a/services/omnirpc/.goreleaser.yml b/services/omnirpc/.goreleaser.yml index c38c465594..d36c2cabf5 100644 --- a/services/omnirpc/.goreleaser.yml +++ b/services/omnirpc/.goreleaser.yml @@ -13,7 +13,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # required workaround for https://github.com/Shopify/sarama/issues/2206 # See: https://github.com/golang/go/issues/35067#issuecomment-544805311 because we're statically compiling, # without forcing netgo, we use the cgo resolver which will not work for .local (a canonical tld in kubernetes) diff --git a/services/rfq/.goreleaser.yml b/services/rfq/.goreleaser.yml index 731be4c6e1..a211dc6f29 100644 --- a/services/rfq/.goreleaser.yml +++ b/services/rfq/.goreleaser.yml @@ -12,7 +12,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # required workaround for https://github.com/Shopify/sarama/issues/2206 # See: https://github.com/golang/go/issues/35067#issuecomment-544805311 because we're statically compiling, # without forcing netgo, we use the cgo resolver which will not work for .local (a canonical tld in kubernetes) @@ -36,7 +36,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # see above about workaround tags: - netgo @@ -55,7 +55,7 @@ builds: - all=-dwarflocationlists=true ldflags: # We need to build a static binary because we are building in a glibc based system and running in a musl container - - -s -w -extldflags '-static' -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} + - -s -w -extldflags '-static' -X github.com/synapsecns/sanguine/core/config.DefaultVersion={{.Version}} -X github.com/synapsecns/sanguine/core/config.DefaultCommit={{.Commit}} -X github.com/synapsecns/sanguine/core/config.DefaultDate={{ .CommitDate }} # see above about workaround tags: - netgo