Skip to content
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

Unify base images to reduce disk image size #182

Closed
shawaj opened this issue Oct 22, 2021 · 4 comments
Closed

Unify base images to reduce disk image size #182

shawaj opened this issue Oct 22, 2021 · 4 comments

Comments

@shawaj
Copy link
Member

shawaj commented Oct 22, 2021

In discussion with @vpetersson we have discussed using the same base image across diag, upnp, config and pktfwd containers to reduce the overall balenaOS image size

This is a tracking issue for this work and unifies work from these other repos:

Currently the miner and dbus containers are built by helium and balena respectively so we would need to build these ourselves to use a single base image for all containers. This is probably out of scope for now but may be worth revisiting in the future.

@shawaj
Copy link
Member Author

shawaj commented Oct 22, 2021

Guess we should benchmark this by providing size tests of images before and after this work to see if there is an appreciable difference

shawaj added a commit to NebraLtd/hm-diag that referenced this issue Oct 23, 2021
- change base image across as many containers as possible to reduce image size
- unpin versions
- fix package names (due to change from alpine to Debian)
- ignore pinning warning
- call correct pip
- remove unused installations
- fix --no-cache-dir call
- bump hm-pyhelper
- combine some RUN commands to reduce layer size

Relates to: NebraLtd/helium-miner-software#182
@shawaj
Copy link
Member Author

shawaj commented Oct 23, 2021

So changing UPnP from Alpine to Raspberry Pi Debian Python increased the size of the container from 47MB to 287MB - however this does not take into account the fact that this base OS image is shared across upnp, hm-diag, hm-config and soon also hm-pktfwd...
image

image

Diag has actually reduced in size from 327MB to 313MB changing from alpine to debian-python...

image

shawaj added a commit to NebraLtd/hm-pktfwd that referenced this issue Oct 26, 2021
shawaj added a commit that referenced this issue Oct 27, 2021
Bumps UPnP, config, diag and packet forwarder containers so they are now all using the same base image.

We need to now test that it's actually smaller so will leave #182 open for now.
vpetersson pushed a commit that referenced this issue Nov 15, 2021
…and pktfwd rewrite (#215)

* test diag with new base image

test diag with new base image

* bump upnp for testing

bump upnp for testing

* fix: add depends on for packet forwarder

The packet forwarder actually requires the miner container to be able to accept connections on the hostname helium-miner before it will be able to start the concentrator.

This adds a depends_on to not attempt to start the packet forwarder container until the miner container is up

* Create docker-compose.yml

Bumps UPnP, config, diag and packet forwarder containers so they are now all using the same base image.

We need to now test that it's actually smaller so will leave #182 open for now.

* Bump to 2021.10.27.0_GA

Bump to 2021.10.27.0_GA

* Added documentation to the readme for quick start (#189)

Added documentation to the readme for quick start (#189)

* Bump to 2021.10.29.0_GA

Bump to 2021.10.29.0_GA

* Bump to 2021.11.02.0_GA

Bump to 2021.11.02.0_GA

* rearrange readme

rearrange readme

* Update README.md

* Bump diag and config

Bump diag and config

* feat: bump GA to 2021.11.04.2

* release: bump GA to 2021.11.10.0

* release: bump GA to 2021.11.11.0

* Add tech support to CODEOWNERS

Partially fixes #208

* fix: ECC locking and initFile (#209)

Lock ECC usage and ensure initFile always returns.

* build: bump firmware version

* bump(pktfwd): current master branch

Including likely unnecessary patch to regions.

Co-authored-by: Aaron Shaw <[email protected]>
Co-authored-by: Sebastian Maj <[email protected]>
@shawaj
Copy link
Member Author

shawaj commented Dec 2, 2021

This work is now complete. Will close this issue for now 👍

@shawaj shawaj closed this as completed Dec 2, 2021
@shawaj
Copy link
Member Author

shawaj commented Dec 3, 2021

For reference, this reduced the zipped disk image size from ~600 MB to ~400 MB

Overall image size has gone down from 2.79 GB to 1.83 GB

So a healthy saving!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants