Skip to content
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

[CI:BUILD] Packit: Enable Copr builds on PR and commit to main #4681

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

lsm5
Copy link
Member

@lsm5 lsm5 commented Mar 22, 2023

This commit adds Packit configuration files which will trigger rpm builds on copr:rhcontainerbot/packit-builds on every PR as well as on copr:rhcontainerbot/podman-next on every commit to main branch.

This commit will ensure main branch is always buildable on all supported Fedora and CentOS Stream versions for aarch64 and x86_64.
TODO: enable build checks for s390x and ppc64le while ensuring they don't take too long to build.

The packit builds reuse buildah.spec.rpkg and are thus independent of Fedora / CentOS dist-git.

This change will remove the need for the current webhook based triggering
of rpm builds on rhcontainerbot/podman-next after commit to main.
That will be instead handled by the trigger: commit action added in this
PR. New builds will continue to get posted to the same link so users
don't need to change any existing copr repo configuration.

What type of PR is this?

/kind other

What this PR does / why we need it:

Checks for downstream build issues prior to merge.

How to verify it

There will be additional packit tasks in CI.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lsm5

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lsm5 lsm5 force-pushed the packit branch 3 times, most recently from 52b560e to 9925996 Compare March 22, 2023 15:13
@lsm5 lsm5 requested a review from edsantiago March 22, 2023 15:19
@lsm5 lsm5 marked this pull request as ready for review March 22, 2023 15:20
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly I just diffed against the aardvark-dns packit files. A few questions and nits.

.packit.sh Outdated Show resolved Hide resolved
sed -i "s/^Source:.*.tar.gz/Source: buildah-$VERSION.tar.gz/" buildah.spec

# Use the right build dir for autosetup stage in rpm spec
sed -i "s/^%setup.*/%autosetup -Sgit -n %{name}-$VERSION/" buildah.spec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is buildah.spec generated from buildah.spec.rpkg in this directory? If so, it does not seem to include either %setup nor %autosetup...?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edsantiago try rpkg spec --outdir ./ . That will leave you with a buildah.spec that has:

%prep
%setup -T -b 0 -q -n buildah

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a comment about rpkg spec ... in .packit.sh if that helps.

# Run on commit to main branch
trigger: commit
branch: main
project: podman-next
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't speak packit, so maybe this is correct, maybe not. Just want to point out that it says "podman" in a buildah PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, that specifies the copr project where the build should be triggered after the commit is added to main branch upstream. It inherits most values from the block above it, but since the builds after merge should be in rhcontainerbot/podman-next, hence the project: podman-next.

@lsm5 lsm5 force-pushed the packit branch 2 times, most recently from dc5be9c to 7c040e5 Compare March 22, 2023 15:54
@lsm5
Copy link
Member Author

lsm5 commented Mar 22, 2023

Btw, this change will remove the need for the current webhook based triggering of rpm builds on rhcontainerbot/podman-next after commit to main (https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/package/buildah/) . That will be instead handled by the trigger: commit action added in this PR. New builds will continue to get posted to the same link so users don't need to change any existing copr repo configuration.

@lsm5
Copy link
Member Author

lsm5 commented Mar 22, 2023

Btw, this change will remove the need for the current webhook based triggering of rpm builds on rhcontainerbot/podman-next after commit to main (https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/package/buildah/) . That will be instead handled by the trigger: commit action added in this PR. New builds will continue to get posted to the same link so users don't need to change any existing copr repo configuration.

I'll add this in the commit message..

@edsantiago
Copy link
Member

Thanks for the explanations. Most of it is above my head, because I don't use these COPRs or repos or anything like this, but LGTM

@lsm5
Copy link
Member Author

lsm5 commented Mar 22, 2023

Thanks for the explanations. Most of it is above my head, because I don't use these COPRs or repos or anything like this, but LGTM

Alrighty :) . Thank you!

@edsantiago
Copy link
Member

Hold on a second - I see four pack-it jobs running in CI right now. Shouldn't these run only when the PR merges? (Again, I don't grok packit, so maybe this is desired, but this looks like a lot of churn for very little benefit)

@TomSweeneyRedHat
Copy link
Member

I too am not a packit person. From what I can see, LGTM

@edsantiago
Copy link
Member

