-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update or replace system-docker #28
Comments
I have forked those repos under burmilla but I'm not sure if we really want upgrade system-docker because we don't really need those new features on it and binaries sizes has increased a lot of on those new versions. docker-17.06.2-ce:
total 89M
-rwxr-xr-x 1 pi pi 18M Sep 5 2017 docker
-rwxr-xr-x 1 pi pi 9.5M Sep 5 2017 docker-containerd
-rwxr-xr-x 1 pi pi 8.6M Sep 5 2017 docker-containerd-ctr
-rwxr-xr-x 1 pi pi 3.7M Sep 5 2017 docker-containerd-shim
-rwxr-xr-x 1 pi pi 39M Sep 5 2017 dockerd
-rwxr-xr-x 1 pi pi 755K Sep 5 2017 docker-init
-rwxr-xr-x 1 pi pi 2.4M Sep 5 2017 docker-proxy
-rwxr-xr-x 1 pi pi 7.4M Sep 5 2017 docker-runc
docker-19.03.14:
total 200M
-rwxr-xr-x 1 pi pi 36M Dec 1 21:22 containerd
-rwxr-xr-x 1 pi pi 6.9M Dec 1 21:22 containerd-shim
-rwxr-xr-x 1 pi pi 19M Dec 1 21:22 ctr
-rwxr-xr-x 1 pi pi 59M Dec 1 21:22 docker
-rwxr-xr-x 1 pi pi 69M Dec 1 21:22 dockerd
-rwxr-xr-x 1 pi pi 693K Dec 1 21:22 docker-init
-rwxr-xr-x 1 pi pi 2.8M Dec 1 21:22 docker-proxy
-rwxr-xr-x 1 pi pi 9.2M Dec 1 21:22 runc
docker-20.10.0:
total 219M
-rwxr-xr-x 1 pi pi 38M Dec 8 20:59 containerd
-rwxr-xr-x 1 pi pi 7.0M Dec 8 20:59 containerd-shim
-rwxr-xr-x 1 pi pi 9.5M Dec 8 20:59 containerd-shim-runc-v2
-rwxr-xr-x 1 pi pi 21M Dec 8 20:59 ctr
-rwxr-xr-x 1 pi pi 53M Dec 8 20:59 docker
-rwxr-xr-x 1 pi pi 76M Dec 8 20:59 dockerd
-rwxr-xr-x 1 pi pi 693K Dec 8 20:59 docker-init
-rwxr-xr-x 1 pi pi 2.8M Dec 8 20:59 docker-proxy
-rwxr-xr-x 1 pi pi 13M Dec 8 20:59 runc Also I can see that docker-amd64-17.06-ros6:
total 67M
-rwxr-xr-x 1 pi pi 9.9M Feb 11 2019 system-docker
-rwxr-xr-x 1 pi pi 9.5M Feb 11 2019 system-docker-containerd
-rwxr-xr-x 1 pi pi 8.6M Feb 11 2019 system-docker-containerd-ctr
-rwxr-xr-x 1 pi pi 3.7M Feb 11 2019 system-docker-containerd-shim
-rwxr-xr-x 1 pi pi 25M Feb 11 2019 system-dockerd
-rwxr-xr-x 1 pi pi 755K Feb 11 2019 system-docker-init
-rwxr-xr-x 1 pi pi 2.4M Feb 11 2019 system-docker-proxy
-rwxr-xr-x 1 pi pi 7.4M Feb 11 2019 system-docker-runc So most probably we should update Alternative way is stay on 17.06 forever and only cherry-pick fixes from Moby if needed. |
The reason for this is probably the removal of some features for system-docker: I will try to compile and adapt this and post a size for system-docker |
Actually after a successful built, the size did not shrink that much:
Checking the source code and diffs, a bit of google research showed the possibility of running multiple deamons: https://stackoverflow.com/questions/32334167/is-it-possible-to-start-multiple-docker-daemons-on-the-same-machine This could be a better way to only maintain a single dockerd and just have a small wrapper script for |
@dgiebert first of all I would like to understand that what you are actually trying to achieve by updating system-docker? Main purpose of it is actually just works as package provider (like apt-get, yum, etc) for BurmillaOS so as long we don't have known bugs on it I don't see reason to change it. |
Go binaries growing looks to be generic problem golang/go#6853 I can see same on https://github.com/burmilla/docker/tree/test/update-build-scripts where I just took latest build scripts from Moby project so those gets build with later version of Go. That issue can be partly fixed by optimizing build parameters but not fully. |
Also quite visible here in the official stable builds: https://download.docker.com/linux/static/stable/x86_64/ Also from the linked issue, seems that in 1.15 the size could be reduced but as of now moby is on 1.13. |
They are working on to get it updated moby/moby#40353 Also if we start working on this then we probably should target directly to 20.10.x (or even 21.03.x) because major refactoring have been done to Moby on that version (backend code have been removed from Moby used from containerd) and afaiu that work still continues. |
Very good point indeed, changed to 20.10.1 ! Old Size (19.03.14): ~187M
This was just plain 1.13.15 -> 1.15.5 changes, so I believe more can be achieved here |
Following this article here: https://boyter.org/posts/trimming-golang-binary-fat/ -rwxr-xr-x 1 root root 11M Dec 15 14:08 system-containerd*
-rwxr-xr-x 1 root root 2.1M Dec 15 14:08 system-containerd-shim*
-rwxr-xr-x 1 root root 21M Dec 15 14:08 system-ctr*
-rwxr-xr-x 1 root root 25M Dec 15 14:08 system-docker*
-rwxr-xr-x 1 root root 15M Dec 15 14:08 system-dockerd*
-rwxr-xr-x 1 root root 277K Dec 15 14:08 system-docker-init*
-rwxr-xr-x 1 root root 1.6M Dec 15 14:08 system-docker-proxy*
-rwxr-xr-x 1 root root 5.0M Dec 15 14:08 system-runc* Size after UPX compression: ~81M |
Interesting that Docker CLI is bigger than Docker daemon it selves but of course that makes sense as part of logic have been moved to containerd nowadays. This made me thinking that it might possible actually replace "system-docker" with shell script which call "docker" command with needed parameters because boot process does not need it afaik:
Also I think that we do not need "system-docker-containerd-ctr" / "system-ctr" at all and "system-docker-proxy" gets removed during build process on: Lines 33 to 34 in 93de612
What comes to idea to use UPX, system-docker is actually packages inside of initrd which is already compressed so we should check how this affect size of it and iso file: Lines 19 to 27 in 93de612
Also boot time and memory usage are areas which we need follow when we changing these as there is already comment about high CPU usage with too much compression: Lines 47 to 54 in 93de612
|
Yes, I think it is very easy to replace system-docker with a two line bash script in the console image. You are correct did not think about the initrd compression, but I guess if we strip off all unneeded / duplicated executables the resulting size should not exceed the 17.06 build by much |
Hmm. Maybe that is actually best way because if we decide that system-docker and default user docker versions are same then we can:
Only special things needed on that one would be that we need modify settings on here: Lines 361 to 385 in 4e5d248
Then it should (on theory) works similarly like consoles was earlier that default settings will be overridden when user uses |
@dgiebert so how you now build those 20.10.1 binaries? I'm prepairing next 2.0.0 beta version so probably we should include it already and implement those optimizations later. |
The main issue I see with the shared dockerd, would be that an upgrade of the engine would need a reboot. I will try to get a build working today @olljanat |
@olljanat seems like the console is starting and tells started but its not attaching. Do you have a pointer where this could be hanging ? |
@dgiebert can you share those codes which you are now using so it is easier to guess what might be wrong? |
Instead of updating system-docker we should also consider:
|
I finally managed to build working version of system-docker from sources (earlier we have used binary build by Rancher) https://github.com/burmilla/os-system-docker/releases/tag/17.06.107 What I did find out that it is possible to build system-docker even with latest Go version (draft in here) but there is some change done in Go it selves which breaks it in way that runc is not able to start console container anymore.
I think that this would be best long term solution. We can keep size in control by disabling all those optional components https://github.com/containerd/containerd/blob/v1.6.15/BUILDING.md#build-containerd |
It looks to be that replacing system-docker with containerd + nerdctl would need massive refactoring for code from where However https://github.com/balena-os/balena-engine potential drop-in replacement for system-docker so will test it some day. |
Update. Replacing system-docker with balena-engine is simple but looks that new runc version makes system crashing on boot. No matter if that is used with balena or system-docker. Test versions of those exist in https://github.com/burmilla/os/tree/migrate-to-balena and https://github.com/burmilla/os-system-docker/releases/tag/17.06.109 |
No. balena-engine is just minimized version of docker/moby engine (swarm mode is removed, etc) so very similar than how we use system-docker, just based on more modern version of docker and maintained by Balena team (the main reason to which to it).
That is new for me. Will look about it. |
Currently the version is currently pinned to 17.06
The buildsystem the following forks with the main change linked:
Do you want to also create a fork or use patch files instead ?
The text was updated successfully, but these errors were encountered: