-
Notifications
You must be signed in to change notification settings - Fork 122
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 Fedora Image Mode #3229
base: main
Are you sure you want to change the base?
Conversation
With tmt from this MR: teemtee/tmt#3229 Signed-off-by: Miroslav Vadkerti <[email protected]>
8c1c5db
to
b447a6a
Compare
5617f1e
to
71c72d1
Compare
To support Fedora Image mode the following changes were required: * Fix `rsync` installation. The tool is not included in the distribution and the installation method was completely broken, i.e. `rpm-ostree` has no `--install-root` option. We did not hit it as there is no good testing environment available that would cover this. * Introduce `TMT_SCRIPTS_DEST_DIR` environment variable set by default to `/var/tmp/tmt/bin` which hosts the `tmt` scripts. The original path is not writable on these systems. The `PATH` is set system wide via a new `/etc/profile.d/tmt.sh` script. Signed-off-by: Miroslav Vadkerti <[email protected]>
71c72d1
to
4d0abe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand it correctly, that the intention is to have default directory which is writable on all platforms, as opposed to having a default directory, which would be changed if 'default' is not writable?
517fb79
to
0b923ee
Compare
To support Fedora Image mode the following changes were required: * Fix `rsync` installation. The tool is not included in the distribution and the installation method was completely broken, i.e. `rpm-ostree` has no `--install-root` option. We did not hit it as there is no good testing environment available that would cover this. * Introduce `TMT_SCRIPTS_DEST_DIR` environment variable set by default to `/var/tmp/tmt/bin` which hosts the `tmt` scripts. The original path is not writable on these systems. The `PATH` is set system wide via a new `/etc/profile.d/tmt.sh` script. Signed-off-by: Miroslav Vadkerti <[email protected]>
0b923ee
to
97d2b90
Compare
Signed-off-by: Miroslav Vadkerti <[email protected]>
Btw we agreed on getting this into Testing Farm sooner than 1.38, once we verify it does not break anything. |
Please vote for the new location in this discussion poll: |
What about SELinux? Given this dir hosts executables, it should be assigned with the respective selinux context. |
I am also interested to know. It looks like that alternative location would require some system "bending" and I am not sure if doing this by default Is a good approach. I expect that most tested systems won't be bootc. |
Thanks, depending on the discussion we can adjust the SELinux context. I did not yet see a problem with this with the current path |
Bending is already in place and we talked about proper documentation. Feel free to read the MR docs being added. |
options=["-p", "--chmod=755"], | ||
superuser=guest.facts.is_superuser is not True) | ||
with script as source: | ||
for dest in [script.path, *script.aliases]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thrix Not related to the problem this PR is addressing, but I thought it might be a good idea to bring it up since we're doing changes in this code:
I've noticed the copying of the scripts can take quite some time when copying to remote host and I suspect it could be vastly sped-up if we copy them in batch instead of one at a time.
If you say it's more suitable to handle in separate PR, I'll open an issue to not forget about it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinhoyer yes please, not definitely something for this patch :)
@@ -597,16 +680,18 @@ def prepare_tests(self, guest: Guest, logger: tmt.log.Logger) -> list[TestInvoca | |||
|
|||
def prepare_scripts(self, guest: "tmt.steps.provision.Guest") -> None: | |||
""" Prepare additional scripts for testing """ | |||
# Create scripts directory | |||
guest.execute(Command("mkdir", "-p", str(effective_scripts_dest_dir()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using rsync with --mkpath
?
Actually, there is also --executability
or --perms
/--chmod
to get rid of the other ssh command.
(again, can be a separate PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martinhoyer rsync --mkpath was added in rsync 3.2.3 (6 Aug 2020). I wonder if it will work on all supported OSes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I did check that before writing the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That option has to exist for rsync on the guest as well, right? If so we definitely cannot use that as rhel-7 has just rsync-3.1.2
/packit test |
To support Fedora Image mode the following changes were required:
Fix
rsync
installation. The tool is not included in the distribution andthe installation method was completely broken, i.e.
rpm-ostree
hasno
--install-root
option. We did not hit it as there is no goodtesting environment available that would cover this.
Introduce
TMT_SCRIPTS_DEST_DIR
environment variable set by defaultto
/var/tmp/tmt/bin
which hosts thetmt
scripts. The original pathis not writable on these systems. The
PATH
is set system wide via anew
/etc/profile.d/tmt.sh
script.Signed-off-by: Miroslav Vadkerti [email protected]
Pull Request Checklist