From dc643097bb44b7f6bd17cdb68092fa0eae463583 Mon Sep 17 00:00:00 2001 From: Wei Fu Date: Wed, 31 Oct 2018 19:54:08 +0800 Subject: [PATCH] tools: remove package builder from pouch When we release pouch to yum/apt source, always needs to update builder script. It will change the git commit id. Sometimes, the changes doesn't belongs to the release version. Based on this case, using other repo to handle the package builder is better than current one. Signed-off-by: Wei Fu --- hack/build | 118 ------ hack/make.sh | 363 ------------------ hack/package/README.md | 46 --- hack/package/deb/Makefile | 71 ---- hack/package/deb/build.sh | 47 --- hack/package/deb/debian/compat | 1 - hack/package/deb/debian/control | 29 -- hack/package/deb/debian/docs | 1 - hack/package/deb/debian/pouch.default | 10 - hack/package/deb/debian/pouch.init | 120 ------ hack/package/deb/debian/pouch.postinst | 21 - hack/package/deb/debian/rules | 2 - hack/package/deb/systemd/pouch.service | 28 -- .../deb/ubuntu-xenial/Dockerfile.x86_64 | 57 --- hack/package/package.sh | 69 ---- hack/package/rpm/build.sh | 128 ------ hack/package/rpm/centos-7/Dockerfile.x86_64 | 48 --- hack/package/rpm/scripts/after-install.sh | 19 - hack/package/rpm/scripts/after-remove.sh | 10 - hack/package/rpm/scripts/after-trans.sh | 8 - hack/package/rpm/scripts/before-install.sh | 8 - hack/package/rpm/scripts/before-remove.sh | 6 - hack/package/rpm/service/pouch-lxcfs.service | 16 - hack/package/rpm/service/pouch.service | 29 -- 24 files changed, 1255 deletions(-) delete mode 100755 hack/build delete mode 100755 hack/make.sh delete mode 100644 hack/package/README.md delete mode 100644 hack/package/deb/Makefile delete mode 100755 hack/package/deb/build.sh delete mode 100644 hack/package/deb/debian/compat delete mode 100644 hack/package/deb/debian/control delete mode 100644 hack/package/deb/debian/docs delete mode 100644 hack/package/deb/debian/pouch.default delete mode 100644 hack/package/deb/debian/pouch.init delete mode 100644 hack/package/deb/debian/pouch.postinst delete mode 100644 hack/package/deb/debian/rules delete mode 100644 hack/package/deb/systemd/pouch.service delete mode 100644 hack/package/deb/ubuntu-xenial/Dockerfile.x86_64 delete mode 100755 hack/package/package.sh delete mode 100755 hack/package/rpm/build.sh delete mode 100644 hack/package/rpm/centos-7/Dockerfile.x86_64 delete mode 100644 hack/package/rpm/scripts/after-install.sh delete mode 100644 hack/package/rpm/scripts/after-remove.sh delete mode 100644 hack/package/rpm/scripts/after-trans.sh delete mode 100644 hack/package/rpm/scripts/before-install.sh delete mode 100644 hack/package/rpm/scripts/before-remove.sh delete mode 100644 hack/package/rpm/service/pouch-lxcfs.service delete mode 100644 hack/package/rpm/service/pouch.service diff --git a/hack/build b/hack/build deleted file mode 100755 index 2348345ac..000000000 --- a/hack/build +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -set -e -BUILDPATH=/tmp/pouchbuild - -DIR="$( cd "$( dirname "$0" )/.." && pwd )" -cd $DIR/ -GOPATH=$BUILDPATH - - -# Go parameters -VERSION="1.0.0" -APIVERSION="1.24" -GITCOMMIT=$(git describe --dirty --always --tags 2> /dev/null || true) -BUILDTIME=$(date --rfc-3339 s 2> /dev/null | sed -e 's/ /T/') -PKG=github.com/alibaba/pouch -GOBUILD="go build" -GOLDFLAGS="-X $PKG/version.GitCommit=${GITCOMMIT} -X $PKG/version.Version=${VERSION} -X $PKG/version.ApiVersion=${APIVERSION} -X $PKG/version.BuildTime=$BUILDTIME" - -# Binary name of CLI and Daemon -BINARY_NAME=pouchd -CLI_BINARY_NAME=pouch - -function pre() -{ - mkdir -p $BUILDPATH - - mkdir -p $BUILDPATH/src/github.com/alibaba - [ -L $BUILDPATH/src/github.com/alibaba/pouch ] && rm -f $BUILDPATH/src/github.com/alibaba/pouch - ln -s $DIR $BUILDPATH/src/github.com/alibaba/pouch -} - -function server() -{ - cd $BUILDPATH/src/github.com/alibaba/pouch - echo "GOOS=linux $GOBUILD -o $BINARY_NAME" - GOOS=linux $GOBUILD -ldflags "${GOLDFLAGS}" -o $BINARY_NAME -tags 'selinux' -} - -function client() -{ - cd $BUILDPATH/src/github.com/alibaba/pouch - echo "$GOBUILD -o $CLI_BINARY_NAME github.com/alibaba/pouch/cli" - $GOBUILD -o $CLI_BINARY_NAME github.com/alibaba/pouch/cli -} - -# -# Do not calculate the coverage for the following pkgs -# -SKIP_PKGS=(\ - "github.com/alibaba/pouch/vendor" \ - "github.com/alibaba/pouch/test" \ - "github.com/alibaba/pouch/apis/types" \ - "github.com/alibaba/pouch/cri/config" \ - "github.com/alibaba/pouch/storage/volume/examples/demo" \ - "github.com/alibaba/pouch/storage/volume/types" \ -) - -function testserver() -{ - cd $BUILDPATH/src/github.com/alibaba/pouch - cmd="go list ./... " - for j in $(seq 0 $(( ${#SKIP_PKGS[@]} -1)) ); do - cmd+="| grep -v \"${SKIP_PKGS[$j]}\" " - done - - pkgs=$(eval $cmd |grep -v 'github.com/alibaba/pouch/cli' | tr '\n' ','|sed 's/,$//g') - - go test -c -race -cover -covermode=atomic -o pouchd-test -coverpkg $pkgs -} - -function vet() -{ - cd $BUILDPATH/src/github.com/alibaba/pouch - GOPACKAGES=`go list ./... | grep -v /vendor/ | sed 's/^_//'` - go vet $GOPACKAGES 2>&1 | grep -v "unrecognized printf verb 'r'" | egrep -v "exit status 1" | tee /dev/stderr -} - -function unit-test() -{ - cd $BUILDPATH/src/github.com/alibaba/pouch - go test -i - - cmd="go list ./... " - for j in $(seq 0 $(( ${#SKIP_PKGS[@]} -1)) ); do - cmd+="| grep -v \"${SKIP_PKGS[$j]}\" " - done - - for d in $(eval $cmd |grep -vw '^github.com/alibaba/pouch$' ) - do - go test -race -coverprofile=profile.out -covermode=atomic $d - if [ -f profile.out ] ; then - cat profile.out >> coverage.txt - rm profile.out >/dev/null 2>&1 - fi - done -} - -function clean() -{ - rm -f $BUILDPATH/src/github.com/docker/libnetwork - rm -f $BUILDPATH/src/github.com/alibaba/pouch - rm -rf $BUILDPATH -} - -function main () -{ - if [[ $# < 1 ]]; then - targets="pre" - else - targets=($@) - fi - - for target in ${targets[@]}; do - $target - done -} - -main "$@" diff --git a/hack/make.sh b/hack/make.sh deleted file mode 100755 index 991efe63c..000000000 --- a/hack/make.sh +++ /dev/null @@ -1,363 +0,0 @@ -#!/usr/bin/env bash -set -ex - -# -# This script is used to build pouch binaries and execute pouch tests. -# -TMP=$(mktemp -d /tmp/pouch.XXXXXX) -DIR="$( cd "$( dirname "$0" )/.." && pwd )" -cd "$DIR/" - -# -# Get the version of dependencies from corresponding commands and compare them with the required version. -# If they don't meet the requirement, this script will install them. -# -CONTAINERD_VERSION= -REQUIRED_CONTAINERD_VERSION="1.0.3" -RUNC_VERSION= -REQUIRED_RUNC_VERSION="1.0.0-rc4-1" -NSENTER_VERSION= -REQUIRED_NSENTER_VERSION="2.24.1" -DUMB_INIT_VERSION= -REQUIRED_DUMB_INIT_VERSION="1.2.1" - -SOURCEDIR=/go/src/github.com/alibaba/pouch - -IMAGE="registry.hub.docker.com/letty/pouchci:latest" -if [[ $SOURCEDIR != $DIR ]];then - [ -d $SOURCEDIR ] && rm -rf $SOURCEDIR - POUCHTOPDIR=$(dirname $SOURCEDIR) - [ ! -d "$POUCHTOPDIR" ] && mkdir -p "$POUCHTOPDIR" - ln -sf "$DIR/" $SOURCEDIR -fi - -# -# CAL_INTEGRATION_TEST_COVERAGE indicates whehter or not calculate integration test coverage. -# By default it is yes. -# -CAL_INTEGRATION_TEST_COVERAGE=${CAL_INTEGRATION_TEST_COVERAGE:-"yes"} -if [[ $CAL_INTEGRATION_TEST_COVERAGE == "yes" ]]; then - POUCHD="pouchd-test -test.coverprofile=$DIR/integrationcover.out DEVEL" -else - POUCHD="pouchd" -fi - -function get_containerd_version -{ - if which containerd &>/dev/null; then - CONTAINERD_VERSION=$(containerd -v|cut -d " " -f 3|cut -c 2-) - fi -} - -function get_runc_version -{ - if which runc &>/dev/null; then - RUNC_VERSION=$(runc -v|head -1| cut -d " " -f 3) - fi -} - -function get_nsenter_version -{ - if which nsenter &>/dev/null; then - NSENTER_VERSION=$(nsenter -V | cut -d " " -f 4) - fi -} - -function get_dumb_init_version -{ - if which dumb-init &>/dev/null; then - DUMB_INIT_VERSION=$(dumb-init -V 2>&1 | cut -d " " -f 2|cut -c 2-) - fi -} - -function install_containerd -{ - echo "Try installing containerd" - get_containerd_version - if [[ "$CONTAINERD_VERSION" == "$REQUIRED_CONTAINERD_VERSION" ]]; then - echo "Containerd already installed." - else - echo "Download and install containerd." - wget --quiet \ - "https://github.com/containerd/containerd/releases/download/v${REQUIRED_CONTAINERD_VERSION}/containerd-${REQUIRED_CONTAINERD_VERSION}.linux-amd64.tar.gz" -P "$TMP" - tar xf "$TMP/containerd-${REQUIRED_CONTAINERD_VERSION}.linux-amd64.tar.gz" -C "$TMP" && - cp -f "$TMP"/bin/* /usr/local/bin/ - fi; -} - -function install_runc -{ - echo "Try installing runc" - get_runc_version - if [[ "$RUNC_VERSION" == "$REQUIRED_RUNC_VERSION" ]]; then - echo "Runc already installed." - else - echo "Download and install runc." - wget --quiet \ - "https://github.com/alibaba/runc/releases/download/v${REQUIRED_RUNC_VERSION}/runc.amd64" -P /usr/local/bin - chmod +x /usr/local/bin/runc.amd64 - mv /usr/local/bin/runc.amd64 /usr/local/bin/runc - fi; -} - -function install_lxcfs -{ - echo "Try installing lxcfs" - if grep -qi "ubuntu" /etc/issue ; then - apt-get install -y lxcfs - if (( $? != 0 )); then - add-apt-repository ppa:ubuntu-lxc/lxcfs-stable -y - apt-get update - apt-get install -y lxcfs - fi - else - sh -x "$DIR/hack/install_lxcfs_on_centos.sh" - fi -} - -function install_criu -{ - echo "Try installing criu" - if grep -qi "ubuntu" /etc/issue ; then - apt-get update - apt-get install -y criu - fi -} - -# local-persist is a volume plugin -function install_local_persist -{ - echo "Try installing local-persist" - wget --quiet -O /tmp/local-persist \ - https://github.com/CWSpear/local-persist/releases/download/v1.3.0/local-persist-linux-amd64 - chmod +x /tmp/local-persist - mv /tmp/local-persist /usr/local/bin/ -} - -# clean the local-persist -function clean_local_persist -{ - echo "Try cleaning local-persist" - pid=$(pgrep local-persist) - - if [[ $pid ]]; then - echo "Try killing local-persist process" - kill -9 "$pid" - fi - - echo "Try removing local-persist.sock" - rm -rf /var/run/docker/plugins/local-persist.sock -} - -function install_nsenter -{ - echo "Try installing nsenter" - get_nsenter_version - if grep -qi "ubuntu" /etc/issue ; then - if [[ "$NSENTER_VERSION" == "$REQUIRED_NSENTER_VERSION" ]]; then - echo "Nsenter already installed." - else - echo "Download and install nsenter." - apt-get -y install \ - libncurses5-dev \ - libslang2-dev \ - gettext \ - zlib1g-dev \ - libselinux1-dev \ - debhelper \ - lsb-release \ - pkg-config \ - po-debconf \ - autoconf \ - automake \ - autopoint \ - libtool - wget --quiet \ - "https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-${REQUIRED_NSENTER_VERSION}.tar.gz" -P "$TMP" - tar xf "$TMP/util-linux-${REQUIRED_NSENTER_VERSION}.tar.gz" -C "$TMP" && - cd "$TMP/util-linux-${REQUIRED_NSENTER_VERSION}" - ./autogen.sh - autoreconf -vfi - ./configure && make - cp ./nsenter /usr/local/bin - cd "$DIR/" - fi - else - yum install -y util-linux - fi -} - -# Install dumb-init by downloading the binary. -function install_dumb_init -{ - echo "Try installing dumb-init" - get_dumb_init_version - if [[ "$DUMB_INIT_VERSION" == "$REQUIRED_DUMB_INIT_VERSION" ]]; then - echo "Dumb-init already installed." - else - echo "Download and install dumb-init." - wget --quiet -O /tmp/dumb-init \ - "https://github.com/Yelp/dumb-init/releases/download/v${REQUIRED_DUMB_INIT_VERSION}/dumb-init_${REQUIRED_DUMB_INIT_VERSION}_amd64" - mv /tmp/dumb-init /usr/bin/ - chmod +x /usr/bin/dumb-init - fi -} - -# install pouch and essential binaries: containerd, runc and so on -function install_pouch -{ - install_containerd - install_runc - # copy pouch daemon and pouch cli to PATH - echo "Install pouch." - if [[ $CAL_INTEGRATION_TEST_COVERAGE == "yes" ]]; then - cp -f "$DIR/pouchd-test" /usr/local/bin/ - fi - cp -f "$DIR/pouch" "$DIR/pouchd" /usr/local/bin/ - install_lxcfs - install_nsenter - install_criu -} - -function target -{ - case $1 in - check) - docker run --rm -v "$(pwd):$SOURCEDIR" "$IMAGE" bash -c "make check" - ;; - build) - # - # Also build pouchd-test binary if CAL_INTEGRATION_TEST_COVERAGE doesn't - # equal to 'no'. - # - if [[ $CAL_INTEGRATION_TEST_COVERAGE == "yes" ]]; then - docker run --rm -v "$(pwd):$SOURCEDIR" "$IMAGE" \ - bash -c "make testserver" >"$TMP/build.log" || - { echo "make build log:"; cat "$TMP/build.log"; return 1; } - fi - docker run --rm -v "$(pwd):$SOURCEDIR" "$IMAGE" \ - bash -c "make build" >"$TMP/build.log" || - { echo "make build log:"; cat "$TMP/build.log"; return 1; } - - install_pouch >"$TMP/install.log" || - { echo "install pouch log:"; cat "$TMP/install.log"; return 1; } - ;; - unit-test) - docker run --rm -v "$(pwd):$SOURCEDIR" "$IMAGE" \ - bash -c "make unit-test" - ;; - cri-test) - cd $SOURCEDIR - env PATH="$GOROOT/bin:$PATH" "$SOURCEDIR/hack/cri-test/test-cri.sh" - ;; - integration-test) - - install_dumb_init || - echo "Warning: dumb-init install failed!\ - rich container related tests will be skipped" - - docker run --rm -v "$(pwd):$SOURCEDIR" \ - -e GOPATH=/go \ - $IMAGE \ - bash -c "cd test && go test -c -o integration-test" - - install_local_persist - - # start local-persist - echo "start local-persist volume plugin" - local-persist > "$TMP/volume.log" 2 >&1 & - - # start pouch daemon - echo "start pouch daemon" - if stat /usr/bin/lxcfs ; then - $POUCHD --debug --enable-lxcfs=true --add-runtime runv=runv \ - --lxcfs=/usr/bin/lxcfs > "$TMP/log" 2>&1 & - else - $POUCHD --debug --add-runtime runv=runv > "$TMP/log" 2>&1 & - fi - - # wait until pouch daemon is ready - daemon_timeout_time=30 - while true; - do - if pouch version; then - echo "Succeed to start pouch daemon" - break - elif (( $((daemon_timeout_time--)) == 0 ));then - echo "Failed to start pouch daemon" - echo "pouch daemon log:" - cat "$TMP/log" - return 1 - else - sleep 1 - fi - done - - echo "verify pouch version" - pouch version - - # copy tls file - cp -rf "$DIR/test/tls" /tmp/ - - # If test is failed, print pouch daemon log. - set +e - "$DIR/test/integration-test" -test.v -check.v - - if (( $? != 0 )); then - echo "pouch daemon log:" - cat "$TMP/log" - clean_local_persist - return 1 - fi - - clean_local_persist - - set -e - ;; - *) - echo "no such target: $target" - return 1 - ;; - esac -} - - -function main -{ - docker pull $IMAGE - if (( $? != 0 )); then - echo "ERR: pull $IMAGE failed" - exit 1 - fi - - if [[ $# -lt 1 ]]; then - targets="check build unit-test integration-test" - else - targets=($@) - fi - - for target in "${targets[@]}"; do - target "$target" - ret=$? - if (( ret != 0 )); then - return $ret - fi - done - - if [[ $CAL_INTEGRATION_TEST_COVERAGE == "yes" ]]; then - if ! echo "${targets[@]}" | grep -q "integration" ; then - return $ret - fi - # - # kill pouchd-test and get the coverage - # - pkill --signal 3 pouchd-test || echo "no pouchd-test to be killed" - sleep 5 - - tail -1 "$TMP/log" - cat "$DIR/integrationcover.out" >> "$DIR/coverage.txt" - return $ret - fi -} - -main "$@" diff --git a/hack/package/README.md b/hack/package/README.md deleted file mode 100644 index 213faa7fc..000000000 --- a/hack/package/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Building PouchContainer deb and rpm packages - -This file shows how to build PouchContainer packages. - -## Prerequisites - -Firstly, you should install Docker, as we use Docker to build images and run containers to build packages. - -Then, run `date` command to ensure time is right, which is used to set `BuildTime` field. - -To build PouchContainer packages, you should prepare gpg keys and put it in a directory. - -eg: - -```bash -$ tree /root/packages/ - packages - ├── keys - │ ├── gpg - │ └── secretkey -``` - -## Building packages - -Firstly, checkout to the branch and commit id that used to build packages. - -Secondly, run the following command to build PouchContainer packages, in the progress you will be asked to enter passphrase to sign packages. - -What's more, you should pass four parameters as follows: - -- `VERSION`, the version of PouchContainer. - -- `ITERATION`, RPM calls this the 'release', FreeBSD calls it 'PORTREVISION'. Debian calls this 'debian_revision'. This parameter is only used to build rpm package. - -- `KEYDIR`, the directory of gpg keys. - -- `PKGTYPE`, if this parameter is null, we will build rpm and deb packages. You can parse `deb` or `rpm` to build deb or rpm package. - -```bash -cd pouch/ -./hack/package/package.sh 1.0.0 1.el7.centos /root/test rpm - | | | | - VSERSION ITERATION KEYDIR PKGTYPE -``` - -Finally, packages will be output in `/root/packages/package` in this example. diff --git a/hack/package/deb/Makefile b/hack/package/deb/Makefile deleted file mode 100644 index 722f3dad0..000000000 --- a/hack/package/deb/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# Go parameters -GOBUILD=go build -GOCLEAN=go clean -GOTEST=go test -GOPACKAGES=$(shell go list ./... | grep -v /vendor/ | sed 's/^_//') - -# Binary name of CLI and Daemon -BINARY_NAME=pouchd -CLI_BINARY_NAME=pouch - -# Base path used to install pouch & pouchd -DESTDIR=debian/pouch/usr/local/bin/ -TMP=/tmp/tmp.pouch - -.PHONY: build -build: server client - -.PHONY: pre -pre: - @./hack/build pre - -.PHONY: server -server: pre modules - @./hack/build server - -.PHONY: client -client: pre - @./hack/build client - -.PHONY: clean -clean: - $(GOCLEAN) - rm -f $(BINARY_NAME) - rm -f $(CLI_BINARY_NAME) - rm -rf debian/pouch/* - ./hack/build clean - ./hack/module --clean - -#.PHONY: modules -modules: - @./hack/module --add-volume=github.com/alibaba/pouch/storage/volume/modules/tmpfs - @./hack/module --add-volume=github.com/alibaba/pouch/storage/volume/modules/local - -# install binaries -.PHONY: install -install: build - @echo $@ - mkdir -p debian/pouch/usr/bin/ - cp pouch debian/pouch/usr/bin/ - cp pouchd debian/pouch/usr/bin/ - # install containerd - echo "Download and install containerd." - [ -d $(TMP) ] || mkdir -p /tmp/tmp.pouch - wget --quiet https://github.com/containerd/containerd/releases/download/v1.0.3/containerd-1.0.3.linux-amd64.tar.gz -P $(TMP) - tar xf $(TMP)/containerd-1.0.3.linux-amd64.tar.gz -C $(TMP) && cp -f $(TMP)/bin/* debian/pouch/usr/bin/ - - # install runc - echo "Download and install runc." - wget --quiet https://github.com/alibaba/runc/releases/download/v1.0.0-rc4-2/runc.amd64 -P $(TMP)/bin - chmod +x $(TMP)/bin/runc.amd64 - mv $(TMP)/bin/runc.amd64 debian/pouch/usr/bin/runc - - # pouch support 'systemctl' command - mkdir -p debian/pouch/usr/lib/systemd/system/ - cp hack/package/deb/systemd/pouch.service debian/pouch/usr/lib/systemd/system/ - -.PHONY: uninstall -uninstall: - @echo $@ - @rm -f $(addprefix $(DESTDIR)/bin/,$(notdir $(BINARY_NAME))) - @rm -f $(addprefix $(DESTDIR)/bin/,$(notdir $(CLI_BINARY_NAME))) diff --git a/hack/package/deb/build.sh b/hack/package/deb/build.sh deleted file mode 100755 index ebe634cf7..000000000 --- a/hack/package/deb/build.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env sh - -set -e - -DEFAULT_GPG_KEY=${GPGKEY:-"439AE9EC"} -MOUNTDIR=/root/deb -PACKAGEDIR=/root/deb/package/deb/ -BASEDIR=/go/src/github.com/alibaba/pouch - -# prepare files that used to build deb packages -rm -rf $BASEDIR/debian && cp -r $BASEDIR/hack/package/deb/debian $BASEDIR/ -rm -rf $BASEDIR/systemd && cp -r $BASEDIR/hack/package/deb/systemd $BASEDIR/ -rm -f $BASEDIR/Makefile.bak && mv $BASEDIR/Makefile $BASEDIR/Makefile.bak -cp $BASEDIR/hack/package/deb/Makefile $BASEDIR/Makefile - -cd $BASEDIR -debSource="$(awk -F ': ' '$1 == "Source" { print $2; exit }' debian/control)" -debMaintainer="$(awk -F ': ' '$1 == "Maintainer" { print $2; exit }' debian/control)" -debDate="$(date --rfc-2822)" - -cat > "debian/changelog" <<-EOF -$debSource (${VERSION}-0~${DISTRO}) $SUITE; urgency=low - * Version: $VERSION - -- $debMaintainer $debDate -EOF - -# build package -dpkg-buildpackage -uc -us - -# recover Makefile -[ -e $BASEDIR/Makefile.bak ] && mv $BASEDIR/Makefile.bak $BASEDIR/Makefile -mkdir -p $PACKAGEDIR && mv $BASEDIR/../pouch_* $PACKAGEDIR/ - -# import gpg key -gpg --import $MOUNTDIR/keys/gpg -gpg --import $MOUNTDIR/keys/secretkey - -# sign packages -cd $PACKAGEDIR && rm -f Packages.gz Packages -dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz -apt-ftparchive release ./ > Release - -# if you want to use your gpg key, you should replace '439AE9EC' with your key -gpg -abs --default-key "$DEFAULT_GPG_KEY" -o Release.gpg Release -gpg --clearsign --default-key "$DEFAULT_GPG_KEY" -o InRelease Release - -echo "Build deb package successfully! Please get the package in $PACKAGEDIR!" \ No newline at end of file diff --git a/hack/package/deb/debian/compat b/hack/package/deb/debian/compat deleted file mode 100644 index ec635144f..000000000 --- a/hack/package/deb/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/hack/package/deb/debian/control b/hack/package/deb/debian/control deleted file mode 100644 index b05ea829f..000000000 --- a/hack/package/deb/debian/control +++ /dev/null @@ -1,29 +0,0 @@ -Source: pouch -Section: admin -Priority: optional -Maintainer: Pouch -Build-Depends: debhelper (>=9) -Standards-Version: 3.9.6 -Homepage: https://github.com/alibaba/pouch -Vcs-Browser: https://github.com/alibaba/pouch -Vcs-Git: git://github.com/alibaba/pouch.git - -Package: pouch -Architecture: amd64 -Depends: iptables, ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} -Recommends: aufs-tools, - ca-certificates, - cgroupfs-mount | cgroup-lite, - git, - pigz, - xz-utils, - ${apparmor:Recommends} -Description: Pouch is an open-source project created by Alibaba Group to promote the container technology movement. - Pouch's vision is to advance container ecosystem and promote container standards OCI, so that container technologies - become the foundation for application development in the Cloud era. - . - Pouch can pack, deliver and run any application. It provides applications with a lightweight runtime environment with - strong isolation and minimal overhead. Pouch isolates applications from varying runtime environment, and minimizes - operational workload. Pouch minimizes the effort for application developers to write Cloud-native applications, or to - migrate legacy ones to a Cloud platform. - diff --git a/hack/package/deb/debian/docs b/hack/package/deb/debian/docs deleted file mode 100644 index 5c7042d20..000000000 --- a/hack/package/deb/debian/docs +++ /dev/null @@ -1 +0,0 @@ -/go/src/github.com/alibaba/pouch/README.md \ No newline at end of file diff --git a/hack/package/deb/debian/pouch.default b/hack/package/deb/debian/pouch.default deleted file mode 100644 index 231d11c90..000000000 --- a/hack/package/deb/debian/pouch.default +++ /dev/null @@ -1,10 +0,0 @@ -# Defaults for pouch initscript -# sourced by /etc/init.d/pouch -# installed at /etc/default/pouch by the maintainer scripts - -# -# This is a POSIX shell fragment -# - -# Additional options that are passed to the Daemon. -DAEMON_OPTS="" diff --git a/hack/package/deb/debian/pouch.init b/hack/package/deb/debian/pouch.init deleted file mode 100644 index 1affe1aef..000000000 --- a/hack/package/deb/debian/pouch.init +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing. -if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then - set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script -fi -### BEGIN INIT INFO -# Provides: pouch -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Pouch is an open-source project created to promote the container technology movement. -# Description: -# Pouch is an open-source project created by Alibaba Group to promote the container technology movement. -# Pouch's vision is to advance container ecosystem and promote container standards OCI(Open Container Initiative), -# so that container technologies become the foundation for application development in the Cloud era. -# Pouch can pack, deliver and run any application. It provides applications with a lightweight runtime environment -# with strong isolation and minimal overhead. Pouch isolates applications from varying runtime environment, -# and minimizes operational workload. Pouch minimizes the effort for application developers to write Cloud-native -# applications, or to migrate legacy ones to a Cloud platform. -### END INIT INFO - -# Pouch pouch-dev@list.alibaba-inc.com - -export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin - -BASE=pouch - -POUCHD=/usr/bin/pouchd -POUCH_LOGFILE=/var/log/$BASE.log -#POUCH_OPTS=" --enable-lxcfs=true --lxcfs=/usr/bin/lxcfs" -POUCH_OPTS="" -POUCH_DESC="Pouch" - -# Get lsb functions -. /lib/lsb/init-functions - -# Check pouch is present -if [ ! -x $POUCHD ]; then - log_failure_msg "$POUCHD not present or not executable" - exit 1 -fi - -check_init() { - # use upstart to manage pouchd - if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | grep -q upstart; then - log_failure_msg "$POUCH_DESC is managed via upstart, try using service $BASE $1" - exit 1 - fi -} - -fail_unless_root() { - if [ "$(id -u)" != '0' ]; then - log_failure_msg "$POUCH_DESC must be run as root" - exit 1 - fi -} - -case "$1" in - start) - check_init - - fail_unless_root - - touch "$POUCH_LOGFILE" - chgrp pouch "$POUCH_LOGFILE" - - ulimit -n 1048576 - - # Having non-zero limits causes performance problems due to accounting overhead - # in the kernel. We recommend using cgroups to do container-local accounting. - if [ "$BASH" ]; then - ulimit -u unlimited - else - ulimit -p unlimited - fi - - service lxcfs stop - - log_begin_msg "Starting $POUCH_DESC: $BASE" - start-stop-daemon --start --background \ - --no-close \ - --exec "$POUCHD" \ - $POUCH_OPTS \ - >> "$POUCH_LOGFILE" 2>&1 - log_end_msg $? - ;; - - stop) - check_init - fail_unless_root - log_begin_msg "Stopping $POUCH_DESC: $BASE" - start-stop-daemon --stop --exec $POUCHD --retry 10 - log_end_msg $? - ;; - - restart) - check_init - fail_unless_root - service lxcfs stop - $0 stop - $0 start - ;; - - force-reload) - check_init - fail_unless_root - $0 restart - ;; - - status) - check_init - status_of_proc "$POUCHD" "$POUCH_DESC" - ;; - - *) - echo "Usage: service pouch {start|stop|restart|status}" - exit 1 - ;; -esac \ No newline at end of file diff --git a/hack/package/deb/debian/pouch.postinst b/hack/package/deb/debian/pouch.postinst deleted file mode 100644 index 89cf901ca..000000000 --- a/hack/package/deb/debian/pouch.postinst +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# postinst script for pouch - -set -e - -case "$1" in - configure) - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/hack/package/deb/debian/rules b/hack/package/deb/debian/rules deleted file mode 100644 index eac3dd0c3..000000000 --- a/hack/package/deb/debian/rules +++ /dev/null @@ -1,2 +0,0 @@ -%: - dh $@ diff --git a/hack/package/deb/systemd/pouch.service b/hack/package/deb/systemd/pouch.service deleted file mode 100644 index 3fa35d95e..000000000 --- a/hack/package/deb/systemd/pouch.service +++ /dev/null @@ -1,28 +0,0 @@ -[Unit] -Description=pouch - -[Service] -ExecStart=/usr/bin/pouchd -ExecReload=/bin/kill -HUP $MAINPID -Type=notify - -# Having non-zero Limit*s causes performance problems due to accounting overhead -# in the kernel. We recommend using cgroups to do container-local accounting. -LimitNOFILE=infinity -LimitNPROC=infinity -LimitCORE=infinity - -TimeoutStartSec=0 -# set delegate yes so that systemd does not reset the cgroups of pouch containers -Delegate=yes - -# kill only the pouch process, not all processes in the cgroup -KillMode=process - -# restart the pouch process if it exits prematurely -Restart=on-failure -StartLimitBurst=3 -StartLimitInterval=60s - -[Install] -WantedBy=multi-user.target diff --git a/hack/package/deb/ubuntu-xenial/Dockerfile.x86_64 b/hack/package/deb/ubuntu-xenial/Dockerfile.x86_64 deleted file mode 100644 index e8ece9475..000000000 --- a/hack/package/deb/ubuntu-xenial/Dockerfile.x86_64 +++ /dev/null @@ -1,57 +0,0 @@ -FROM ubuntu:16.04 - -RUN apt-get update \ - && apt-get install -y \ - apt-utils \ - gnupg-agent \ - wget \ - curl \ - vim \ - apparmor \ - bash-completion \ - btrfs-tools \ - build-essential \ - cmake \ - curl \ - ca-certificates \ - debhelper \ - dh-apparmor \ - dh-systemd \ - git \ - libapparmor-dev \ - libdevmapper-dev \ - libltdl-dev \ - libseccomp-dev \ - pkg-config \ - vim-common \ - libsystemd-dev \ - --no-install-recommends \ - && apt-get clean - -# set go version this image use -ENV GO_VERSION=1.9.1 -ENV ARCH=amd64 - -# install golang which version is GO_VERSION -RUN wget --quiet https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz \ - && tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz \ - && rm go${GO_VERSION}.linux-${ARCH}.tar.gz - -# create GOPATH -RUN mkdir /go -ENV GOPATH=/go - -# set go binary path to local $PATH -# go binary path is /usr/local/go/bin -ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH - -ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux -ENV RUNC_BUILDTAGS apparmor seccomp selinux -ENV DISTRO ubuntu -ENV SUITE xenial - -COPY . /go/src/github.com/alibaba/pouch - -WORKDIR /go/src/github.com/alibaba/pouch/hack/package/deb - -ENTRYPOINT ["/go/src/github.com/alibaba/pouch/hack/package/deb/build.sh"] diff --git a/hack/package/package.sh b/hack/package/package.sh deleted file mode 100755 index 7d93c1822..000000000 --- a/hack/package/package.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# VERSION the version to give to the package -VERSION=${1:?"VERSION is required."} - -# The iteration to give to the package. RPM calls this the 'release'. -# FreeBSD calls it 'PORTREVISION'. Debian calls this 'debian_revision', eg: -ITERATION=${2:?"ITERATION is required"} - -# the gpg keys directory -KEYDIR=${3:?"GPG key is required"} - -# By default we will build deb and rpm packages -PKGTYPE=$4 - -# The time to build packages -BUILDTIME="$(date --rfc-2822)" - -# The commit ID used to build package -GITCOMMIT=$( git rev-parse HEAD ) - -DIR="$( cd "$( dirname "$0" )/../.." && pwd )" - -# Replace Version, BuildTime and CommitID in version.go -pushd "$DIR" -sed -i "s#^const Version.*#const Version = \"$VERSION\"#g" version/version.go -sed -i "s#^var BuildTime.*#var BuildTime = \"$BUILDTIME\"#g" version/version.go -sed -i "s#^var GitCommit.*#var GitCommit = \"$GITCOMMIT\"#g" version/version.go - -# build rpm packages -function build_rpm() { - # build images - docker build --network host -t pouch:rpm -f "$DIR/hack/package/rpm/centos-7/Dockerfile.x86_64" . - (( $? != 0 )) && echo "failed to build pouch:rpm image." && exit 1 - - docker run --network host -it --rm \ - -e VERSION="$VERSION" \ - -e ITERATION="$ITERATION" \ - -v "$KEYDIR:/root/rpm" \ - pouch:rpm -} - -# build deb packages -function build_deb() { - # build images - docker build --network host -t pouch:deb -f "$DIR/hack/package/deb/ubuntu-xenial/Dockerfile.x86_64" . - (( $? != 0 )) && echo "failed to build pouch:deb image." && exit 1 - - docker run --network host -it --rm \ - -e VERSION="$VERSION" \ - -v "$KEYDIR/:/root/deb" \ - pouch:deb -} - -function main() { - if [[ $PKGTYPE == "rpm" ]]; then - build_rpm - elif [[ $PKGTYPE == "deb" ]]; then - build_deb - else - build_rpm - build_deb - fi -} - -main - diff --git a/hack/package/rpm/build.sh b/hack/package/rpm/build.sh deleted file mode 100755 index 7c3051dea..000000000 --- a/hack/package/rpm/build.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env bash - -set -e - -TMP=$(mktemp -d /tmp/pouch.XXXXXX) - -MOUNTDIR=/root/rpm -PACKAGEDIR=/root/rpm/package/rpm -[ -d $PACKAGEDIR ] || mkdir -p $PACKAGEDIR - -BASEDIR=/go/src/github.com/alibaba -SERVICEDIR=$BASEDIR/pouch/hack/package/rpm/service -SCRIPTSDIR=$BASEDIR/pouch/hack/package/rpm/scripts - -POUCHDIR=$TMP/source -[ -d "$POUCHDIR" ] || mkdir -p "$POUCHDIR" -BINDIR=$POUCHDIR/bin -[ -d "$BINDIR" ] || mkdir -p "$BINDIR" -LIBDIR=$POUCHDIR/lib -[ -d "$LIBDIR" ] || mkdir -p "$LIBDIR" - -USRBASE=/usr/local -USRBINDIR=$USRBASE/bin -USRLIBDIR=$USRBASE/lib - -# ARCHITECTURE, The architecture name. Usually matches 'uname -m'. -ARCHITECTURE=$(uname -m) -LICENSE='Apache License 2.0' -# The category of Pouch -CATEGORY='Tools/Pouch' -# The maintainer of this package. -MAINTAINER='Pouch pouch-dev@list.alibaba-inc.com' -VENDOR='Pouch' - -LIB_NVIDIA_VERSION="1.0.0-rc.2" -NVIDIA_RUNTIME_VERSION="1.4.0-1" - -# build lxcfs and install containerd, runc and pouch -function build_pouch() -{ - pushd $BASEDIR/pouch - # install containerd, runc and lxcfs dependencies for packaging - make package-dependencies - # build pouch - make build - make install DEST_DIR="$POUCHDIR" - popd - - # make sure related binaries are included by pouch package - cp $USRBINDIR/containerd* $USRBINDIR/ctr $USRBINDIR/runc "$BINDIR" - -} - -# install nvidia-container-runtime -function build_nvidia_runtime(){ - echo "Downloading libnvidia-container." - wget --quiet "https://github.com/NVIDIA/libnvidia-container/releases/download/v${LIB_NVIDIA_VERSION}/libnvidia-container_${LIB_NVIDIA_VERSION}_x86_64.tar.xz" -P "${TMP}" - tar -xf "${TMP}/libnvidia-container_${LIB_NVIDIA_VERSION}_x86_64.tar.xz" -C "${TMP}" - cp "${TMP}/libnvidia-container_${LIB_NVIDIA_VERSION}/usr/local/bin/nvidia-container-cli" "${BINDIR}/" - cp "${TMP}/libnvidia-container_${LIB_NVIDIA_VERSION}/usr/local/lib/libnvidia-container.so" "${LIBDIR}/" - cp "${TMP}/libnvidia-container_${LIB_NVIDIA_VERSION}/usr/local/lib/libnvidia-container.so.1" "${LIBDIR}/" - cp "${TMP}/libnvidia-container_${LIB_NVIDIA_VERSION}/usr/local/lib/libnvidia-container.so.1.0.0" "${LIBDIR}/" - - echo "Downloading nvidia-container-runtime." - wget --quiet "https://github.com/NVIDIA/nvidia-container-runtime/archive/v${NVIDIA_RUNTIME_VERSION}.tar.gz" -P "${TMP}" - mkdir -p "${GOPATH}/src/github.com/NVIDIA" - tar -xzf "${TMP}/v${NVIDIA_RUNTIME_VERSION}.tar.gz" -C "${GOPATH}/src/github.com/NVIDIA" - mv "${GOPATH}/src/github.com/NVIDIA/nvidia-container-runtime-${NVIDIA_RUNTIME_VERSION}" "${GOPATH}/src/github.com/NVIDIA/nvidia-container-runtime" - go build -o "${BINDIR}/nvidia-container-runtime-hook" "github.com/NVIDIA/nvidia-container-runtime/hook/nvidia-container-runtime-hook" -} - -function build_rpm () -{ - pushd $MOUNTDIR - # import gpg keys - gpg --import $MOUNTDIR/keys/gpg - gpg --import $MOUNTDIR/keys/secretkey - rpm --import $MOUNTDIR/keys/gpg - popd - - # configure gpg - echo "%_gpg_name Pouch Release" >> /root/.rpmmacros - - fpm -f -s dir \ - -t rpm \ - -n pouch \ - -v "$VERSION" \ - --iteration "$ITERATION" \ - -a "$ARCHITECTURE" \ - -p "$PACKAGEDIR" \ - --description 'Pouch is an open-source project created by Alibaba Group to promote the container technology movement. - - Pouch'"'"'s vision is to advance container ecosystem and promote container standards OCI, so that container technologies become the foundation for application development in the Cloud era. - - Pouch can pack, deliver and run any application. It provides applications with a lightweight runtime environment with strong isolation and minimal overhead. Pouch isolates applications from varying runtime environment, and minimizes operational workload. Pouch minimizes the effort for application developers to write Cloud-native applications, or to migrate legacy ones to a Cloud platform.' \ - --url 'https://github.com/alibaba/pouch' \ - --before-install $SCRIPTSDIR/before-install.sh \ - --after-install $SCRIPTSDIR/after-install.sh \ - --before-remove $SCRIPTSDIR/before-remove.sh \ - --after-remove $SCRIPTSDIR/after-remove.sh \ - --rpm-posttrans $SCRIPTSDIR/after-trans.sh \ - --license "$LICENSE" \ - --verbose \ - --category "$CATEGORY" \ - -m "$MAINTAINER" \ - --vendor "$VENDOR" \ - --rpm-sign \ - -d pam-devel \ - -d fuse-devel \ - -d fuse-libs \ - -d fuse \ - "$BINDIR/"=/usr/local/bin/ \ - "$LIBDIR/"=/usr/lib64/ \ - "$SERVICEDIR/"=/usr/lib/systemd/system/ \ - "$USRBINDIR/lxcfs"=/usr/bin/pouch-lxcfs \ - "$USRLIBDIR/lxcfs/liblxcfs.so"=/usr/lib64/libpouchlxcfs.so \ - -} - -function main() -{ - echo "Building rpm package." - build_pouch - build_nvidia_runtime - build_rpm -} - -main "$@" diff --git a/hack/package/rpm/centos-7/Dockerfile.x86_64 b/hack/package/rpm/centos-7/Dockerfile.x86_64 deleted file mode 100644 index 014b44710..000000000 --- a/hack/package/rpm/centos-7/Dockerfile.x86_64 +++ /dev/null @@ -1,48 +0,0 @@ -FROM centos:7.2.1511 - -# install required softs -RUN yum update -y \ - && yum install -y \ - wget \ - git \ - gcc \ - ruby-devel \ - fuse \ - fuse-devel \ - pam-devel \ - automake \ - autoconf \ - libtool \ - make \ - rpm-build \ - rpm-sign \ - rubygems \ - vim \ - tree \ - && yum clean all -# install fpm to build rpm package -RUN gem install --no-ri --no-rdoc fpm - -# set go version this image use -ENV GO_VERSION=1.9.1 -ENV ARCH=amd64 - -# install golang which version is GO_VERSION -RUN wget --quiet https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz \ - && tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz \ - && rm go${GO_VERSION}.linux-${ARCH}.tar.gz - -# create GOPATH -RUN mkdir /go -ENV GOPATH=/go - -# set go binary path to local $PATH -# go binary path is /usr/local/go/bin -ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH - -COPY . /go/src/github.com/alibaba/pouch - -WORKDIR /go/src/github.com/alibaba/pouch/hack/package/rpm - -ENTRYPOINT ["/go/src/github.com/alibaba/pouch/hack/package/rpm/build.sh"] - diff --git a/hack/package/rpm/scripts/after-install.sh b/hack/package/rpm/scripts/after-install.sh deleted file mode 100644 index 62300d236..000000000 --- a/hack/package/rpm/scripts/after-install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -if [ "$1" -eq 1 ] ; then - systemctl preset pouch > /dev/null 2>&1 -fi -if ! getent group pouch > /dev/null; then - groupadd --system pouch -fi - -if [ ! -d "/var/lib/pouch-lxcfs" ] ; then - mkdir -p /var/lib/pouch-lxcfs -fi - -BASEDIR="$( dirname "$0" )/../../../.." -COMPLETION_FILE="$BASEDIR/contrib/completion/bash/pouch" -DEST="/usr/share/bash-completion/completions" - -if [ -f "$COMPLETION_FILE" ];then - cp "$COMPLETION_FILE" "$DEST" -fi diff --git a/hack/package/rpm/scripts/after-remove.sh b/hack/package/rpm/scripts/after-remove.sh deleted file mode 100644 index 05beaa914..000000000 --- a/hack/package/rpm/scripts/after-remove.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -systemctl daemon-reload > /dev/null 2>&1 -if [ "$1" -ge 1 ] ; then - systemctl try-restart pouch > /dev/null 2>&1 -fi - -COMPLETION_FILE="contrib/completion/bash/pouch" -if [ -f "$COMPLETION_FILE" ];then - rm -f $COMPLETION_FILE -fi diff --git a/hack/package/rpm/scripts/after-trans.sh b/hack/package/rpm/scripts/after-trans.sh deleted file mode 100644 index 4ff5ecdef..000000000 --- a/hack/package/rpm/scripts/after-trans.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -if [ "$1" -ge 0 ] ; then - # check if pouch is running before upgrade - if [ -f /var/lib/rpm-state/pouch-is-active ] ; then - systemctl start pouch > /dev/null 2>&1 - rm -f /var/lib/rpm-state/pouch-is-active > /dev/null 2>&1 - fi -fi diff --git a/hack/package/rpm/scripts/before-install.sh b/hack/package/rpm/scripts/before-install.sh deleted file mode 100644 index 34fb7553d..000000000 --- a/hack/package/rpm/scripts/before-install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -if [ "$1" -gt 0 ] ; then - rm -f /var/lib/rpm-state/pouch-is-active > /dev/null 2>&1 - if systemctl is-active pouch > /dev/null 2>&1 ; then - systemctl stop pouch > /dev/null 2>&1 - touch /var/lib/rpm-state/pouch-is-active > /dev/null 2>&1 - fi -fi diff --git a/hack/package/rpm/scripts/before-remove.sh b/hack/package/rpm/scripts/before-remove.sh deleted file mode 100644 index 443d9ffb9..000000000 --- a/hack/package/rpm/scripts/before-remove.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -if [ "$1" -eq 0 ] ; then - # Package removal - systemctl --no-reload disable pouch > /dev/null 2>&1 - systemctl stop pouch > /dev/null 2>&1 -fi diff --git a/hack/package/rpm/service/pouch-lxcfs.service b/hack/package/rpm/service/pouch-lxcfs.service deleted file mode 100644 index e32282a14..000000000 --- a/hack/package/rpm/service/pouch-lxcfs.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=FUSE filesystem for LXC -ConditionVirtualization=!container -Before=lxc.service -Documentation=man:lxcfs(1) - -[Service] -ExecStart=/usr/bin/pouch-lxcfs /var/lib/pouch-lxcfs/ -KillMode=process -Restart=on-failure -ExecStopPost=-/usr/bin/fusermount -u /var/lib/pouch-lxcfs -Delegate=yes -ExecStartPost=pouch remount-lxcfs - -[Install] -WantedBy=multi-user.target diff --git a/hack/package/rpm/service/pouch.service b/hack/package/rpm/service/pouch.service deleted file mode 100644 index 7fb74960b..000000000 --- a/hack/package/rpm/service/pouch.service +++ /dev/null @@ -1,29 +0,0 @@ -[Unit] -Description=pouch - -[Service] -ExecStart=/usr/local/bin/pouchd -ExecReload=/bin/kill -HUP $MAINPID -Type=notify - -# Having non-zero Limit*s causes performance problems due to accounting overhead -# in the kernel. We recommend using cgroups to do container-local accounting. -LimitNOFILE=infinity -LimitNPROC=infinity -LimitCORE=infinity - -TimeoutStartSec=0 -# set delegate yes so that systemd does not reset the cgroups of pouch containers -Delegate=yes - -# kill only the pouch process, not all processes in the cgroup -KillMode=process - -# restart the pouch process if it exits prematurely -Restart=on-failure -StartLimitBurst=3 -StartLimitInterval=60s - -[Install] -WantedBy=multi-user.target -