Before this merges, I'd like @containers/buildah-maintainers to confirm that they're OK with having these jobs run on every PR, for many many hours. (I have no timing data, because all packit jobs show "completed in 0s", but I know that I looked at this PR page several times today, and packit jobs were spinning for at least two hours, probably longer).

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

Hold on a second - I see four pack-it jobs running in CI right now. Shouldn't these run only when the PR merges? (Again, I don't grok packit, so maybe this is desired, but this looks like a lot of churn for very little benefit)

In .packit.yaml, there's a trigger: pull_request which will trigger copr builds on rhcontainerbot/packit-builds copr, which is what you see in the gating task list on the PR.

After the PR is merged (IOW, commit to main branch), the trigger: commit part in .packit.yaml will trigger builds on rhcontainerbot/podman-next copr.

So, different sets of tasks for different coprs, one to check if every PR builds, and the other for users to install after upstream merge.

RE: benefit, I'd rather build issues get caught in PR than after upstream tag release. Also, this doesn't depend on the official distro spec file anymore and the config file is a lot simpler too with a lot of the configuration handled in rhcontainerbot/packit-builds itself.

RE: completed in 0s, I can check with the packit devs.

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

@edsantiago I filed packit/packit-service#1970 for succeeded in 0s issue.

@rhatdan
Copy link
Member

rhatdan commented Mar 23, 2023

@lsm5 do you expect this PR to add any time to the build, or do you expect the new tests to pass within the ~1 hour that tests currently take to run?

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

@lsm5 do you expect this PR to add any time to the build, or do you expect the new tests to pass within the ~1 hour that tests currently take to run?

Right now, s390x seems to be taking the longest and sometimes also ppc64le. I can remove those for now (from the copr itself which would remove those for the other repos too) and limit all our packit jobs to x86_64 and aarch64.

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

Disabled s390x and ppc64le in the copr. Let's give this another try.

/packit copr-build

@rhatdan
Copy link
Member

rhatdan commented Mar 23, 2023

SGTM, since those are most likely to be down or busy. And I think your tests on x86 will catch the bulk of errors.
/lgtm
/hold

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

Here's the latest copr_build that got triggered https://copr.fedorainfracloud.org/coprs/rhcontainerbot/packit-builds/build/5698195/

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

let me update the commit message again to show we are only doing x86_64 and aarch64 for now.

This commit adds Packit configuration files which will trigger rpm
builds on copr:`rhcontainerbot/packit-builds` on every PR as well as on
copr:`rhcontainerbot/podman-next` on every commit to main branch.

This commit will ensure main branch is always buildable on all supported
Fedora and CentOS Stream versions for aarch64 and x86_64.
TODO: enable build checks for s390x and ppc64le while ensuring they
don't take too long to build.

The packit builds reuse `buildah.spec.rpkg` present upstream and are
thus independent of Fedora / CentOS dist-git.

This change will remove the need for the current webhook based triggering
of rpm builds on rhcontainerbot/podman-next after commit to main.
That will be instead handled by the `trigger: commit` action added in this
PR. New builds will continue to get posted to the same link so users
don't need to change any existing copr repo configuration.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
@rhatdan
Copy link
Member

rhatdan commented Mar 23, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Mar 23, 2023
@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

@edsantiago copr build times should be drastically reduced now and the 0s issue is on packit's radar. Please let me know if you still got any other concerns. I'll remove the slash-hold only after you green light this :)

@edsantiago
Copy link
Member

@lsm5 it sgtm in theory, I just really know nothing about packit and am uncomfortable with reliance on something that can add hours to a CI run. (Thank you for addressing the rare-arches slowness, it's just that I have zero sense for the packit farm and what other unreliabilities it may have). But, in the spirit of optimism:

/hold cancel

@openshift-merge-robot openshift-merge-robot merged commit c7e522a into containers:main Mar 23, 2023
@lsm5
Copy link
Member Author

lsm5 commented Mar 23, 2023

@lsm5 it sgtm in theory, I just really know nothing about packit and am uncomfortable with reliance on something that can add hours to a CI run. (Thank you for addressing the rare-arches slowness, it's just that I have zero sense for the packit farm and what other unreliabilities it may have). But, in the spirit of optimism:

/hold cancel

Ack, gotcha. Please let me know the moment you see it causing any further annoyances. I've filed a bunch of RFEs with the packit team, so things should only get better :) .

@lsm5 lsm5 deleted the packit branch March 23, 2023 14:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants