-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add missing params for podman-remote build #9275
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan 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 |
test/system/070-build.bats
Outdated
FROM docker.io/library/busybox AS build | ||
RUN rm -f /bin/paste | ||
USER 1001 | ||
COPY --from=docker.io/library/busybox /bin/paste /test/ |
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.
Could I encourage you to s;docker.io/library/;quay.io/libpod/;
?
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.
Yup cut and pasted from Buildah.
48f44c3
to
a3a83ed
Compare
3c24c52
to
5b7e061
Compare
Fixes: #9290 |
The fedora-33 test failed during an update of ubutnu. I've hit re-run. |
CpuQuota int64 `schema:"cpuquota"` // nolint | ||
CpuSetCpus string `schema:"cpusetcpus"` // nolint | ||
CpuShares uint64 `schema:"cpushares"` // nolint | ||
Compression uint64 `schema:"compression"` // nolint |
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.
nit Compression before ConfigureNetwork
One nit of a nit, otherwise |
Restarted flakes |
I think the compose ones are real. For some reason when the Docker API is used, the network is not being setup correctly. |
dffd1e7
to
3b07b9f
Compare
4aa9c61
to
50f415c
Compare
Fixes: containers#9290 Currently we still have hard coded --isolation=chroot for podman-remote build. Implement missing arguments for podman build Implements --jobs, --disable-compression, --excludes Fixes: MaxPullPushRetries RetryDuration Signed-off-by: Daniel J Walsh <[email protected]>
@containers/podman-maintainers PTAL |
if utils.IsLibpodRequest(r) { | ||
// isolation = buildah.Isolation(query.Isolation) |
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.
should we drop this commented code?
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.
Lets merge this. I waiting to open a PR to fix this as soon as this PR merges.
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
@test "build with copy-from referencing the base image" { | ||
skip_if_rootless "cannot mount as rootless" | ||
target=busybox-derived | ||
target_mt=busybox-mt-derived | ||
tmpdir=$PODMAN_TMPDIR/build-test | ||
mkdir -p $tmpdir | ||
containerfile1=$tmpdir/Containerfile1 | ||
cat >$containerfile1 <<EOF | ||
FROM quay.io/libpod/busybox AS build | ||
RUN rm -f /bin/paste | ||
USER 1001 | ||
COPY --from=quay.io/libpod/busybox /bin/paste /test/ | ||
EOF | ||
containerfile2=$tmpdir/Containerfile2 | ||
cat >$containerfile2 <<EOF | ||
FROM quay.io/libpod/busybox AS test | ||
RUN rm -f /bin/nl | ||
FROM quay.io/libpod/alpine AS final | ||
COPY --from=quay.io/libpod/busybox /bin/nl /test/ | ||
EOF | ||
run_podman build -t ${target} -f ${containerfile1} ${tmpdir} | ||
run_podman build --jobs 4 -t ${target} -f ${containerfile1} ${tmpdir} | ||
|
||
run_podman build -t ${target} -f ${containerfile2} ${tmpdir} | ||
run_podman build --no-cache --jobs 4 -t ${target_mt} -f ${containerfile2} ${tmpdir} | ||
|
||
# (can only test locally; podman-remote has no image mount command) | ||
if ! is_remote; then | ||
run_podman image mount ${target} | ||
root_single_job=$output | ||
|
||
run_podman image mount ${target_mt} | ||
root_multi_job=$output | ||
|
||
# Check that both the version with --jobs 1 and --jobs=N have the same number of files | ||
test $(find $root_single_job -type f | wc -l) = $(find $root_multi_job -type f | wc -l) | ||
fi | ||
} | ||
|
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.
@rhatdan @nalind I realize this is already merged, but I'm afraid this test is almost entirely a NOP. I've spent the last hour-plus trying to clean it up, and am forced to give up because I don't truly understand its purpose. Is it to test the --jobs
option? To test COPY --from
? I'm going to need to rewrite the whole thing, and I would be grateful for any hints on how to do so.
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.
The basic idea, I believe since @nalind wrote it for Buildah, was to run the same build twice once with multiple --jobs and make sure that the output in the end was the same.
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.
Thank you! In that case, are lines 476-477 (the first two builds) needed? Or for that matter containerfile1
?
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.
@nalind WDYT?
Rereading the tests, I stole this from, I am now not sure what it is testing.
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.
The test was originally to ensure that when COPY --from was given an image name rather than a name we'd given to a build stage, that it would pull content from the unmodified image rather than a stage that was based on it, which was a bug that we'd fixed.
The parts that ran builds both with and without --jobs and counted the files in containers based on the resulting images, to check that the results from both were comparable, were mixed in later rather than added as a separate test.
- cp test: clean up stray image - build test: add workaround for containers#9567 (ultra-slow ubuntu). We're seeing CI flakes (timeouts) due to ubuntu 2004 being absurdly slow. Workaround: double our timeout on one specific test when ubuntu + remote. - build test: clean up new copy-from test (from containers#9275). The test was copy-pasted from buildah system tests, without really adapting for podman environment (e.g. it was using images that we don't use here, and would cause pulls, which will cause flakes). Rewrite test so it references only $IMAGE, remove some confusing/unnecessary stuff, selectively run parts of it even when rootless or remote, and add a test to confirm that copy-from succeeded. - load test: add error-message test to new load-invalid (containers#9672). Basically, make sure the command fails for the right reason. - play test (kube): use $IMAGE, not alpine; and add pause-image cleanup to teardown() - apiv2 mounts test: add a maintainability comment in a tricky section of code; and tighten up the mount point test. Signed-off-by: Ed Santiago <[email protected]>
Currently we still have hard coded --isolation=chroot for podman-remote build.
Implement missing arguments for podman build
Implements
--jobs, --disable-compression, --excludes
Fixes:
MaxPullPushRetries
RetryDuration
Signed-off-by: Daniel J Walsh [email protected]