Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

feat: create arm64 architecture docker build at release #3037

Merged
merged 10 commits into from
May 28, 2022
Merged

feat: create arm64 architecture docker build at release #3037

merged 10 commits into from
May 28, 2022

Conversation

AuHau
Copy link
Contributor

@AuHau AuHau commented May 6, 2022

This adds support for multi-architecture builds as described https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md

The platforms chosen are those that your base image supports: https://hub.docker.com/layers/node/library/node/14.17.4-stretch/images/sha256-1008070b2f1b15a7a3661b91d64662de82fb97a2219e0bc8392e9cdb9d8402ff?context=explore

I would suggest testing this somehow, but that is out of my possibility.

@davidmurdoch
Copy link
Member

I'm dumb when it comes to Docker so I have questions:

Will this increase the container sizes significantly?

I thought the point of Docker was to abstract the complexities of the host OS and architecture away, so that what ever is in the container would "Just Work". Is that not the case anymore?

@AuHau
Copy link
Contributor Author

AuHau commented May 7, 2022

This won't change the image's size (or to my knowledge) but will create several architectural versions of the image. That will increase the size stored on the Docker Registry, but I don't think that is a problem for you.

Docker works more on the OS-abstraction layer utilizing the host's Linux kernel and its capabilities for most of the work and is not really capable to abstract different architectures. You can for example see in the Node's Docker images that there are "OS/ARCH" versions for one Image tag.

Nowadays the previously marginal architectures are picking up a bigger market share, for example, the new Apple Macs runs on ARM architecture. They are still able to run the AMD64 architecture images because they have the emulation layer (Rosetta), but other platforms might not have this capability and it is generally better to run native instead of emulated code.

If you are interested to understand bit more, there is for example nice blog post about this topic here: https://medium.com/icetek/understanding-how-docker-multi-arch-images-work-9a7e035e2868

@davidmurdoch
Copy link
Member

Cool. Thanks for the explanation. This sounds like it'll be a much needed addition! Do y'all need this soon? We're in the middle of a hackathon that runs until next week and weren't planning on cutting a release this week, and testing changes to the automated release process always takes a lot of time.

@AuHau
Copy link
Contributor Author

AuHau commented May 7, 2022

No rush. Enjoy your hackathon 😉

@davidmurdoch
Copy link
Member

Looks like the arm/v7 build is failing due to memory issues (after stalling for a long time): https://github.com/trufflesuite/ganache/runs/6574833364?check_suite_focus=true

Is 32 bit ARM popular enough to warrant figuring this out?

@AuHau
Copy link
Contributor Author

AuHau commented May 24, 2022

Honestly, hard to say 😳 My personal pain is missing the linux/arm64/v8 for my M1 Mac 😅 Maybe it can be skipped for now and if somebody will require it, then it can be revisited?

@davidmurdoch
Copy link
Member

@AuHau do you mind trying Docker image trufflesuite/ganache:internal on your M1 and let me know if it is all working as expected?

@AuHau
Copy link
Contributor Author

AuHau commented May 26, 2022

Seems like it runs as expected! I don't see the usual warning that it is uncompatible architecture. Only thing is that it seems like you are using (or some of your dependency) some precompiled binaries that are not present for this architecture?

The logs:

This version of µWS is not compatible with your Node.js build:

Error: Cannot find module './uws_linux_arm64_83.node'
Falling back to a NodeJS implementation; performance may be degraded.
Full logs
Unable to find image 'trufflesuite/ganache:internal' locally
internal: Pulling from trufflesuite/ganache
9e7a560784c8: Pull complete 
66656855feaf: Pull complete 
3f3b4f2d5ba3: Pull complete 
cc9683eb4c69: Pull complete 
d53c410db7b6: Pull complete 
cd5595db54ad: Pull complete 
954e13bfc1e8: Pull complete 
b56cc77cca23: Pull complete 
Digest: sha256:ac46f625e3a0456fd6dbbb0c73e254bb1a07ab0b33aee4f51627b1c94991dbc6
Status: Downloaded newer image for trufflesuite/ganache:internal
This version of µWS is not compatible with your Node.js build:

Error: Cannot find module './uws_linux_arm64_83.node'
Falling back to a NodeJS implementation; performance may be degraded.


ganache v7.2.0 (@ganache/cli: 0.3.0, @ganache/core: 0.3.0)
Starting RPC server
(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Available Accounts
==================
(0) 0x1B67a5A3D48e3fFE751fD7593D214bcC7f36b6f1 (1000 ETH)
(1) 0x1c6c85c007762dA3Ad7fa6569cF59B7b5d30e6C1 (1000 ETH)
(2) 0xC3226d82749F8058CE43b1B7695C7Dc2D208A33f (1000 ETH)
(3) 0xD768921983FBCcFdA42DfE0fA47C48A6371D6C35 (1000 ETH)
(4) 0x16A72318d18206c051cE967cf6fB6D2646439E25 (1000 ETH)
(5) 0xd21Bcfc88Eb31C8edDBBe79395231F86aF2c317B (1000 ETH)
(6) 0x44ad3c948A2321771f3aC9d8B7a8DFE6627Ab49b (1000 ETH)
(7) 0xFb4Acb4fd4de0fC84b6A8afA96c2E58FC7eFDd1d (1000 ETH)
(8) 0x2cc96f2CEf0b24621fB18bDA2C20f85E8559Fd9E (1000 ETH)
(9) 0xd13073ec8e76ac95891B42F7d56DBA44733057c2 (1000 ETH)

Private Keys
==================
(0) 0x3eea163bfc5b6ecb7749f24e617157fb344831396b7350c50b052273e1a0add9
(1) 0xf8b5aa7a89217cf1888dc6a744a28cb56ef21e7619d354cbb96d1e05b8392f4f
(2) 0xa96c75a61b85ee4753fc6906832939c0dc49f6c86347ec92ba1794576c2dd2dd
(3) 0x0ed68c38f918f776938a4c203fcbb5b12e9e99ee25669e748804317e2b4c411b
(4) 0xec820c4392bf54b93d0c5340158a067dde2a48482f11637ff13aa1706457db79
(5) 0x9e966df3e6cdc2d7bf72a3813b90731f711a4a5e1badac8f47f5218335133c00
(6) 0x4b4ab7af4520d33d191d38b4d8fcc00b62ec1c9bac9545acbd111ff362424f6e
(7) 0x15f463f9674f91e7f8353079cdd472283646968c61d73fc2ccc158fb3c504ed1
(8) 0x0d79f6bfdb9b7b630a35223205dd7a5fa966b5b172018710da21b0ad13019a04
(9) 0x515626b2fd324409f9229788cb1c4fa8e35d67d4c65020c51640799a35aeb70c

HD Wallet
==================
Mnemonic:      slow anger only hint maximum quote unfold drill lawsuit crack chair actor
Base HD Path:  m/44'/60'/0'/0/{account_index}

Default Gas Price
==================
2000000000

BlockGas Limit
==================
30000000

Call Gas Limit
==================
50000000

Chain Id
==================
1337

RPC Listening on 0.0.0.0:8545

@davidmurdoch davidmurdoch changed the title ci: multi-arch docker builds feat: multi-arch docker builds May 28, 2022
@davidmurdoch davidmurdoch changed the title feat: multi-arch docker builds feat: create arm64 architecture docker build at release May 28, 2022
@davidmurdoch davidmurdoch merged commit 019345f into trufflesuite:develop May 28, 2022
@AuHau AuHau deleted the patch-1 branch May 30, 2022 06:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants