-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix devnet
Mithril Docker images
#1272
Comments
@jpraynaud I took a stab at this. I've been building/running cardano-node in containers for a few years, and also mithril-signer in containers on the preprod and preview networks. Unfortunately, both my preview and preprod signers have been offline for 1-2 epochs, so I wouldn't be able to simply restart them and quickly observe a certificate being signed. I figured I'd at least post the branch here for review in case anyone else wants to test building, or running the image on either network before I get a chance. The branch of my fork it can be reviewed from is: fix-devnet-mithril-docker-images. It only has the Dockerfile for the mithril-signer image changed. If this would be welcome and not conflict with ongoing work by others I could apply this to other container images as well, though I'm mostly familiar with the signer and client as I haven't set up a full aggregator beyond the automatic devnet tests. Mithril SignerObserved Results
Can seem counterintuitive to have fewer layers when often articles suggest more. However, the image build is slightly faster with fewer layers even with identical commands, although not the primary reason or benefit. The image size is reduced from 338MB to 173MB, or reduced ~48%. Changes Review
I can answer questions about how the changes affect the cache, build times, and container sizes if anyone is interested. I haven't tried with Buildah or Buildkit yet to create a complete scratch image. That is another option that could reduce the size but could increase build times, and/or slightly complicate the build process for developers. |
The preview network passed enough epochs to have signed a certificate, so I've stopped and restarted the mithril-signer from the new image, just waiting to confirm the next signature I participate in. I committed Dockerfiles for both mithril-client and mithril-aggregator that use the release binaries. I tried the devnet from the current documentation, but I ran into
I don't recall if I saw this when I tested devnet long ago. It seems familiar, but if worked around this before I'm not finding my notes explaining how I did it. |
The building takes under 60 seconds for each image. The client reduced 138MB down to 122MB, dropping 16MB or 11.5%. The aggregator reduced 367MB down to 188MB, dropping 179MB or, again, 48%. From release binaries and adjustments to slim containers.
current ghcr.io images
|
Here is a certificate signed from the mithril-signer image f6831e29909a: 4b3468138da933e8b7ad80537398426197c65fd62465c9227bcd3c36b6699654 by POOL_ID pool1vezalga3ge0mt0xf4txz66ctufk6nrmemhhpshwkhedk5jf0stw. |
I'm unsure what this part meant or would have attempted to address it. I can open a PR with the branch as is and during the review discuss how it should be handled or if it should be split into a separate PR. As well as if I overlooked anything that may not have been spelled out in the issue. |
@TrevorBenson thanks for your feedback 👍 We have also noticed that there is a configuration problem with the We currently have 2 docker images for each node:
It looks like we can significantly optimize the size of the images we release with the Feel free to create a PR that implements the optimizations for the |
Will do. Should the current commits be included, or dropped and let the developers do complete rust builds for devnet? Should I presume a buildx cache for the workflow is of interest as well? |
@jpraynaud I haven't modified the release workflow to include the Docker Buildx cache or additional changes that might be useful when using a cache. I did temporarily rebase onto your branch to test on the devnet, and that looks good as well. If you feel this is ready I will open a PR for further review discussion and suggestions. |
The two Dockerfiles are very close to each other at this point. Differences:
Otherwise, they are almost identical enough to use a single file instead of two separate ones. |
Thanks @TrevorBenson for your contribution! The size of the Docker images of the signer and the aggregator dropped significantly👏 $ docker images | grep -e "2337.0-7d5a683" -e "2342.0-pre-e5ae362"
ghcr.io/input-output-hk/mithril-aggregator 2342.0-pre-e5ae362 77d3ab8036ed 31 minutes ago 215MB
ghcr.io/input-output-hk/mithril-signer 2342.0-pre-e5ae362 57d864a659a1 31 minutes ago 186MB
ghcr.io/input-output-hk/mithril-client 2342.0-pre-e5ae362 05093eb75606 31 minutes ago 134MB
ghcr.io/input-output-hk/mithril-aggregator 2337.0-7d5a683 9119b9e817c7 3 weeks ago 363MB
ghcr.io/input-output-hk/mithril-signer 2337.0-7d5a683 c45b801379a4 3 weeks ago 334MB
ghcr.io/input-output-hk/mithril-client 2337.0-7d5a683 de66c901dc86 3 weeks ago 134MB |
Great. One thing stands out as odd to me. The 2342 build is marginally smaller for signer 2MB (offset by +300K for aggregator) than the 2337 build, yet the result using the compiled version (vs. the tarball for release binaries):
I wouldn't expect that to be the final result given the binaries should be identical to what is in the pre release tarball. I'm not overly concerned since we at least made progress on shrinking them, however it does make me go 🤔 EDIT: I use podman, and subsequently buildah. I don't recall that resulting in any real size differences in the past, but suppose it is possible it is something different on my side and not actually a difference between compiled and tarball. |
I think you misread the results 🙂
|
@jpraynaud I'm referring to the original sizes I observed with the Dockerfile builds: |
Why
The current
devnet
can launch Docker images for the Mithril nodes. There are several drawbacks that we would need to address to enhance the DevX.What
How
The text was updated successfully, but these errors were encountered: