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

Add missing params for podman-remote build #9275

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Feb 8, 2021

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]

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2021
FROM docker.io/library/busybox AS build
RUN rm -f /bin/paste
USER 1001
COPY --from=docker.io/library/busybox /bin/paste /test/
Copy link
Member

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/; ?

Copy link
Member Author

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.

@rhatdan rhatdan force-pushed the build branch 2 times, most recently from 48f44c3 to a3a83ed Compare February 9, 2021 15:56
@rhatdan rhatdan force-pushed the build branch 2 times, most recently from 3c24c52 to 5b7e061 Compare February 9, 2021 19:27
@rhatdan
Copy link
Member Author

rhatdan commented Feb 9, 2021

Fixes: #9290

@TomSweeneyRedHat
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

nit Compression before ConfigureNetwork

@TomSweeneyRedHat
Copy link
Member

TomSweeneyRedHat commented Feb 9, 2021

One nit of a nit, otherwise
LGTM

@vrothberg
Copy link
Member

Restarted flakes

@rhatdan
Copy link
Member Author

rhatdan commented Feb 10, 2021

I think the compose ones are real. For some reason when the Docker API is used, the network is not being setup correctly.

@rhatdan rhatdan force-pushed the build branch 4 times, most recently from dffd1e7 to 3b07b9f Compare February 13, 2021 11:52
@rhatdan rhatdan changed the title Use confined OCI by default for builds Add missing params for podman-remote build Feb 13, 2021
@rhatdan rhatdan force-pushed the build branch 3 times, most recently from 4aa9c61 to 50f415c Compare February 16, 2021 09:53
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]>
@rhatdan
Copy link
Member Author

rhatdan commented Feb 21, 2021

@containers/podman-maintainers PTAL
@vrothberg @giuseppe @mheon PTAL

if utils.IsLibpodRequest(r) {
// isolation = buildah.Isolation(query.Isolation)
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2021
@openshift-merge-robot openshift-merge-robot merged commit 10d52c0 into containers:master Feb 22, 2021
Comment on lines +456 to +494
@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
}

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

@edsantiago edsantiago mentioned this pull request Mar 15, 2021
edsantiago added a commit to edsantiago/libpod that referenced this pull request Mar 15, 2021
- 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]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants