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

Run buildah steps without privileged containers #1370

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

apoorvajagtap
Copy link
Member

@apoorvajagtap apoorvajagtap commented Sep 1, 2023

Changes

The current Shipwright strategy examples use privileged containers to run buildah.

With the current PR these have been updated to use more limited permissions/capabilities and align with Tekton task for OpenShift pipelines.

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

Release Notes

The BuildAh sample build strategies now do not anymore run privileged containers

@openshift-ci openshift-ci bot added the release-note Label for when a PR has specified a release note label Sep 1, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 1, 2023
@apoorvajagtap
Copy link
Member Author

/assign @adambkaplan @coreydaley

@SaschaSchwarze0
Copy link
Member

@apoorvajagtap please set the release note in your PR description.

@SaschaSchwarze0 SaschaSchwarze0 added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 1, 2023
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.12.0 milestone Sep 1, 2023
@apoorvajagtap
Copy link
Member Author

apoorvajagtap commented Sep 1, 2023

@adambkaplan @coreydaley the buildah_shipwright_managed_push buildstrategy needs an additional capability (along with the one provided with pipelines-scc by default). So, how one should tackle with the SCC alignment with such buildrun pods?
Would it be efficient to update the pipelines-scc to make the required capability available (along with setfcap)?

@qu1queee qu1queee self-requested a review September 1, 2023 10:10
@apoorvajagtap apoorvajagtap force-pushed the BUILD-681 branch 2 times, most recently from 0c6d2f4 to e702979 Compare September 5, 2023 18:35
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 6, 2023
test/buildstrategy_samples.go Outdated Show resolved Hide resolved
test/clusterbuildstrategy_samples.go Show resolved Hide resolved
@SaschaSchwarze0 SaschaSchwarze0 removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 6, 2023
@coreydaley
Copy link
Contributor

@apoorvajagtap I think you just need to add

 - name: storage-driver
      description: "The storage driver to use, such as `overlay` or `vfs`"
      type: string
      default: "vfs"
      # For details see the "--storage-driver" section of https://github.com/containers/buildah/blob/main/docs/buildah.1.md#options

Like you did in the other yamls

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 7, 2023
@SaschaSchwarze0
Copy link
Member

@apoorvajagtap I suggest to remove the change to MinimalBuildahBuildStrategy and leave it like it was. The idea of this build strategy is to be simple. In particular the unit test expects it to have no parameters.

@apoorvajagtap apoorvajagtap force-pushed the BUILD-681 branch 4 times, most recently from aaa9d86 to f636a0d Compare September 12, 2023 06:19
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2023
@apoorvajagtap
Copy link
Member Author

@SaschaSchwarze0 I just want to highlight that the buildstrategy_buildah_shipwright_managed_push will still need the privileged permissions for the container, as it requires DAC_OVERRIDE along with the SETFCAP which isn't provided by default with the pipelines SA. So, should we specify the buildstrategies name in the Release notes? i.e.

The buildah_strategy_managed_push sample build strategy now does not anymore run privileged containers

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2023
@SaschaSchwarze0
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 2023
@openshift-merge-robot openshift-merge-robot merged commit dfd25b6 into shipwright-io:main Sep 21, 2023
@apoorvajagtap apoorvajagtap deleted the BUILD-681 branch September 21, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants