Documentation
Ansible
The story here is related to latest changes in TripleO and Ansible. Since we started to use Ansible collections as RPMs, this document is going to describe the process of fix release from submitting it to collection repository till OSP release
Resources:
ansible-collection-containers-podman
Create New Update
Guide:
Fork ansible-podman-collections
repository from:
https://github.com/containers/ansible-podman-collections
Create a fix and pull request to original repository. Wait for CI and ask for review and merge. (In this collection mostly for @sshnaidm)
After merge start a releasing process by releasing to Galaxy:
changelogs/changelog.yaml
antsibull-changelog release
command (install antsibull
tool before)changelogs/changelog.yaml
file and generated changelog in CHANGELOG.rst
and fix if need
./build_docs.sh <your_path_to>/ansible-podman-collections/docs
from contrib
folderversion
in galaxy.yaml
file to the new one.git tag <version_tag>
where <version_tag>
is tag of the new version - for example 2.3.4
git push upstream <version_tag>
Build and release RPM in Fedora (which will be imported to RDO later)
install all required tools, mainly fedpkg
create a space for work if no such: mkdir fedora-scm
fork Fedora repository rpms/ansible-collection-containers-podman.
NOTE: If you are not in admins
, then you will need to make a PR,
otherwise you can just commit directly to repo.
clone original or your forked repo such as
https://src.fedoraproject.org/fork/sshnaidm/rpms/ansible-collection-containers-podman with
fedpkg clone rpms/ansible-collection-containers-podman
(or for PRs: fedpkg clone forks/sshnaidm/rpms/ansible-collection-containers-podman
where instead of sshnaidm
your username)
cd ansible-collection-containers-podman
and check that you are on branch rawhide
,
if not run fedpkg switch-branch rawhide
Retrieve new sources from github:
wget https://github.com/containers/ansible-podman-collections/archive/<version_tag>.tar.gz
where <version_tag> is a new version, like 2.4.1
Or run spectool -g *spec
after you changed the spec
file:
Bump version in *.spec
file as in this example for 1.9.4
:
+Version: <version-tag>
+Release: 1%{?dist}
and add changelog, sort of:
+* Tue Jun 08 2021 Sagi Shnaidman <sshnaidm@redhat.com> - <version-tag>-1
+- Bump to <version-tag>-1
Upload sources you downloaded before: fedpkg new-sources <version-tag>.tar.gz
fedpkg mockbuild
to check building (optional)
Verify and commit code:
fedpkg diff
fedpkg lint
(to check linters on RPM)fedpkg commit
with message like "Bump to <version-tag>"Push changes for rawhide
and let Koji build the package:
fedpkg push
fedpkg build
ansible-collection-containers-podman
(optional)Repeat for older branches, e.g. Fedora 36:
fedpkg switch-branch f36
git merge rawhide
fedpkg push
fedpkg build
fedpkg update
or use Bodhi's page Create New Update
Repeat previous steps for branch epel9
.
Promote built RPM to RDO:
Update rdoinfo
repository to build package ansible-collection-containers-podman
in RDO
for CentOS 8 and CentOS 9:
For CentOS8, edit buildsys-tags/cloud8s-openstack-<openstack-current-branch>-candidate.yml
and send patch to review. For example if current branch is Xena, then it is
buildsys-tags/cloud8s-openstack-xena-candidate.yml
.
If package is there, just change version to latest, if not, add it as:
- project: ansible-collection-containers-podman
buildsys-tags:
cloud8s-openstack-xena-candidate: ansible-collection-containers-podman-<version-tag>-1.el8
For CentOS9, edit SPECS/ansible-collection-containers-podman.spec
in repo
deps/ansible-collection-containers-podman
as described in
Requirements management in RDO.
Example: https://review.rdoproject.org/r/c/deps/ansible-collection-containers-podman/+/43849
Update rdoinfo
repository to import updated packages of ansible-collection-containers-podman
into RDO
branches. Bump version of ansible-collection-containers-podman
in all
buildsys-tags/*-openstack-*-testing.yml
relevant files and send patch to review.
NOTE: Send separate patches for each RDO release because several jobs will run for each RDO release which have to pass for a patch to pass Zuul CI gates. RDO folks apparently does not want to recheck all if there is a single failing job hence submit one patch per file.
Examples:
buildsys-tags/cloud8s-openstack-wallaby-testing.yml
buildsys-tags/cloud8s-openstack-xena-testing.yml
buildsys-tags/cloud8s-openstack-yoga-testing.yml
buildsys-tags/cloud9s-openstack-wallaby-testing.yml
buildsys-tags/cloud9s-openstack-xena-testing.yml
buildsys-tags/cloud9s-openstack-yoga-testing.yml
buildsys-tags/cloud9s-openstack-zed-testing.yml
Content has been migrated to docs/releasing.md
in Ansible OpenStack collection.
Submit PR to collection in its repo
Test PR with upstream or RDO job.
ansible.posix
:
DNM test PR with our jobs
This patch is for test.
github: https://github.com/ansible-collections/ansible.posix/pull/215
Change-ID: ......
If test passed and your're satisfied with its results, wait until PR is merged and collection is released. (TBD)
Submit a patch to updated RPM with a new version:
Fork the RPM specs repo, for example press button Fork
in the page os netcommon repo to fork it to your space.
Clone it to your machine with SSH://
transport. For example: git clone ssh://sshnaidm@pkgs.fedoraproject.org/forks/sshnaidm/rpms/ansible-collection-ansible-netcommon.git
Update spec file and add changelog.
Get the new sources tarball: spectool -g *spec
Upload the tarball to sources: fedpkg new-sources ./path/to/tar.gz
. Look at sources
that it has right tarball.
Commit changes to spec and sources: git commit -asm "Update ....."
Check your PR in CI, look at line "Fedora CI - scratch build" in your PR web page and go this link to see Koji build.
After build in Koji succeeded and RPM update patch was merged, update the rdoinfo with a new package version. Submit a patch to rdoinfo, for example: https://review.rdoproject.org/r/c/rdoinfo/+/34314/1/buildsys-tags/cloud8s-openstack-xena-candidate.yml
Sometimes we'll need to add a new collection or new dependency for existing collection. The process of adding another package is like following:
Create a spec for collection, usually it's customized copy of existing spec of any collection, for example of community.general.
Run rpmbuild -ba /path/to/spec/file
and check there are no errors and source RPM is built (usually in ~/rpmbuild/SRPMS/
)
Upload your SRPM and SPEC files onto the internet somewhere, for example in your Github in gist. Get a direct link to file (raw
).
Try to build it in Koji: koji build --scratch f33 /home/sshnaidm/rpmbuild/SRPMS/your_collection_SRPM_file.src.rpm
Remember the file should be SRPM (source RPM). Watch the build and ensure it succeeds.
Make sure you have a Bugzilla account at bugzilla.redhat.com. Fill out this form: https://bugzilla.redhat.com/bugzilla/enter_bug.cgi?product=Fedora&format=fedora-review
After a bugzilla review request is approved, let's create a repo:
fedpkg request-repo PACKAGE-NAME BUGZILLA-TICKET-NUMBER
For example: fedpkg request-repo ansible-collection-ansible-utils 1979543
If we need more than rawhide
branch, then request for a branch: fedpkg request-branch --repo PACKAGE-NAME BRANCH
For example: fedpkg request-branch --repo ansible-collection-ansible-utils f34
The pull requests should be tracked in https://pagure.io
When your "Issues" are approved on https://pagure.io run somewhere to clone the package: fedpkg clone PACKAGE-NAME
for example: fedpkg clone ansible-collection-ansible-utils
Make sure you're logged in with Fedora Kerberos: kinit username@FEDORAPROJECT.ORG
Import the approved SRPM (from point 2): fedpkg import ~/rpmbuild/SRPMS/...src.rpm
Commit sources and spec by git commit -m "Initial import (#nnnnnn)."
(where nnnnnn is your Bugzilla package review bug number) - for example git commit -m "Initial import (#1979543)."
Push it with fedpkg push
or git push
.
Build it with fedpkg build
.
In case you have other branches:
fedpkg switch-branch BRANCH
for example fedpkg switch-branch f34
rawhide
from point 12: git merge rawhide
fedpkg push
fedpkg build
rawhide
) branches run:
fedpkg update
type=newpackage
bugs=1979543 # your BZ number
display_name=<your package name>
testing
to stable
in web UI: https://bodhi.fedoraproject.org/updates/ or in your DashboardAdd package to RDO: create a patch to rdoinfo
repository, which adds the package to deps.yml
and candidate file of current branch (current master
). For example cloud8s-openstack-xena-candidate.yml
for Xena branch.
Example of patch: https://review.rdoproject.org/r/c/rdoinfo/+/34445
After it's built successfully for candidate
add patch for rdoinfo
to build it in testing
, for example in branch xena
it will be cloud8s-openstack-xena-testing
file.
Example of patch: https://review.rdoproject.org/r/c/rdoinfo/+/34513
Check that package is built and present in repo, for Ansible collections it will be master deps
repository, like: https://trunk.rdoproject.org/centos8-master/deps/latest/noarch/
Close the Bugzilla ticket.
You should close it with resolution NEXTRELEASE or RAWHIDE, depending on where you built the package. The resolution field will appear after you set the status field to CLOSED.
++++ Done!