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

[build]: enable docker in ram option for small disk device #3279

Merged
merged 9 commits into from
Aug 7, 2019

Conversation

lguohan
Copy link
Collaborator

@lguohan lguohan commented Aug 4, 2019

- What I did
when device disk is small, do not unzip dockerfs.tar.gz on disk.
keep the tar file on the disk, unzip to tmpfs in the initrd phase.

- How I did it

- How to verify it
Test matrix

  • bin file. sonic upgrade. (ok)
  • bin file. onie installation. (ok)
  • swi file. sonic upgrade. (ok)
  • swi file. sonic conversion. (vfat disk) (ok)
  • swi file. sonic conversion. (ext4 disk) (ok)
  • install two images on disk. (ok)

without docker in ram, disk consumption is 875M

admin@sonic:/host/image-20181130.20$ sudo du -d 1 -h
8.3M    ./platform
8.0K    ./work
6.2M    ./rw
582M    ./docker
30M     ./boot
875M    .

with docker in ram, disk consumption is 562M, this include telemetry docker.

cadmin@sonic:/host$ cd image-HEAD.541-dirty-20190804.091sudo du -d 1 -h
11M     ./platform
8.0K    ./work
8.7M    ./rw
30M     ./boot
562M    .
admin@sonic:/host/image-HEAD.541-dirty-20190804.091734$ docker images
REPOSITORY                 TAG                              IMAGE ID            CREATED             SIZE
docker-syncd-brcm          HEAD.541-dirty-20190804.091734   f06f2b992d9e        21 hours ago        391MB
docker-syncd-brcm          latest                           f06f2b992d9e        21 hours ago        391MB
docker-lldp-sv2            HEAD.541-dirty-20190804.091734   a25b83d10f62        21 hours ago        298MB
docker-lldp-sv2            latest                           a25b83d10f62        21 hours ago        298MB
docker-fpm-frr             HEAD.541-dirty-20190804.091734   7c42055e0ace        21 hours ago        319MB
docker-fpm-frr             latest                           7c42055e0ace        21 hours ago        319MB
docker-teamd               HEAD.541-dirty-20190804.091734   880bebc8f16a        21 hours ago        302MB
docker-teamd               latest                           880bebc8f16a        21 hours ago        302MB
docker-dhcp-relay          HEAD.541-dirty-20190804.091734   c4d9f66d844c        21 hours ago        289MB
docker-dhcp-relay          latest                           c4d9f66d844c        21 hours ago        289MB
docker-database            HEAD.541-dirty-20190804.091734   df769ae4e9c7        21 hours ago        281MB
docker-database            latest                           df769ae4e9c7        21 hours ago        281MB
docker-snmp-sv2            HEAD.541-dirty-20190804.091734   f98675454a52        21 hours ago        312MB
docker-snmp-sv2            latest                           f98675454a52        21 hours ago        312MB
docker-orchagent           HEAD.541-dirty-20190804.091734   6e35072f7506        21 hours ago        321MB
docker-orchagent           latest                           6e35072f7506        21 hours ago        321MB
docker-sonic-telemetry     HEAD.541-dirty-20190804.091734   91e05ca6d2c2        22 hours ago        304MB
docker-sonic-telemetry     latest                           91e05ca6d2c2        22 hours ago        304MB
docker-router-advertiser   HEAD.541-dirty-20190804.091734   0293aeb9886d        22 hours ago        281MB
docker-router-advertiser   latest                           0293aeb9886d        22 hours ago        281MB
docker-platform-monitor    HEAD.541-dirty-20190804.091734   1a073860315d        22 hours ago        325MB
docker-platform-monitor    latest                           1a073860315d        22 hours ago        325MB
admin@sonic:/host/image-HEAD.541-dirty-20190804.091734$ docker ps -a
CONTAINER ID        IMAGE                             COMMAND                  CREATED             STATUS                          PORTS               NAMES
5020d833bc4b        docker-orchagent:latest           "/usr/bin/supervisord"   9 seconds ago       Up 7 seconds                                        swss
9df3b9713449        docker-syncd-brcm:latest          "/usr/bin/supervisord"   2 minutes ago       Exited (0) About a minute ago                       syncd
5c0b37356217        docker-dhcp-relay:latest          "/usr/bin/docker_ini…"   2 minutes ago       Exited (0) 33 seconds ago                           dhcp_relay
4570a6d69e0a        docker-snmp-sv2:latest            "/usr/bin/supervisord"   2 minutes ago       Exited (0) 23 seconds ago                           snmp
98ce330f6966        docker-teamd:latest               "/usr/bin/supervisord"   2 minutes ago       Exited (0) 31 seconds ago                           teamd
d046ae5fad2b        docker-router-advertiser:latest   "/usr/bin/supervisord"   2 minutes ago       Exited (0) 32 seconds ago                           radv
7c8d0836dd7d        docker-fpm-frr:latest             "/usr/bin/supervisord"   6 minutes ago       Up 6 minutes                                        bgp
2b3caf8b4154        docker-lldp-sv2:latest            "/usr/bin/supervisord"   6 minutes ago       Up 6 minutes                                        lldp
8e1bee2bcb11        docker-platform-monitor:latest    "/usr/bin/docker_ini…"   6 minutes ago       Up 6 minutes                                        pmon
05c3c4c105e4        docker-sonic-telemetry:latest     "/usr/bin/supervisord"   6 minutes ago       Up 6 minutes                                        telemetry
5264952122c6        docker-database:latest            "/usr/bin/supervisord"   7 minutes ago       Up 7 minutes                                        database

two images.

root@sonic:/host/image-HEAD.556-dirty-20190805.184753# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           396M   11M  385M   3% /run
root-overlay    1.9G  1.5G  272M  85% /
/dev/sda1       1.9G  1.5G  272M  85% /host
tmpfs           800M  669M  132M  84% /var/lib/docker
tmpfs           128M  2.0M  127M   2% /var/log
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup

root@sonic:/host/image-HEAD.556-dirty-20190805.184753# sonic_installer list
Current: SONiC-OS-HEAD.556-dirty-20190805.184753
Next: SONiC-OS-HEAD.556-dirty-20190805.184753
Available: 
SONiC-OS-20181130.32
SONiC-OS-HEAD.556-dirty-20190805.184753

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

when device disk is small, do not unzip dockerfs.tar.gz on disk.
keep the tar file on the disk, unzip to tmpfs in the initrd phase.

Signed-off-by: Guohan Lu <gulv@microsoft.com>
Signed-off-by: Guohan Lu <gulv@microsoft.com>
@lguohan lguohan requested a review from qiluo-msft August 4, 2019 07:29
Signed-off-by: Guohan Lu <gulv@microsoft.com>
Signed-off-by: Guohan Lu <gulv@microsoft.com>
Signed-off-by: Guohan Lu <gulv@microsoft.com>
@lguohan lguohan marked this pull request as ready for review August 6, 2019 00:05
@lguohan
Copy link
Collaborator Author

lguohan commented Aug 6, 2019

retest this please

Signed-off-by: Guohan Lu <gulv@microsoft.com>
files/Aboot/boot0.j2 Outdated Show resolved Hide resolved
Signed-off-by: Guohan Lu <gulv@microsoft.com>
@lguohan lguohan merged commit 2b28d55 into sonic-net:master Aug 7, 2019
lguohan added a commit that referenced this pull request Aug 7, 2019
when device disk is small, do not unzip dockerfs.tar.gz on disk.
keep the tar file on the disk, unzip to tmpfs in the initrd phase.

enabled this for 7050-qx32

Signed-off-by: Guohan Lu <gulv@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants