From 9400e1d2a6504d96c354876b7c76c7a2061b404c Mon Sep 17 00:00:00 2001 From: Chris Friesen Date: Wed, 17 Jun 2020 19:39:25 -0400 Subject: [PATCH] switch to containerd.service file from upstream Back when the containerd package was first added to the build, the designer who added it didn't realize that the upstream source already contained a "containerd.service" file and so they added a separate one. It turns out that the upstream source *does* have a service file, and it also contains some additional settings that we might want to pick up. Furthermore, there are additional changes in more recent versions of the package. As such, we want to switch to use the service file from the upstream source instead of a custom one. The upstream service file wants to run /usr/local/bin/containerd so we just make a symlink at that location pointing to the current binary location. Closes-Bug: 1884111 Change-Id: I5ed4f46a7bcceb0d0f71abb26590160fb62c0b7b Signed-off-by: Chris Friesen --- kubernetes/containerd/centos/build_srpm.data | 2 +- kubernetes/containerd/centos/containerd.spec | 6 ++++-- .../centos/files/containerd.service | 19 ------------------- 3 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 kubernetes/containerd/centos/files/containerd.service diff --git a/kubernetes/containerd/centos/build_srpm.data b/kubernetes/containerd/centos/build_srpm.data index 8d6c76f6f..e35b342de 100644 --- a/kubernetes/containerd/centos/build_srpm.data +++ b/kubernetes/containerd/centos/build_srpm.data @@ -3,4 +3,4 @@ COPY_LIST="${STX_BASE}/downloads/containerd-v1.3.3.tar.gz ${STX_BASE}/downloads/crictl-v1.18.0-linux-amd64.tar.gz ${FILES_BASE}/*" -TIS_PATCH_VER=1 +TIS_PATCH_VER=2 diff --git a/kubernetes/containerd/centos/containerd.spec b/kubernetes/containerd/centos/containerd.spec index f6513e22b..62e7cd825 100644 --- a/kubernetes/containerd/centos/containerd.spec +++ b/kubernetes/containerd/centos/containerd.spec @@ -12,7 +12,6 @@ Source0: containerd-v%{version}.tar.gz Source1: runc-1.0.0-rc10.tar.gz Source2: crictl-v1.18.0-linux-amd64.tar.gz Source3: crictl.yaml -Source4: containerd.service Patch5: 0001-customize-containerd-for-StarlingX.patch Patch6: 0002-archive-skip-chmod-IsNotExist-error.patch URL: https://www.starlingx.io @@ -76,6 +75,8 @@ popd # install containerd install -d %{buildroot}%{_bindir} install -p -m 755 %{CONTAINERD_DIR}/bin/containerd %{buildroot}%{_bindir}/containerd +install -d %{buildroot}%{_prefix}/local/bin +ln -s %{_bindir}/containerd %{buildroot}%{_prefix}/local/bin/containerd install -p -m 755 %{CONTAINERD_DIR}/bin/containerd-shim %{buildroot}%{_bindir}/containerd-shim install -p -m 755 %{CONTAINERD_DIR}/bin/containerd-shim-runc-v1 %{buildroot}%{_bindir}/containerd-shim-runc-v1 install -p -m 755 %{CONTAINERD_DIR}/bin/containerd-shim-runc-v2 %{buildroot}%{_bindir}/containerd-shim-runc-v2 @@ -86,10 +87,11 @@ install -p -m 755 %{_builddir}/src/crictl %{buildroot}%{_bindir}/crictl install -d %{buildroot}%{_sysconfdir} install -m 644 %{_sourcedir}/crictl.yaml %{buildroot}%{_sysconfdir}/crictl.yaml install -d %{buildroot}%{_unitdir} -install -p -m 644 %{_sourcedir}/containerd.service %{buildroot}%{_unitdir}/containerd.service +install -p -m 644 %{CONTAINERD_DIR}/containerd.service %{buildroot}%{_unitdir}/containerd.service # list files owned by the package here %files +%{_prefix}/local/bin/containerd %{_bindir}/containerd %{_bindir}/containerd-shim %{_bindir}/containerd-shim-runc-v1 diff --git a/kubernetes/containerd/centos/files/containerd.service b/kubernetes/containerd/centos/files/containerd.service deleted file mode 100644 index 2902a7022..000000000 --- a/kubernetes/containerd/centos/files/containerd.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=containerd container runtime -Documentation=https://containerd.io -After=network.target - -[Service] -ExecStartPre=-/sbin/modprobe overlay -ExecStart=/usr/bin/containerd -KillMode=process -Delegate=yes -LimitNOFILE=1048576 -# Having non-zero Limit*s causes performance problems due to accounting overhead -# in the kernel. We recommend using cgroups to do container-local accounting. -LimitNPROC=infinity -LimitCORE=infinity -TasksMax=infinity - -[Install] -WantedBy=multi-user.target