diff --git a/.gitignore b/.gitignore index 648bad2..b33ba5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /cri-o-c57530e.tar.gz +/cni-98ff61a.tar.gz +/cri-o-36dfef5.tar.gz diff --git a/ocid-network.sysconfig b/ocid-network.sysconfig new file mode 100644 index 0000000..b29b90a --- /dev/null +++ b/ocid-network.sysconfig @@ -0,0 +1,3 @@ +# /etc/sysconfig/ocid-network + +CNI_PATH="/usr/libexec/ocid/cni" diff --git a/ocid-storage.sysconfig b/ocid-storage.sysconfig new file mode 100644 index 0000000..814907f --- /dev/null +++ b/ocid-storage.sysconfig @@ -0,0 +1 @@ +# /etc/sysconfig/ocid-storage diff --git a/ocid.service b/ocid.service new file mode 100644 index 0000000..867d992 --- /dev/null +++ b/ocid.service @@ -0,0 +1,25 @@ +[Unit] +Description=Open Container Initiative Daemon +Documentation=https://github.com/kubernetes-incubator/cri-o +After=network.target + +[Service] +Type=notify +EnvironmentFile=-/etc/sysconfig/ocid-storage +EnvironmentFile=-/etc/sysconfig/ocid-network +Environment=GOTRACEBACK=crash +Environment=CNI_PATH=/usr/libexec/ocid/cni +ExecStart=/usr/bin/ocid --config /etc/ocid/ocid.conf \ + $OCID_STORAGE_OPTIONS \ + $OCID_NETWORK_OPTIONS \ +ExecReload=/bin/kill -s HUP $MAINPID +TasksMax=8192 +LimitNOFILE=1048576 +LimitNPROC=1048576 +LimitCORE=infinity +TimeoutStartSec=0 +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target + diff --git a/ocid.spec b/ocid.spec index 89e7d83..2019247 100644 --- a/ocid.spec +++ b/ocid.spec @@ -25,27 +25,44 @@ # https://github.com/kubernetes-incubator/cri-o %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} -%global commit c57530eb4769fbc2c91d89e7d5ce48a740f812ee -%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commit0 36dfef541662bfc6a7fccc10172820696a3b5af5 +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) + +%global git1 https://github.com/containernetworking/cni +%global commit1 98ff61aac32dcf2eb3044a0d5e5f1814837b3c75 +%global shortcommit1 %(c=%{commit1}; echo ${c:0:7}) + Name: ocid Version: 0 -Release: 0.3.git%{shortcommit}%{?dist} +Release: 0.4.git%{shortcommit0}%{?dist} Summary: OCI-based implementation of Kubernetes Container Runtime Interface License: ASL 2.0 URL: https://%{provider_prefix} -Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +Source0: https://github.com/runcom/ocid-1/archive/%{commit0}/%{repo}-%{shortcommit0}.tar.gz Source1: Godeps.json +Source2: %{git1}/archive/%{commit1}/cni-%{shortcommit1}.tar.gz +Source3: %{name}.service +Source4: %{name}-network.sysconfig +Source5: %{name}-storage.sysconfig # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required #ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}} ExclusiveArch: x86_64 # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} +BuildRequires: btrfs-progs-devel BuildRequires: glib2-devel BuildRequires: glibc-static BuildRequires: go-md2man +BuildRequires: gpgme-devel +BuildRequires: libassuan-devel +BuildRequires: libseccomp-static BuildRequires: pkgconfig(systemd) +BuildRequires: device-mapper-devel +Requires(pre): container-selinux +Requires: runc +Provides: %{repo} = %{version}-%{release} %description %{summary} @@ -394,16 +411,28 @@ providing packages with %{import_path} prefix. %endif %prep -%setup -q -n %{repo}-%{commit} +%setup -q -n %{name}-1-%{commit0} cp %{SOURCE1} . +cp %{SOURCE3} contrib/systemd/. + +tar zxf %{SOURCE2} %build make all +pushd cni-%{commit1} +./build + %install %make_install %make_install install.systemd +install -p -m 755 cni-%{commit1}/bin/* %{buildroot}%{_libexecdir}/%{name} + +install -dp %{buildroot}%{_sysconfdir}/sysconfig +install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-network +install -p -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-storage + # source codes for building projects %if 0%{?with_devel} install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ @@ -443,6 +472,13 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %endif +%{buildroot}%{_bindir}/%{name} --conmon %{_libexecdir}/%{name}/conmon --listen \ +%{_localstatedir}/run/%{name}.sock --runtime %{_bindir}/runc --root %{_sharedstatedir}/containers/%{name} \ +--runroot %{_localstatedir}/run/containers/%{name} --seccomp-profile \ +%{_sysconfdir}/%{name}/seccomp.json --cni-config-dir \ +%{_sysconfdir}/cni/net.d --storage-driver=devmapper config > \ +%{buildroot}%{_sysconfdir}/%{name}/%{name}.conf + %preun %systemd_preun %{name} @@ -469,16 +505,24 @@ export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} %license LICENSE %doc README.md Godeps.json %{_bindir}/%{name} +%{_bindir}/kpod %{_bindir}/ocic +%{_mandir}/man1/kpod* %{_mandir}/man5/%{name}.conf.5* %{_mandir}/man8/%{name}.8* -%{_sysconfdir}/%{name}.conf -%dir %{_libexecdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%config(noreplace) %{_sysconfdir}/%{name}/seccomp.json +%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-storage +%config(noreplace) %{_sysconfdir}/sysconfig/%{name}-network %{_libexecdir}/%{name}/* %{_unitdir}/%{name}.service %changelog +* Wed Dec 21 2016 Lokesh Mandvekar - 0-0.4.git36dfef5 +- built runcom/alpha commit 36dfef5 +- cni bundled for now + * Thu Dec 15 2016 Lokesh Mandvekar - 0-0.3.gitc57530e - Resolves: #1392977 - first upload to Fedora - add build deps, enable only for x86_64 (doesn't build on i686) diff --git a/sources b/sources index 34fde2d..4830d6f 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (cri-o-c57530e.tar.gz) = 0ff4fcf16e293d1909fff3d21c5abcbe7bf90658708689a7bfeb864e6a97498195fc9c91d0dac515ad787fc30c556a8d71671b5c7a320ad21bd9755413108105 +SHA512 (cni-98ff61a.tar.gz) = 7ab7b3613819e6aa34660d578bb5bf584ef3b917e17baaf36ded26270a8f5a780750c35e889d28fde8fbd523d2e4a739129d0a69ae9720d5cceed366553cf014 +SHA512 (cri-o-36dfef5.tar.gz) = 5d7030f31ba218c81730092d261e1b533c9259dbb1e1780b84c049f8f4376b2c280b616ee28f8dc0645171104c2ab88611d0dbf49ac2b9576353fee39c48f9f8