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

builder/daemonless: pass through /dev/kvm if present #410

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $ oc patch configmap openshift-controller-manager-images -n openshift-controller
6. Watch the openshift controller manager pods rollout (this can take a few minutes):

```
$ oc get ds controller-manager -n openshift-controller-manager -w
$ oc get deployment controller-manager -n openshift-controller-manager -w
```

7. Trigger an OpenShift build via `oc start-build`. You can use one of the templates suggested in `oc new-app` to populate your project with a build.
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM registry.fedoraproject.org/fedora:34
FROM registry.fedoraproject.org/fedora:40
LABEL io.k8s.display-name="OpenShift Origin Builder" \
io.k8s.description="This is a component of OpenShift Origin and is responsible for executing image builds." \
io.openshift.tags="openshift,builder"

RUN INSTALL_PKGS=" \
bind-utils bsdtar findutils fuse-overlayfs git hostname lsof \
procps-ng runc socat tar tree util-linux wget which glibc\
procps-ng runc socat tar tree util-linux wget which glibc netavark \
" && \
yum install -y --setopt=skip_missing_names_on_install=False ${INSTALL_PKGS} && \
yum clean all
Expand Down
8 changes: 8 additions & 0 deletions pkg/build/builder/daemonless.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@ func buildDaemonlessImage(sc types.SystemContext, store storage.Store, isolation
// in runtime-tools's generator logic.
seccompProfilePath := "/usr/share/containers/seccomp.json"

// If we have /dev/kvm, pass it down to the build process since it likely means
// that it was allocated to us with that expectation.
devices := []string{}
if _, err := os.Stat("/dev/kvm"); err == nil {
devices = append(devices, "/dev/kvm")
}

options := imagebuildah.BuildOptions{
ContextDirectory: contextDir,
PullPolicy: pullPolicy,
Expand Down Expand Up @@ -334,6 +341,7 @@ func buildDaemonlessImage(sc types.SystemContext, store storage.Store, isolation
MaxPullPushRetries: DefaultPushOrPullRetryCount,
PullPushRetryDelay: DefaultPushOrPullRetryDelay,
SkipUnusedStages: types.OptionalBoolFalse,
Devices: devices,
}

if os.Getenv("BUILDAH_QUIET") == "true" {
Expand Down