-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
deps: bump to race-free c/image
and c/storage
along with test to verify concurrent/parallel
builds
#13404
deps: bump to race-free c/image
and c/storage
along with test to verify concurrent/parallel
builds
#13404
Conversation
Bump c/storage to main/d06b0f so we podman could use new `race-free` `AddNames` and `RemoveNames` api Signed-off-by: Aditya R <[email protected]>
Bump c/image to upstream main/9a9cd9 so podman could use new race-free code. Signed-off-by: Aditya R <[email protected]>
fe7137e
to
d9b98cf
Compare
093791e
to
009fa0e
Compare
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.
LGTM
/hold |
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.
This does not test what you think it tests. There is no parallelization here anywhere that I can see.
c/image
and c/storage
along with test to verify concurrent/parallel
buildsc/image
and c/storage
along with test to verify concurrent/parallel
builds
I'm rewriting the test. I will post my changes once I'm done. This must not merge. |
This is super-dangerous, it runs the risk of hanging forever, but I can find no way around that.
@test "podman parallel build should not race" {
# Start thirty builds in parallel
local count=30
local -a pids
for i in $(seq --format '%02g' 1 $count); do
local d=$PODMAN_TMPDIR/build-test$i
mkdir $d
cat >$d/Containerfile <<EOF
FROM $IMAGE
RUN echo hi
EOF
$PODMAN build -t i$i $d &>/dev/null &
done
# DANGER DANGER DANGER: this has the potential to hang forever,
# should any individual build fail. I can find no way to add a timeout.
wait
# Now delete each image. If an image wasn't built, rmi will fail
for i in $(seq --format '%02g' 1 $count); do
run_podman rmi i$i
done
} |
could we add the timeout on the podman build command itself, e.g. |
@edsantiago @giuseppe Instead of wait could we use a |
@giuseppe excellent idea, and it seems to work! Thank you! Here's the new code: @test "podman parallel build should not race" {
# Start thirty builds in parallel
local count=30
local -a pids
for i in $(seq --format '%02g' 1 $count); do
local d=$PODMAN_TMPDIR/build-test$i
mkdir $d
cat >$d/Containerfile <<EOF
FROM $IMAGE
RUN echo hi
EOF
timeout --foreground -v --kill=10 60 $PODMAN build -t i$i $d &>/dev/null &
done
wait
# Now delete all built images. If an image wasn't built, rmi will fail
run_podman rmi $(seq --format 'i%02g' 1 $count)
} (note the optimization in the @flouthoc we do not use |
2b7c5ca
to
7879b77
Compare
@edsantiago Thanks a lot for patching the test and i have verified it 👍 it does not fails on my local lets see on the CI. |
Update: here's a cleaner, less sloppy version of the test. Please use this one, it is less misleading (i.e. there is no reason to create multiple Containerfiles; and the comments are better) @test "podman parallel build should not race" {
# Run thirty parallel builds using the same Containerfile
cat >$PODMAN_TMPDIR/Containerfile <<EOF
FROM $IMAGE
RUN echo hi
EOF
local count=30
for i in $(seq --format '%02g' 1 $count); do
timeout --foreground -v --kill=10 60 \
$PODMAN build -t i$i $PODMAN_TMPDIR &>/dev/null &
done
# Wait for all background builds to complete. Note that this succeeds
# even if some of the individual builds fail! Our actual test is below.
wait
# Now delete all built images. If any image wasn't built, rmi will fail
# and test will fail.
run_podman rmi $(seq --format 'i%02g' 1 $count)
} |
c/image
and c/storage
along with test to verify concurrent/parallel
buildsc/image
and c/storage
along with test to verify concurrent/parallel
builds
7879b77
to
063c312
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, flouthoc, giuseppe 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 |
Oops. Looks like you need |
Invoking parallel/concurrent builds from podman race against each other following behviour was fixed in containers/storage#1153 and containers/image#1480 Test verifies if following bug is fixed in new race-free API or not. Read more about this issue, see bz 2055487 for more details. More details here: containers/buildah#3794 and containers#13339 Co-authored-by: Ed Santiago <[email protected]> Signed-off-by: Aditya R <[email protected]>
063c312
to
63f92d0
Compare
/lgtm |
Commits explained in bullet points.
c/storage
tomain/d06b0f
c/image
tomain/9a9cd9
New Names API in
c/storage
andc/image
ensures thatName
modification operations arerace-free
.parallel/concurrent
builds via podman don't race against each other.Read more about problem statement here: containers/buildah#3794 and #13339