diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/files/flanneld.service b/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/files/flanneld.service new file mode 100644 index 0000000000..4e008a0f2c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/files/flanneld.service @@ -0,0 +1,28 @@ +[Unit] +Description=Network fabric for containers +Documentation=https://github.com/coreos/flannel +Wants=etcd.service +Requires=early-docker.service +After=etcd.service early-docker.service +Before=early-docker.target + +[Service] +Type=notify +Environment="TMPDIR=/var/tmp/" +Environment="DOCKER_HOST=unix:///var/run/early-docker.sock" +Environment="FLANNEL_VER={{flannel_ver}}" +LimitNOFILE=1048576 +LimitNPROC=1048576 +ExecStartPre=/usr/bin/mkdir -p /run/flannel + +ExecStart=/usr/libexec/sdnotify-proxy /run/flannel/sd.sock /usr/bin/docker run --net=host --privileged=true --rm -v /run/flannel:/run/flannel -e NOTIFY_SOCKET=/run/flannel/sd.sock quay.io/coreos/flannel:${FLANNEL_VER} /opt/bin/flanneld --ip-masq=true + +# Update docker options +ExecStartPost=/bin/bash -c ' \ + touch /run/docker_opts.env; \ + source /run/docker_opts.env; \ + source /run/flannel/subnet.env; \ + DOCKER_OPTS+=--ip-masq=false \ + DOCKER_OPTS+=$(test -n "$FLANNEL_SUBNET" && echo "--bip=$FLANNEL_SUBNET "); \ + DOCKER_OPTS+=$(test -n "$FLANNEL_MTU" && echo "--mtu=$FLANNEL_MTU "); \ + echo "DOCKER_OPTS=\\"$DOCKER_OPTS\\"" >/run/docker_opts.env' diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/flannel-0.1.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/flannel-0.1.0.ebuild new file mode 120000 index 0000000000..98cd0d968f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/flannel-0.1.0.ebuild @@ -0,0 +1 @@ +flannel-9999.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/flannel-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/flannel-9999.ebuild new file mode 100644 index 0000000000..efbd253d74 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/flannel/flannel-9999.ebuild @@ -0,0 +1,28 @@ +# Copyright (c) 2014 CoreOS, Inc.. All rights reserved. +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +if [[ "${PV}" == 9999 ]]; then + KEYWORDS="~amd64" +else + KEYWORDS="amd64" +fi + +inherit systemd + +DESCRIPTION="flannel" +HOMEPAGE="https://github.com/coreos/flannel" +SRC_URI="" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +RDEPEND="app-admin/sdnotify-proxy" +S="$WORKDIR" + +src_install() { + sed "s/{{flannel_ver}}/${PV}/" "${FILESDIR}"/flanneld.service >"${T}"/flanneld.service + systemd_dounit "${T}"/flanneld.service +} diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/sdnotify-proxy/sdnotify-proxy-0.1.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-admin/sdnotify-proxy/sdnotify-proxy-0.1.0.ebuild new file mode 120000 index 0000000000..e74a1470d7 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/sdnotify-proxy/sdnotify-proxy-0.1.0.ebuild @@ -0,0 +1 @@ +sdnotify-proxy-9999.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/app-admin/sdnotify-proxy/sdnotify-proxy-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-admin/sdnotify-proxy/sdnotify-proxy-9999.ebuild new file mode 100644 index 0000000000..94e9ae1add --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-admin/sdnotify-proxy/sdnotify-proxy-9999.ebuild @@ -0,0 +1,35 @@ +# Copyright (c) 2014 CoreOS, Inc.. All rights reserved. +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 +CROS_WORKON_PROJECT="coreos/sdnotify-proxy" +CROS_WORKON_LOCALNAME="sdnotify-proxy" +CROS_WORKON_REPO="git://github.com" + +if [[ "${PV}" == 9999 ]]; then + KEYWORDS="~amd64" +else + CROS_WORKON_COMMIT="f516129af110fd4a51bd5ea2654f4dc8dd02e5c4" + KEYWORDS="amd64" +fi + +inherit cros-workon + +DESCRIPTION="fleet" +HOMEPAGE="https://github.com/coreos/sdnotify-proxy" +SRC_URI="" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="" + +DEPEND=">=dev-lang/go-1.3" + +src_compile() { + ./build +} + +src_install() { + exeinto /usr/libexec + doexe ${S}/bin/sdnotify-proxy +} diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-9999.ebuild index d6532da271..550ca98c71 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-9999.ebuild @@ -186,6 +186,9 @@ src_install() { systemd_dounit "${FILESDIR}/docker.service" systemd_dounit "${FILESDIR}/docker.socket" + systemd_dounit "${FILESDIR}/early-docker.service" + systemd_dounit "${FILESDIR}/early-docker.socket" + systemd_dounit "${FILESDIR}/early-docker.target" insinto /usr/lib/systemd/network doins "${FILESDIR}"/50-docker{,-veth}.network diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/docker.service b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/docker.service index bf67a07a18..0400e81275 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/docker.service +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/docker.service @@ -1,17 +1,18 @@ [Unit] -Description=Docker Application Container Engine +Description=Docker Application Container Engine Documentation=http://docs.docker.io -Requires=docker.socket -After=docker.socket +After=docker.socket early-docker.target +Requires=docker.socket early-docker.target [Service] Environment="TMPDIR=/var/tmp/" ExecStartPre=/bin/mount --make-rprivate / +EnvironmentFile=-/run/docker_opts.env LimitNOFILE=1048576 LimitNPROC=1048576 # Run docker but don't have docker automatically restart # containers. This is a job for systemd and unit files. -ExecStart=/usr/bin/docker --daemon --storage-driver=btrfs --host=fd:// +ExecStart=/usr/bin/docker --daemon --storage-driver=btrfs --host=fd:// $DOCKER_OPTS [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.service b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.service new file mode 100644 index 0000000000..4770a1e0c3 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.service @@ -0,0 +1,17 @@ +[Unit] +Description=Early Docker Application Container Engine +Documentation=http://docs.docker.io +After=early-docker.socket +Requires=early-docker.socket + +[Service] +Environment="TMPDIR=/var/tmp/" +ExecStartPre=/bin/mount --make-rprivate / +LimitNOFILE=1048576 +LimitNPROC=1048576 +# Run docker but don't have docker automatically restart +# containers. This is a job for systemd and unit files. +ExecStart=/usr/bin/docker --daemon --storage-driver=btrfs --host=fd:// --bridge=none --iptables=false --graph=/var/lib/early-docker --pidfile=/var/run/early-docker.pid + +[Install] +WantedBy=early-docker.target diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.socket b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.socket new file mode 100644 index 0000000000..cc5144e2a2 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.socket @@ -0,0 +1,8 @@ +[Unit] +Description=Early Docker Socket for the API + +[Socket] +ListenStream=/var/run/early-docker.sock + +[Install] +WantedBy=sockets.target diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.target b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.target new file mode 100644 index 0000000000..6872bf33b2 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/early-docker.target @@ -0,0 +1,2 @@ +[Unit] +Description=Run Docker containers before main Docker starts up diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild index cab059acdb..9d501f0762 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild @@ -84,6 +84,7 @@ RDEPEND="${RDEPEND} app-emulation/xenserver-pv-version sys-apps/findutils sys-apps/which + app-admin/flannel app-admin/fleet app-admin/locksmith app-admin/sudo