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 support for passing CDI specs to --device #5443

Merged
merged 4 commits into from
Apr 1, 2024

Commits on Mar 28, 2024

  1. pkg/parse.DeviceFromPath(): dereference src symlinks

    When the passed-in source location is a symbolic link, dereference it,
    because the documentation says that's what we do.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    2a7ff99 View commit details
    Browse the repository at this point in the history
  2. Update comments on some API objects

    Avoid generically referring to "the container" where it can be ambiguous
    that we're actually talking about the environment we set up for running
    a command for a RUN instruction or Run() call.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    14bf3db View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. Add support for passing CDI specs to --device

    Add support for using CDI to resolve `--device` devices for RUN
    instructions during `buildah build`, `buildah from`, and `buildah run`,
    as `podman run` does.
    
    This generally requires that we stop resolving device specifications
    (arguments passed to --device) earlier and deferring that until it's
    time to run a process, because CDI wants to pick over those values,
    modify a runtime spec to set up the ones that it knows about, and then
    hand back the list of values that it doesn't know about.
    
    We don't want to do a dry run of this during CLI processing because that
    would create a window where the underlying hardware state could change,
    and that could produce some hard-to-diagnose errors.
    
    Being able to test this is going to require that we add the `--device`
    flag to `buildah run` (`--security-opt` affects how we build the
    container's layer, so it has to be done at `buildah from`).
    
    The default configured devices list is pulled in by CLI flag processing
    during `buildah from` and `buildah build`, so it doesn't also need to be
    explicitly passed to `buildah run` or the internal Run() method.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    5198af7 View commit details
    Browse the repository at this point in the history
  2. Man page updates

    Describe --device in `buildah from` and `buildah run`, where it's new.
    Update the description of --device in `buildah build` to note that the
    device nodes are only there while RUN instructions are being run, and
    not to imply that they end up in the finished image.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    f812c89 View commit details
    Browse the repository at this point in the history