Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

dockerize signature aggregator #435

Merged
merged 5 commits into from
Sep 6, 2024
Merged

dockerize signature aggregator #435

merged 5 commits into from
Sep 6, 2024

Conversation

feuGeneA
Copy link
Contributor

@feuGeneA feuGeneA commented Aug 16, 2024

Why this should be merged

fixes #425

How was this tested

by creating ...-test tags off of the commit here to trigger the Release Actions, the results of which can be seen here and here.

@feuGeneA feuGeneA force-pushed the dockerize-sig-aggregator branch from 878c023 to 161e6df Compare August 22, 2024 15:15
@@ -0,0 +1,6 @@
FROM debian:11-slim
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compare to the old repo_root/Dockerfile. I guess I made too many changes for the PR to reflect that the file was just renamed and edited.

The edits I made were to change the base image and to drop the build ARG. The base image was formerly golang, but we're not actually building any Go code in the building of this image (rather, goreleaser is pre-building the binary, and then the Dockerfile just copies that binary into the image) so there's no need to have a Go build environment. Furthermore, there's no reason to pass in a GO_VERSION either.

@feuGeneA feuGeneA marked this pull request as ready for review August 22, 2024 18:04
@feuGeneA feuGeneA requested a review from a team as a code owner August 22, 2024 18:04
@feuGeneA feuGeneA marked this pull request as draft August 22, 2024 18:09
@feuGeneA feuGeneA force-pushed the dockerize-sig-aggregator branch 4 times, most recently from d52b417 to d5ec489 Compare September 5, 2024 03:16
@feuGeneA feuGeneA force-pushed the dockerize-sig-aggregator branch from d5ec489 to a491deb Compare September 5, 2024 03:33
@feuGeneA feuGeneA marked this pull request as ready for review September 5, 2024 03:49
@feuGeneA feuGeneA requested a review from geoff-vball September 5, 2024 03:49
Comment on lines 20 to 24
# The GO_VERSION must be set explicitly to be used in the Dockerfile.
- name: Set Go version
run: |
source ./scripts/versions.sh
echo GO_VERSION=$GO_VERSION >> $GITHUB_ENV
Copy link
Contributor

@geoff-vball geoff-vball Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this step is necessary anymore now that the go.mod file can contain the patch version and actions/setup-go below accepts it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM debian:11-slim
COPY signature-aggregator /usr/bin/signature-aggregator
EXPOSE 8080
EXPOSE 8081
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we exposing this metrics port here but not in the relayer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. I did it for the aggregator because it felt like the right thing to do, since there'd be no way to consume metrics without it, but I left things the way they were for the relayer in order to limit the scope of changes.

There's a similar question to be asked about why the relayer sets a USER. @cam-schultz once advised me to avoid setting a USER.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be consistent and remove it from here since it looks like relayer handles without exposing it directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after doing a little more research, it looks like EXPOSE is purely documentation, with a bit of automation convenience that takes advantage of that documentation.

when you run an image with docker run, there's a -P option that will automatically "publish" all of the ports that the image EXPOSEs, but you can manually choose to publish that port, or not, or publish different ports, and the image can also listen on other ports (eg if a config file said to use a different port), and the runtime can still publish ports that were never even EXPOSEd.

so, it seems completely unnecessary, but good documentation, and potentially a helpful convenience to some users. my vote would be to keep it, but i don't feel that strongly about it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it all makes sense. What this is documenting is default ports that are probably going to be overwritten by the config that you pass in. But I don't feel strongly either actually so can drop

Copy link
Contributor

@iansuvak iansuvak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tested that awm-relayer also builds correctly? If so LGTM and would like to build 0.1.0.RC for signature-aggregator

@feuGeneA feuGeneA merged commit be07363 into main Sep 6, 2024
8 checks passed
@feuGeneA feuGeneA deleted the dockerize-sig-aggregator branch September 6, 2024 17:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Dockerize signature aggregator
3 participants