-
Notifications
You must be signed in to change notification settings - Fork 41
Packit: initial enablement #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,5 @@ | ||
| # Below definitions are used to deliver config files from a particular branch | ||
| # of c/image, c/storage and c/shortnames vendored in all of Buildah, Podman and Skopeo. | ||
| # These vendored components must have the same version. If it is not the case, | ||
| # pick the oldest version on c/image, c/storage and c/shortnames vendored in | ||
| # Buildah/Podman/Skopeo. | ||
|
|
||
| # Packit will automatically update the image and storage versions on Fedora and | ||
| # CentOS Stream dist-git PRs. | ||
| %global image_branch main | ||
| %global storage_branch main | ||
| %global shortnames_branch main | ||
|
|
||
| %global project containers | ||
| %global repo common | ||
|
|
||
| %global raw_github_url https://raw.githubusercontent.com/%{project} | ||
| %global repo container-libs | ||
|
|
||
| %if %{defined copr_username} | ||
| %define copr_build 1 | ||
|
|
@@ -35,7 +21,7 @@ Epoch: 5 | |
| %endif | ||
| # DO NOT TOUCH the Version string! | ||
| # The TRUE source of this specfile is: | ||
| # https://github.com/containers/common/blob/main/rpm/containers-common.spec | ||
| # https://github.com/containers/container-libs/blob/main/common/rpm/containers-common.spec | ||
| # If that's what you're reading, Version must be 0, and will be updated by Packit for | ||
| # copr and koji builds. | ||
| # If you're reading this on dist-git, the version is automatically filled in by Packit. | ||
|
|
@@ -57,25 +43,9 @@ Requires: (fuse-overlayfs if fedora-release-identity-server) | |
| Suggests: fuse-overlayfs | ||
| %endif | ||
| URL: https://github.com/%{project}/%{repo} | ||
| Source0: %{url}/archive/v%{version_no_tilde}.tar.gz | ||
| Source1: %{raw_github_url}/image/%{image_branch}/docs/containers-auth.json.5.md | ||
| Source2: %{raw_github_url}/image/%{image_branch}/docs/containers-certs.d.5.md | ||
| Source3: %{raw_github_url}/image/%{image_branch}/docs/containers-policy.json.5.md | ||
| Source4: %{raw_github_url}/image/%{image_branch}/docs/containers-registries.conf.5.md | ||
| Source5: %{raw_github_url}/image/%{image_branch}/docs/containers-registries.conf.d.5.md | ||
| Source6: %{raw_github_url}/image/%{image_branch}/docs/containers-registries.d.5.md | ||
| Source7: %{raw_github_url}/image/%{image_branch}/docs/containers-signature.5.md | ||
| Source8: %{raw_github_url}/image/%{image_branch}/docs/containers-transports.5.md | ||
| Source9: %{raw_github_url}/storage/%{storage_branch}/docs/containers-storage.conf.5.md | ||
| Source10: %{raw_github_url}/shortnames/%{shortnames_branch}/shortnames.conf | ||
| Source11: %{raw_github_url}/image/%{image_branch}/default.yaml | ||
| Source12: %{raw_github_url}/image/%{image_branch}/default-policy.json | ||
| Source13: %{raw_github_url}/image/%{image_branch}/registries.conf | ||
| Source14: %{raw_github_url}/storage/%{storage_branch}/storage.conf | ||
| # Fetch RPM-GPG-KEY-redhat-release from the authoritative source instead of storing | ||
| # a copy in repo or dist-git. Depending on distribution-gpg-keys rpm is also | ||
| # not an option because that package doesn't exist on CentOS Stream. | ||
| Source15: https://access.redhat.com/security/data/fd431d51.txt | ||
| Source0: %{url}/archive/refs/tags/common/v%{version}.tar.gz | ||
| Source1: https://raw.githubusercontent.com/containers/shortnames/refs/heads/main/shortnames.conf | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be a part of container-libs too?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's a separate repo and looks like it's going to remain separate because there are contributors from other projects. |
||
| Source2: https://access.redhat.com/security/data/fd431d51.txt | ||
|
|
||
| %description | ||
| This package contains common configuration files and documentation for container | ||
|
|
@@ -109,34 +79,20 @@ This subpackage will handle dependencies common to Podman and Buildah which are | |
| not required by Skopeo. | ||
|
|
||
| %prep | ||
| %autosetup -Sgit -n %{repo}-%{version_no_tilde} | ||
|
|
||
| # Copy manpages to docs subdir in builddir to build before installing. | ||
| cp %{SOURCE1} docs/. | ||
| cp %{SOURCE2} docs/. | ||
| cp %{SOURCE3} docs/. | ||
| cp %{SOURCE4} docs/. | ||
| cp %{SOURCE5} docs/. | ||
| cp %{SOURCE6} docs/. | ||
| cp %{SOURCE7} docs/. | ||
| cp %{SOURCE8} docs/. | ||
| cp %{SOURCE9} docs/. | ||
|
|
||
| # Copy config files to builddir to patch them before installing. | ||
| # Currently, only registries.conf and storage.conf files are patched before | ||
| # installing. | ||
| cp %{SOURCE10} shortnames.conf | ||
| cp %{SOURCE13} registries.conf | ||
| cp %{SOURCE14} storage.conf | ||
| %autosetup -Sgit -n %{repo}-common-v%{version} | ||
|
|
||
| # Fine-grain distro- and release-specific tuning of config files, | ||
| # e.g., seccomp, composefs, registries on different RHEL/Fedora versions | ||
| bash rpm/update-config-files.sh | ||
| bash common/rpm/update-config-files.sh | ||
|
|
||
| %build | ||
| mkdir -p man5 | ||
| for i in docs/*.5.md; do | ||
| go-md2man -in $i -out man5/$(basename $i .md) | ||
| mkdir -p man1 man5 | ||
| for i in common/docs/*.md image/docs/*.md storage/docs/*.md; do | ||
| if [[ "$i" == *".5.md" ]]; then | ||
| go-md2man -in $i -out man5/$(basename $i .md) | ||
| else | ||
| go-md2man -in $i -out man1/$(basename $i .md) | ||
| fi | ||
| done | ||
|
|
||
| %install | ||
|
|
@@ -150,32 +106,37 @@ touch %{buildroot}%{_prefix}/lib/containers/storage/overlay-images/images.lock | |
| install -dp -m 700 %{buildroot}%{_prefix}/lib/containers/storage/overlay-layers | ||
| touch %{buildroot}%{_prefix}/lib/containers/storage/overlay-layers/layers.lock | ||
|
|
||
| install -Dp -m0644 shortnames.conf %{buildroot}%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf | ||
| install -Dp -m0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/containers/registries.d/default.yaml | ||
| install -Dp -m0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/containers/policy.json | ||
| install -Dp -m0644 registries.conf %{buildroot}%{_sysconfdir}/containers/registries.conf | ||
| install -Dp -m0644 storage.conf %{buildroot}%{_datadir}/containers/storage.conf | ||
| install -Dp -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/containers/registries.conf.d/000-shortnames.conf | ||
| install -Dp -m0644 image/default.yaml %{buildroot}%{_sysconfdir}/containers/registries.d/default.yaml | ||
| install -Dp -m0644 image/default-policy.json %{buildroot}%{_sysconfdir}/containers/policy.json | ||
| install -Dp -m0644 image/registries.conf %{buildroot}%{_sysconfdir}/containers/registries.conf | ||
| install -Dp -m0644 storage/storage.conf %{buildroot}%{_datadir}/containers/storage.conf | ||
|
|
||
| # RPM-GPG-KEY-redhat-release already exists on rhel envs, install only on | ||
| # fedora and centos | ||
| %if %{defined fedora} || %{defined centos} | ||
| install -Dp -m0644 %{SOURCE15} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-redhat-release | ||
| install -Dp -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-redhat-release | ||
| %endif | ||
|
|
||
| install -Dp -m0644 contrib/redhat/registry.access.redhat.com.yaml -t %{buildroot}%{_sysconfdir}/containers/registries.d | ||
| install -Dp -m0644 contrib/redhat/registry.redhat.io.yaml -t %{buildroot}%{_sysconfdir}/containers/registries.d | ||
| install -Dp -m0644 common/contrib/redhat/registry.access.redhat.com.yaml -t %{buildroot}%{_sysconfdir}/containers/registries.d | ||
| install -Dp -m0644 common/contrib/redhat/registry.redhat.io.yaml -t %{buildroot}%{_sysconfdir}/containers/registries.d | ||
|
|
||
| # install manpages | ||
| install -dp %{buildroot}%{_mandir}/man5 | ||
| install -dp -m 700 %{buildroot}%{_mandir}/man1 | ||
| pushd man1 | ||
| for i in *; do | ||
| install -p -m0644 $i -T %{buildroot}%{_mandir}/man1/$i.1 | ||
| done | ||
| popd | ||
| for i in man5/*.5; do | ||
| install -Dp -m0644 $i -t %{buildroot}%{_mandir}/man5 | ||
| install -Dp -m0644 $i -t %{buildroot}%{_mandir}/man5 | ||
| done | ||
| ln -s containerignore.5 %{buildroot}%{_mandir}/man5/.containerignore.5 | ||
|
|
||
| # install config files for mounts, containers and seccomp | ||
| install -m0644 pkg/subscriptions/mounts.conf %{buildroot}%{_datadir}/containers/mounts.conf | ||
| install -m0644 pkg/seccomp/seccomp.json %{buildroot}%{_datadir}/containers/seccomp.json | ||
| install -m0644 pkg/config/containers.conf %{buildroot}%{_datadir}/containers/containers.conf | ||
| install -m0644 common/pkg/subscriptions/mounts.conf %{buildroot}%{_datadir}/containers/mounts.conf | ||
| install -m0644 common/pkg/seccomp/seccomp.json %{buildroot}%{_datadir}/containers/seccomp.json | ||
| install -m0644 common/pkg/config/containers.conf %{buildroot}%{_datadir}/containers/containers.conf | ||
|
|
||
| # install secrets patch directory | ||
| install -d -p -m 755 %{buildroot}/%{_datadir}/rhel/secrets | ||
|
|
@@ -184,7 +145,6 @@ ln -s ../../../..%{_sysconfdir}/pki/entitlement %{buildroot}%{_datadir}/rhel/sec | |
| ln -s ../../../..%{_sysconfdir}/rhsm %{buildroot}%{_datadir}/rhel/secrets/rhsm | ||
| ln -s ../../../..%{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/rhel/secrets/redhat.repo | ||
|
|
||
| # Placeholder check to silence rpmlint warnings | ||
| %check | ||
|
|
||
| %files | ||
|
|
@@ -215,6 +175,8 @@ ln -s ../../../..%{_sysconfdir}/yum.repos.d/redhat.repo %{buildroot}%{_datadir}/ | |
| %ghost %{_sysconfdir}/containers/storage.conf | ||
| %ghost %{_sysconfdir}/containers/containers.conf | ||
| %dir %{_sharedstatedir}/containers/sigstore | ||
| %{_mandir}/man1/containers-storage*.1.gz | ||
| %{_mandir}/man1/signature-protocols.1.gz | ||
| %{_mandir}/man5/Containerfile.5.gz | ||
| %{_mandir}/man5/containerignore.5.gz | ||
| %{_mandir}/man5/.containerignore.5.gz | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's delivering the whole world and not only bits which are actually needed/installed for the container ecosystem? This is super wasteful in terms of package size, content and overall packaging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where exactly is the package size and content impact felt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Source0: %{url}/archive/refs/tags/common/v%{version}.tar.gz'
There is a fundamental difference between a regular package which actually builds from source and this one. The build doesn't happen. The purpose of containers-common is to only deliver small configuration files originating from upstream to container-tools. For this purpose stashing not only config files but also sources - which are unbuilt - into the mothership tarball with 99.99% of stuff uninstalled is very wasteful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but who's exactly feeling the impact of this?
The current PR makes the spec file a lot simpler. So, unless someone is actually feeling the impact of a large tarball, I'd prefer to keep it this way.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"who cares?" doesn't seem the correct justification :-) Also it is not exactly a simplification for various reasons:
Consider this:
with tarball-only approach:
With per-version source URLs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which is what we've been already doing via the Packit workflow for Fedora for sometime now.
That's why we have packit copr builds and TMT tests running on podman, buildah and skopeo PRs fetching containers-common from podman-next. So, things are continuously tested upstream.
If any auditor cares, they're welcome to fetch and extract files from the rpm. No reason to add unnecessary maintenance burden downstream (Fedora). They're config files so they don't need to be stored in dist-git to be readable. CentOS Stream and RHEL process are your call.
With monorepo, renovate and consistent tests running upstream and on Fedora, I don't see this being an issue. At the very least, nothing worth requiring any manual maintenance on Fedora.
That has been upstreamed already in
common/rpm/update-config-files.sh. Again, CentOS Stream and RHEL are your call.