diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/build_rpm.sh | 43 | ||||
-rw-r--r-- | contrib/cirrus/lib.sh | 16 | ||||
-rwxr-xr-x | contrib/cirrus/update_meta.sh | 22 | ||||
-rw-r--r-- | contrib/podmanimage/stable/Dockerfile | 4 | ||||
-rw-r--r-- | contrib/podmanimage/testing/Dockerfile | 4 | ||||
-rw-r--r-- | contrib/podmanimage/upstream/Dockerfile | 6 | ||||
-rw-r--r-- | contrib/spec/podman.spec.in | 12 |
7 files changed, 79 insertions, 28 deletions
diff --git a/contrib/build_rpm.sh b/contrib/build_rpm.sh index e41763fa7..b162a9c88 100755 --- a/contrib/build_rpm.sh +++ b/contrib/build_rpm.sh @@ -2,7 +2,7 @@ set -euxo pipefail # returned path can vary: /usr/bin/dnf /bin/dnf ... -pkg_manager=`command -v dnf yum | head -n1` +pkg_manager=$(command -v dnf yum | head -n1) echo "Package manager binary: $pkg_manager" @@ -14,40 +14,55 @@ enabled=1 gpgcheck=0" > /etc/yum.repos.d/container_virt.repo fi -declare -a PKGS=(device-mapper-devel \ +declare -a PKGS=(\ + createrepo \ + device-mapper-devel \ git \ glib2-devel \ glibc-static \ + go-compilers-golang-compiler \ golang \ gpgme-devel \ libassuan-devel \ libseccomp-devel \ libselinux-devel \ make \ + redhat-rpm-config \ rpm-build \ - go-compilers-golang-compiler \ + rpmdevtools \ + systemd-devel \ ) if [[ $pkg_manager == *dnf ]]; then + # We need to enable PowerTools if we want to get + # install all the pkgs we define in PKGS + # PowerTools exists on centos-8 but not on fedora-30 and rhel-8 + if (dnf -v -C repolist all|grep "Repo-id : PowerTools" >/dev/null); then + sudo dnf config-manager --set-enabled PowerTools + fi + PKGS+=(python3-devel \ python3-varlink \ ) - # btrfs-progs-devel is not available in CentOS/RHEL-8 - if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then - PKGS+=(btrfs-progs-devel) - fi - # disable doc until go-md2man rpm becomes available - # disable debug to avoid error: Empty %files file ~/rpmbuild/BUILD/libpod-.../debugsourcefiles.list - export extra_arg="--without doc --without debug" -else - if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then - PKGS+=(golang-github-cpuguy83-go-md2man) - fi fi +# btrfs-progs-devel is not available in CentOS/RHEL-8 +if ! (grep -i 'Red Hat\|CentOS' /etc/redhat-release | grep " 8" ); then + PKGS+=(golang-github-cpuguy83-go-md2man \ + btrfs-progs-devel \ + ) +fi + +# disable doc until go-md2man rpm becomes available +# disable debug to avoid error: Empty %files file ~/rpmbuild/BUILD/libpod-.../debugsourcefiles.list +export extra_arg="--without doc --without debug" + echo ${PKGS[*]} sudo $pkg_manager install -y ${PKGS[*]} +# clean up src.rpm as it's been built +sudo rm -f podman-*.src.rpm + make -f .copr/Makefile # workaround for https://github.com/containers/libpod/issues/4627 if [ -d ~/rpmbuild/BUILD ]; then diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index 2e43a59f6..1e237085f 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -64,8 +64,8 @@ export PACKER_BUILDS="${PACKER_BUILDS:-ubuntu-18,ubuntu-19,fedora-30,xfedora-30, export UBUNTU_BASE_IMAGE="ubuntu-1904-disco-v20190724" export PRIOR_UBUNTU_BASE_IMAGE="ubuntu-1804-bionic-v20190722a" # Manually produced base-image names (see $SCRIPT_BASE/README.md) -export FEDORA_BASE_IMAGE="fedora-cloud-base-30-1-2-1565360543" -export PRIOR_FEDORA_BASE_IMAGE="fedora-cloud-base-29-1-2-1565360543" +export FEDORA_BASE_IMAGE="fedora-cloud-base-30-1-2-1578586410" +export PRIOR_FEDORA_BASE_IMAGE="fedora-cloud-base-29-1-2-1541789245" export BUILT_IMAGE_SUFFIX="${BUILT_IMAGE_SUFFIX:--$CIRRUS_REPO_NAME-${CIRRUS_BUILD_ID}}" # IN_PODMAN container image IN_PODMAN_IMAGE="quay.io/libpod/in_podman:latest" @@ -430,6 +430,18 @@ remove_packaged_podman_files() { sync && echo 3 > /proc/sys/vm/drop_caches } +canonicalize_image_names() { + req_env_var IMGNAMES + echo "Adding all current base images to \$IMGNAMES for timestamp update" + export IMGNAMES="\ +$IMGNAMES +$UBUNTU_BASE_IMAGE +$PRIOR_UBUNTU_BASE_IMAGE +$FEDORA_BASE_IMAGE +$PRIOR_FEDORA_BASE_IMAGE +" +} + systemd_banish() { $GOSRC/$PACKER_BASE/systemd_banish.sh } diff --git a/contrib/cirrus/update_meta.sh b/contrib/cirrus/update_meta.sh new file mode 100755 index 000000000..618cd670c --- /dev/null +++ b/contrib/cirrus/update_meta.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +source $(dirname $0)/lib.sh + +# N/B: This script is expected to wrap $ENTRYPOINT when executing under the +# 'meta' Cirrus task on the libpod repo. +ENTRYPOINT=/usr/local/bin/entrypoint.sh + +req_env_var IMGNAMES BUILDID REPOREF GCPJSON GCPNAME GCPPROJECT CIRRUS_CI + +[[ -x "$ENTRYPOINT" ]] || \ + die 2 "Expecting to find an installed entrypoint script $ENTRYPOINT." + +# A better way of checking isn't compatible with old but functional images +# in-use by other repos. +grep -q 'compute images update' "$ENTRYPOINT" || \ + die 3 "Expecting to be running inside a specific imgts container image" + +canonicalize_image_names + +# Executing inside a container; proper hand-off for process control +exec $ENTRYPOINT diff --git a/contrib/podmanimage/stable/Dockerfile b/contrib/podmanimage/stable/Dockerfile index 6b4eb2220..c0c07d9d2 100644 --- a/contrib/podmanimage/stable/Dockerfile +++ b/contrib/podmanimage/stable/Dockerfile @@ -9,9 +9,9 @@ FROM fedora:latest # Don't include container-selinux and remove -# directories used by dnf that are just taking +# directories used by yum that are just taking # up space. -RUN yum -y install podman fuse-overlayfs --exclude container-selinux; rm -rf /var/cache /var/log/dnf* /var/log/yum.* +RUN useradd build; yum -y update; yum -y reinstall shadow-utils; yum -y install podman fuse-overlayfs --exclude container-selinux; rm -rf /var/cache /var/log/dnf* /var/log/yum.* # Adjust storage.conf to enable Fuse storage. RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf diff --git a/contrib/podmanimage/testing/Dockerfile b/contrib/podmanimage/testing/Dockerfile index 4dffc8911..a8e7653f6 100644 --- a/contrib/podmanimage/testing/Dockerfile +++ b/contrib/podmanimage/testing/Dockerfile @@ -11,9 +11,9 @@ FROM fedora:latest # Don't include container-selinux and remove -# directories used by dnf that are just taking +# directories used by yum that are just taking # up space. -RUN yum -y install podman fuse-overlayfs --exclude container-selinux --enablerepo updates-testing; rm -rf /var/cache /var/log/dnf* /var/log/yum.* +RUN useradd build; yum -y update; yum -y reinstall shadow-utils; yum -y install podman fuse-overlayfs --exclude container-selinux --enablerepo updates-testing; rm -rf /var/cache /var/log/dnf* /var/log/yum.* # Adjust storage.conf to enable Fuse storage. RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf diff --git a/contrib/podmanimage/upstream/Dockerfile b/contrib/podmanimage/upstream/Dockerfile index 58e54b5b5..7c9434fa6 100644 --- a/contrib/podmanimage/upstream/Dockerfile +++ b/contrib/podmanimage/upstream/Dockerfile @@ -17,7 +17,7 @@ ENV GOPATH=/root/podman # to the container. # Finally remove the podman directory and a few other packages # that are needed for building but not running Podman -RUN dnf -y install --exclude container-selinux \ +RUN useradd build; yum -y update; yum -y reinstall shadow-utils; yum -y install --exclude container-selinux \ --enablerepo=updates-testing \ atomic-registries \ btrfs-progs-devel \ @@ -63,8 +63,8 @@ RUN dnf -y install --exclude container-selinux \ # Adjust libpod.conf to write logging to a file sed -i 's/# events_logger = "journald"/events_logger = "file"/g' /usr/share/containers/libpod.conf; \ rm -rf /root/podman/*; \ - dnf -y remove git golang go-md2man make; \ - dnf clean all; + yum -y remove git golang go-md2man make; \ + yum clean all; # Adjust storage.conf to enable Fuse storage. RUN sed -i -e 's|^#mount_program|mount_program|g' -e '/additionalimage.*/a "/var/lib/shared",' /etc/containers/storage.conf diff --git a/contrib/spec/podman.spec.in b/contrib/spec/podman.spec.in index 2b9621dbc..25c70c392 100644 --- a/contrib/spec/podman.spec.in +++ b/contrib/spec/podman.spec.in @@ -22,6 +22,9 @@ %define gobuild(o:) go build -tags="$BUILDTAGS" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; #% endif +# libpod hack directory +%define hackdir %{_builddir}/%{repo}-%{shortcommit0} + %global provider github %global provider_tld com %global project containers @@ -36,11 +39,11 @@ # People want conmon packaged with the copr rpm %global import_path_conmon github.com/containers/conmon %global git_conmon https://%{import_path_conmon} -%global commit_conmon 6f3572558b97bc60dd8f8c7f0807748e6ce2c440 +%global commit_conmon d532caebc788fafdd2a305b68cd1983b4039bea4 %global shortcommit_conmon %(c=%{commit_conmon}; echo ${c:0:7}) Name: podman -Version: 1.7.0 +Version: 1.7.1 Release: #COMMITDATE#.git%{shortcommit0}%{?dist} Summary: Manage Pods, Containers and Container Images License: ASL 2.0 @@ -76,7 +79,6 @@ Requires: runc Requires: skopeo-containers Requires: containernetworking-plugins >= 0.6.0-3 Requires: iptables -Requires: oci-systemd-hook %if 0%{?rhel} <= 7 Requires: container-selinux %else @@ -384,7 +386,7 @@ ln -s ../../../../ src/%{import_path} popd ln -s vendor src export GOPATH=$(pwd)/_build:$(pwd):$(pwd):%{gopath} -export BUILDTAGS="varlink selinux seccomp $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh) $(hack/libdm_tag.sh) exclude_graphdriver_devicemapper" +export BUILDTAGS="varlink selinux seccomp $(%{hackdir}/hack/btrfs_installed_tag.sh) $(%{hackdir}/hack/btrfs_tag.sh) $(%{hackdir}/hack/libdm_tag.sh) exclude_graphdriver_devicemapper" GOPATH=$GOPATH go generate ./cmd/podman/varlink/... @@ -402,7 +404,7 @@ mkdir -p src/%{provider}.%{provider_tld}/{containers,opencontainers} ln -s $(dirs +1 -l) src/%{import_path_conmon} popd -export BUILDTAGS="selinux seccomp $(hack/btrfs_installed_tag.sh) $(hack/btrfs_tag.sh)" +export BUILDTAGS="selinux seccomp $(%{hackdir}/hack/btrfs_installed_tag.sh) $(%{hackdir}/hack/btrfs_tag.sh)" BUILDTAGS=$BUILDTAGS make popd |