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

Support container provisioner in toolbox #3228

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thrix
Copy link
Collaborator

@thrix thrix commented Sep 19, 2024

For Fedora Silverblue users it is common to run podman via flatpak-spawn --host which runs podman on the host system itself. This requires to pass the toolbox container name when running podman cp to correctly copy stuff from the toolbox container, where tmt is installed to the provisioned container.

Fixes #1020

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

For Fedora Silverblue users it is common to run podman
via `flatpak-spawn --host` which runs podman on the host
system itself. This requires to pass the toolbox container
name when running `podman cp` to correctly copy stuff
from the toolbox container, where `tmt` is installed
to the provisioned container.

Fixes #1020

Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
@thrix
Copy link
Collaborator Author

thrix commented Sep 19, 2024

@jkonecny12 this is the change I talked about, with it tmt container provisioner works well :)

if line.startswith('name="'):
return line[6:-1]

return None
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two look like they belong to guest facts, as they are properties of a machine similar to has_selinux or arch, for example. Once moved, you would reach them via self.parent.plan.my_run.runner.facts.*.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks for the pointers

@functools.cached_property
def _is_toolbox(self) -> bool:
""" Return ``True`` if running in toolbox, ``False`` otherwise. """
if os.path.exists('/run/.toolboxenv'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

os.path should be replaced with Path().exists()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

need to remember we use pathlib here :)

@thrix thrix added this to the 1.37 milestone Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve TMT user experience on SilverBlue system
2 participants