Skip to content

added basic docker support #1020

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

Closed
wants to merge 2 commits into from
Closed

added basic docker support #1020

wants to merge 2 commits into from

Conversation

umiddelb
Copy link

I've added some switches in the default kernel config which are needed to run docker on the RPi

Kind regards
Uli

@popcornmix
Copy link
Collaborator

There are some options here that concern me. E.g. CONFIG_MEMCG_SWAP

This extension is useful when you want to avoid exhaustion swap but this itself adds more overheads and consumes memory for remembering information. Especially if you use 32bit system or small memory system, please be careful about enabling this.

In general any config changes more intrusive that just adding modules need to be examined carefully. If you could do some testing with and without these options enabled to confirm the impact on memory usage and performance that may help (e.g. check free memory on boot and benchmark like nbench).

I'd also like to know how many users actually want this feature, so if you do then post here.

@Ferroin
Copy link
Contributor

Ferroin commented Jun 11, 2015

IIRC, the overhead from CONFIG_MEMCG_SWAP can be avoided by not enabling it (there is a boot option to disable it at runtime).

I can definitely see the OverlayFS support being generally useful even aside from Docker however.

@umiddelb
Copy link
Author

Hi @popcornmix

thank you for the fast reply, I'll reduce the PR to

  • CONFIG_CPUSETS=y
  • CONFIG_PROC_PID_CPUSET=y
  • CONFIG_DM_BIO_PRISON=m
  • CONFIG_DM_PERSISTENT_DATA=m
  • CONFIG_DM_THIN_PROVISIONING=m
  • CONFIG_OVERLAY_FS=m

which is considered to be the minimal set of kernel options. I'll test it and refine the PR.

@umiddelb
Copy link
Author

OK, compiled the kernel with this new set of options and refined the PR.

@umiddelb
Copy link
Author

I've run some tests (i.e. time (compile the linux kernel) twice) with both versions
1: rpi-3.18.y
2: rpi-3.18.y with the options enabled mentioned above (scope of the PR)

I haven't found any serious performance impacts, here are the results:
1: 508:09 (445:25, 19:16) and 506:58 (445:44, 19:13)
2: 506:38 (444:41, 19:37) and 507:55 (445:11, 19:52)

@popcornmix
Copy link
Collaborator

Are they results of running time ./nbench ?
What does free -h show after boot before and after?

@umiddelb
Copy link
Author

I've run time sh make_kernel.sh where make_kernel.sh contains:

export KERNEL=kernel
make bcmrpi_defconfig
make clean
make zImage modules dtbs
sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img

Output of free -h directly after having booted the docker enabled kernel:

$ free -h
             total       used       free     shared    buffers     cached
Mem:          482M        75M       407M         0B       9.5M        41M
-/+ buffers/cache:        24M       458M
Swap:          99M         0B        99M

Output of free -h after having compiled the docker enabled kernel:

$ free -h
             total       used       free     shared    buffers     cached
Mem:          482M       467M        15M         0B        29M       377M
-/+ buffers/cache:        59M       423M
Swap:          99M         0B        99M

@stuart-c
Copy link

Hi @popcornmix

It would be handy to get OverlayFS in as well the other bits to allow basic Docker support.

@djmaze
Copy link

djmaze commented Jun 15, 2015

👍 for Docker support on the Pi. Have long been waiting for it. Also +1 on OverlayFS, since from my experience it is the fastest and least problematic graph driver for Docker.

@juliancheal
Copy link

👍

@popcornmix
Copy link
Collaborator

ping @pelwell @P33M for comments

@kennethlimcp
Copy link

👍

@ubergesundheit
Copy link

Docker support? OverlayFS? Count me in!
+1 very much!

@pelwell
Copy link
Contributor

pelwell commented Jun 16, 2015

I'm not against Docker and OverlayFS in principal, provided it doesn't penalise non-users.

Can someone outline their reasons for wanting it?

@umiddelb
Copy link
Author

As far as I have run the test, I haven't seen any signs of penalisation. Only two options are included as non-module (CONFIG_CPUSETS, CONFIG_PROC_PID_CPUSET).

The kernel documentation says about cpusets:
...
"The implementation of cpusets requires a few, simple hooks into the rest of the kernel, none in performance critical paths:"
...

@umiddelb
Copy link
Author

There are many articles reasoning for running docker on the RPi

@stuart-c
Copy link

OverlayFS is also useful outside of Docker - being able to merge say a USB drive and the SD/eMMC so you can protect important system software on a RO partition/device but still allow full write access

@pelwell
Copy link
Contributor

pelwell commented Jun 17, 2015

Can you squash these down to one commit?

@umiddelb
Copy link
Author

opened a new PR with one single commit

@umiddelb umiddelb closed this Jun 17, 2015
@pelwell
Copy link
Contributor

pelwell commented Jun 17, 2015

FYI you could have used git push -f to replace the two commits with the squashed one.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jun 19, 2015
See: raspberrypi/linux#1020

kernel: BCM270x_DT: Default Compute Module i2c, i2s and spi support

kernel: bcm2835-sdhost: Improve error handling and recovery
See: https://discourse.osmc.tv/t/test-new-raspberry-pi-sd-card-driver/5058/46

firmware: arm_loader: Only add arm/vc i2c aliases if exactly one camera port
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jun 19, 2015
See: raspberrypi/linux#1020

kernel: BCM270x_DT: Default Compute Module i2c, i2s and spi support

kernel: bcm2835-sdhost: Improve error handling and recovery
See: https://discourse.osmc.tv/t/test-new-raspberry-pi-sd-card-driver/5058/46

firmware: arm_loader: Only add arm/vc i2c aliases if exactly one camera port
@umiddelb
Copy link
Author

IIRC, the overhead from CONFIG_MEMCG_SWAP can be avoided by not enabling it (there is a boot option to disable it at runtime).

Even if you compile the kernel with CONFIG_MEMCG_SWAP, it is disabled anyway during boot.

neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this pull request Feb 27, 2017
See: raspberrypi/linux#1020

kernel: BCM270x_DT: Default Compute Module i2c, i2s and spi support

kernel: bcm2835-sdhost: Improve error handling and recovery
See: https://discourse.osmc.tv/t/test-new-raspberry-pi-sd-card-driver/5058/46

firmware: arm_loader: Only add arm/vc i2c aliases if exactly one camera port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants