diff options
-rw-r--r-- | PKGBUILD | 43 | ||||
-rw-r--r-- | cc-oci-runtime.install | 40 |
2 files changed, 81 insertions, 2 deletions
@@ -4,8 +4,20 @@ pkgname=cc-oci-runtime pkgver=2.1.0 __postfix_ver="-rc.3" +__clear_img_ver=12000 +__clear_img=clear-${__clear_img_ver}-containers +__clear_kernel_rpm=linux-container-4.5-50.x86_64.rpm +__clear_oci_rpm_sha=8c8b25e15101a04ed758ba486fc8be8076e40d7f-12 +__clear_oci_rpm=cc-oci-runtime-${__clear_oci_rpm_sha}.x86_64.rpm +__clear_oci_rpm_extras=cc-oci-runtime-extras-${__clear_oci_rpm_sha}.x86_64.rpm +__clear_oci_rpm_data=cc-oci-runtime-data-${__clear_oci_rpm_sha}.x86_64.rpm +__clear_oci_rpm_config=cc-oci-runtime-config-${__clear_oci_rpm_sha}.x86_64.rpm +__clear_oci_rpm_bin=cc-oci-runtime-bin-${__clear_oci_rpm_sha}.x86_64.rpm +__cc_oci_runtime=linux-container-4.5-50.x86_64.rpm +__cl_url=https://download.clearlinux.org/releases/${__clear_img_ver}/clear pkgrel=1 pkgdesc="Intel Clear Containers runtime" +install=${pkgname}.install arch=(x86_64) url="https://clearlinux.org" license=('GPLv2') @@ -14,11 +26,26 @@ makedepends=('go' 'glib2' 'libmnl' 'check' + 'sed' 'bash-bats' 'gcc') checkdepends=('valgrind') -source=(https://github.com/01org/cc-oci-runtime/archive/${pkgver}${__postfix_ver}.tar.gz) -sha1sums=('a0d3ec7afbdee60623eb2b1edc82f3615c6b767b') +source=("https://github.com/01org/cc-oci-runtime/archive/${pkgver}${__postfix_ver}.tar.gz" + "${__cl_url}/${__clear_img}.img.xz" + "${__cl_url}/x86_64/os/Packages/${__clear_kernel_rpm}" + "${__cl_url}/x86_64/os/Packages/${__clear_oci_rpm_extras}" + "${__cl_url}/x86_64/os/Packages/${__clear_oci_rpm_data}" + "${__cl_url}/x86_64/os/Packages/${__clear_oci_rpm_config}" + # "${__cl_url}/x86_64/os/Packages/${__clear_oci_rpm_bin}" + "${__cl_url}/x86_64/os/Packages/${__clear_oci_rpm}" +) +sha1sums=('a0d3ec7afbdee60623eb2b1edc82f3615c6b767b' + 'c78fa07966bc0a01f810d4759534a17895a1ee3d' + '4653cbdac9530620e04dc10f94f26c4d1ea9ea7a' + '33528235696954d7809838d342417fce821a747b' + '612841ee658b9feb60b4d661015ee0fa074041f3' + '11f6a756a6348e321ed6f595863e6abff2a1bcb9' + '5c78daf0644abbb43804041a5496f43d8d10803f') build() { export GOPATH=$PWD @@ -42,6 +69,18 @@ check() { } package() { + mv usr $pkgdir + mv ${__clear_img}.img $pkgdir/usr/share/clear-containers/ + __DIR=$PWD + cd $pkgdir/usr/share/clear-containers/ + ln -s clear-12000-containers.img clear-containers.img + cd $__DIR cd "$GOPATH/src/github.com/01org/cc-oci-runtime" make DESTDIR="$pkgdir/" install + sed -i \ + 's#/usr/var/lib/cc-oci-runtime/data/image/#/usr/share/clear-containers/#g' \ + $pkgdir/usr/share/defaults/cc-oci-runtime/vm.json + sed -i \ + 's#/usr/var/lib/cc-oci-runtime/data/kernel/#/usr/share/clear-containers/#g' \ + $pkgdir/usr/share/defaults/cc-oci-runtime/vm.json } diff --git a/cc-oci-runtime.install b/cc-oci-runtime.install new file mode 100644 index 000000000000..a37827f2e745 --- /dev/null +++ b/cc-oci-runtime.install @@ -0,0 +1,40 @@ +# $Id$ +# Maintainer: John Andersen <johnandersenpdx@gmail.com> + +post_install() { + cat << EOF +You need to enable the Clear Containers runtime by adding it to the docker +daemons command line options. To do this you need to make an override file for +the systemd service that starts docker. Only add the --default-runtime if you +want to always use the cc-oci-runtime instead of runc by default. + +$ sudo mkdir -p /etc/systemd/system/docker.service.d/ +$ sudo vi /etc/systemd/system/docker.service.d/override.conf + +[Service] +ExecStart= +ExecStart=/usr/bin/dockerd -D --add-runtime cor=/usr/bin/cc-oci-runtime \ + --default-runtime=cor + +$ sudo systemctl daemon-reload +$ sudo systemctl restart docker +$ sudo systemctl enable cc-proxy.socket +$ sudo systemctl start cc-proxy.socket + +If you are running a recent enough kernel (4.3+), you should consider +increasing the TasksMax= systemd setting. Without this, the number of Clear +Containers you are able to run will be limited. + +Run the commands below and if they display OK, proceed, else skip this section: + +$ grep -q ^pids /proc/cgroups && echo OK +Assuming you got an OK: + +$ cd /etc/systemd/system/docker.service.d/ +$ sudo vi /etc/systemd/system/docker.service.d/clr-containers.conf + +[Service] +# Allow maximum number of containers to run. +TasksMax=infinity +EOF +} |