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

buildkit: Add support for --mount=type=tmpfs to allow mounting volatile memory instead of persistent storage. #3575

Merged

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Oct 7, 2021

Following PR adds supports for buildkit like --mount=type=tmpfs which
allows end users to mount a chunk of volatile memory instead of a persistent storage device within container.

Usage

RUN --mount=type=tmpfs,target=/sometarget

@openshift-ci openshift-ci bot added the approved label Oct 7, 2021
@flouthoc flouthoc changed the title buildkit: Add support for --mount=type=tmpfs buildkit: Add support for --mount=type=tmpfs to allow mounting volatile memory instead of persistent storage. Oct 7, 2021
@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2021

We might want to add our own --mount=type=overlay.

@@ -2400,6 +2400,13 @@ func (b *Builder) runSetupRunMounts(mounts []string, secrets map[string]string,
}
finalMounts = append(finalMounts, *mount)
mountTargets = append(mountTargets, mount.Destination)
case "tmpfs":
mount, err := b.getTmpfsMount(tokens, rootUID, rootGID, processUID, processGID)
Copy link
Member

Choose a reason for hiding this comment

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

Just curious does this default to tmpcopyup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rhatdan No buildah mount does not adds tmpcopyup during builds by default but we can add it an as option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added tmpcopyup as a new option in separate commit.

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2021

Missing Man page changes?

@TomSweeneyRedHat
Copy link
Member

Less the missing man pages, LGTM

@dilyanpalauzov
Copy link
Contributor

https://github.com/containers/buildah/blob/main/docs/Containerfile.5.md is not updated about RUN --mount=type=tmpfs .

@flouthoc flouthoc force-pushed the buildkit-tmpfs-support branch from 8378a2f to 0bb755d Compare October 8, 2021 07:53
Following PR adds supports for buildkit like `--mount=type=tmpfs` which
allows end users to mount a chunk of volatile memory instead of a persistent storage device.

Signed-off-by: Aditya Rajan <[email protected]>
@flouthoc flouthoc force-pushed the buildkit-tmpfs-support branch 3 times, most recently from 210242f to a0fd279 Compare October 8, 2021 08:03
@flouthoc
Copy link
Collaborator Author

flouthoc commented Oct 8, 2021

https://github.com/containers/buildah/blob/main/docs/Containerfile.5.md is not updated about RUN --mount=type=tmpfs .

@dilyanpalauzov It was already part of https://github.com/containers/buildah/blob/main/docs/buildah-run.1.md but was not supported in containerfile this PR makes sure that it is also supported in Containefile.But I agree man page for Containerfile is outdated. Added new options to Containerfile man pages in a separate commit.

@rhatdan
Copy link
Member

rhatdan commented Oct 8, 2021

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.

Code LGTM but a test for tmpcopyup is missing.

@flouthoc flouthoc force-pushed the buildkit-tmpfs-support branch from a0fd279 to 3ac8621 Compare October 8, 2021 11:40
@flouthoc
Copy link
Collaborator Author

flouthoc commented Oct 8, 2021

@vrothberg thanks added test for tmpcopyup in latest commit.

@vrothberg
Copy link
Member

@vrothberg thanks added test for tmpcopyup in latest commit.

LGTM, thank you. Not worth repushing but: the tests are noew in the docs commit.

@flouthoc flouthoc force-pushed the buildkit-tmpfs-support branch from 3ac8621 to f1f008a Compare October 8, 2021 11:56
@flouthoc
Copy link
Collaborator Author

flouthoc commented Oct 8, 2021

@vrothberg thanks added test for tmpcopyup in latest commit.

LGTM, thank you. Not worth repushing but: the tests are noew in the docs commit.

@vrothberg thanks for noticing :) fixed.

@rhatdan
Copy link
Member

rhatdan commented Oct 8, 2021

/lgtm
/approve
/hold

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 8, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, 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

@flouthoc
Copy link
Collaborator Author

flouthoc commented Oct 8, 2021

/hold cancel

@openshift-merge-robot openshift-merge-robot merged commit 94b305c into containers:main Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants