coreos / layering-examples

Apache License 2.0
111 stars 24 forks source link

github: Unify and build all examples in PRs #37

Closed travier closed 1 year ago

travier commented 1 year ago

Fixes: https://github.com/coreos/coreos-layering-examples/issues/24

travier commented 1 year ago

We need one workflow per container image build to be able to trigger on path changes and thus avoid rebuilding images that have not changed.

cgwalters commented 1 year ago

We need one workflow per container image build to be able to trigger on path changes and thus avoid rebuilding images that have not changed.

Oh, I see. Hmm. Wait now I'm confused, what's going on with this "podman-next" thing? I don't see that file in this PR?

I think we can do change detection even in a matrix job.

Also, I suspect it wouldn't be too bad right now to just build all examples on every PR.

Not opposed to this to be clear, if you'd rather merge as is I'm OK with that too.

travier commented 1 year ago

Whoops, I forgot to update some path matches indeed. podman-next mentions come from https://github.com/coreos/coreos-layering-examples/pull/36.

I don't know how to do "at the GitHub Action" level change detection with matrix jobs.

travier commented 1 year ago

The main issue with rebuilding everything for each PR is that if we want to start pushing those examples automatically / on a schedule to a Quay repo then this will rebuild and push images that did not change for each commit.

travier commented 1 year ago

I had to do that for https://github.com/toolbx-images/images (and I even have distinct workflows for PR & push there).

travier commented 1 year ago

https://github.com/actions/runner/issues/456

travier commented 1 year ago

selinux:

mv: cannot remove '/etc/selinux/targeted/active/modules/100/bumblebee': Directory not empty
255
error building at STEP "RUN mv /etc/selinux/targeted/active{,.tmp} && mv /etc/selinux/targeted/active{.tmp,} &&     setsebool -P -N container_manage_cgroup 1": error while running runtime: exit status 1
jmarrero commented 1 year ago

selinux:

mv: cannot remove '/etc/selinux/targeted/active/modules/100/bumblebee': Directory not empty
255
error building at STEP "RUN mv /etc/selinux/targeted/active{,.tmp} && mv /etc/selinux/targeted/active{.tmp,} &&     setsebool -P -N container_manage_cgroup 1": error while running runtime: exit status 1

We can avoid the workaround by using the next stream on this example until it gets promoted to stable. Next already has the SELinux fix we need and will simplify the example to:

FROM quay.io/fedora/fedora-coreos:next

RUN setsebool -P -N container_manage_cgroup 1

Change for consideration on: https://github.com/coreos/coreos-layering-examples/pull/39

travier commented 1 year ago
Failed to commit changes to booleans: Directory not empty
error building at STEP "RUN setsebool -P -N container_manage_cgroup 1": error while running runtime: exit status 255
travier commented 1 year ago

OK, let's merge this one so that we can check future PRs fixing this one?

travier commented 1 year ago

Made https://github.com/coreos/coreos-layering-examples/issues/41 to track it