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

fmf discover copies the whole source directory #3453

Open
imphil opened this issue Jan 8, 2025 · 0 comments
Open

fmf discover copies the whole source directory #3453

imphil opened this issue Jan 8, 2025 · 0 comments

Comments

@imphil
Copy link

imphil commented Jan 8, 2025

The fmf discover implementation copies the whole source directory (fmf_root) to the working directory in (in my case) /var/tmp/tmt/run-009/packages/my-package/plans/232-0-0/discover/default-0/. In my case, the source directory contains many gigabytes of build outputs. Copying all this data takes a many minutes on our CI runners (yes, network-attached slow disk). The whole tree is copied, .gitignore is not honored (unlike in other copy steps that are done with rsync).

This is the code in question:

self.info('directory', directory, 'green')
if not dist_git_source or dist_git_merge:
self.debug(f"Copy '{directory}' to '{self.testdir}'.")
if not self.is_dry_run:
shutil.copytree(directory, self.testdir, symlinks=True)

I tried, but there are too many file copies and conditional code paths going on for me to really see what a good solution could be. I observed that the shell discovery plugin uses symlinks (#953). Changing the code to use symlinks makes things work for me with for local execution, but not when executing inside a container. Do you have a suggestion how to fix this issue? I'm happy to do the implementation.

Steps to reproduce

  1. Have a directory with a working tmt setup and many GB of (unrelated) files in it.

  2. Run the discover step, e.g. (in my case)

    $ tmt run discover -vvv plan --name /packages/my-package/plans/232.0.0 provision --how local --feeling-safe
    /var/tmp/tmt/run-001
     Found 22 plans.
     /packages/my-package/plans/230.0.0
     summary: Smoke test for my-package
         discover
             how: fmf
             order: 50
             directory: /my/workdir
    
     		LONG WAIT HERE
    
             hash: e7c193a
             filter: tag:targets-my-package
             summary: 1 test selected
                 /packages/my-package/tests/smoke
         provision
             queued provision.provision task #1: default-0
    
  3. Observe the output to hang after the line starting with directory: until the file copy has completed.

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

No branches or pull requests

1 participant