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
Mount the stdout callback plugin for containerized runs #957
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b01fca4
Support custom stdout callbacks
shanemcd 6b83c6b
Refactor things down to a single stdout callback module
shanemcd 0a705c2
Condense callback to 1 class, enable in BaseConfig
AlanCoding 837e83e
Switch test to stdout callback in ansible.builtin
AlanCoding f098e00
Use correct metric for IS_ADHOC determination
AlanCoding 49026da
Accomidate other config classes
AlanCoding d7eb76a
Remove test hack
AlanCoding 70be623
Code move for single-file display callback
AlanCoding ee15e0b
Remove noqa comments with config change
AlanCoding dd8349f
Move display callback to required name
AlanCoding 55d716c
Code and test changes for callback volume mount
AlanCoding 851f4d3
Change mount location and introduce shared method
AlanCoding df44cea
Workaround when install is not owned by current user
AlanCoding 3c3a461
Add test to simulate non-root container run
AlanCoding File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 this might break if you install runner as root in the system site packages and then run as a non-root user, because you won't be able to relabel a file you dont own.
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.
Maybe try
:O
instead of:Z
?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.
yeah, this sounds more right to me, but I haven't been able to figure out how to artificially create the error to validate it fixes it. I got it to these permissions:
Then as the awx user, it still works. Is there any tweak I can do which should make this break?
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.
wait, never mind, I was running the wrong thing. I am able to get an error with this type of setup. Right now it just gives the vague message
But I'm still tinkering with the install by root user.
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.
Testing the
:0
in one environment, I getI'm not sure how big of a problem this is going to be. In another environment it works. Reading related issues, people mention that kernel version needs to be relatively recent for a metacopy setting. Depending on what we support, I could see this getting complicated.
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.
Okay, trying on my own machine, I was able to reproduce something by doing only this:
Resulting in
So maybe I am figuring this out. Here, specifically, with root ownership and
-rw-rw-r--.
permissions, the display callback is not editable for the current user. Like you say, that shouldn't be a problem. I fear that:O
will not work in all the contexts that we need it to... but it wouldn't be atypical for runner to create a new tmpdir to make something work. We could do this with a copy of the display callback. We know it should only be a few files.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.
Having a replicator, I developed a patch that fixes it.
I did not use the
:O
, because I'm worried this won't work in all cases. Instead, I copied the files (possible if you only have read access) to a tmpdir, and mounted the tmpdir.Tomorrow I can work on a test case for this logic.