-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(executor): add executable permission to staged script
#12787
Conversation
Signed-off-by: Ingvar Mattsson <[email protected]>
I must say that I am not entirely sure how the test failures relate to this change. They seem to relate to completely different things. |
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.
verified that pod logs no longer had a
/argo/staging/script: permission denied
in them
interestingly I've not seen this error before -- I wonder why it just popped up for you and hasn't popped up before for others?
script
Even more interestingly, I get the permission error for some images, but not for others (for the ones where this change was required, I also needed to include "shebang" lines listing an interpreter). I have not managed to nail down what the actual difference between these are. I can have a look at making the permission/mode value variable and setting it to 0o755 only for scripts. |
Signed-off-by: Ingvar <[email protected]>
This lines up with what I'm suspecting, which is that this might be a shell form vs. exec form instance or something similar. Like if you have a script without executable permissions, you can still run it with, e.g. Looking at the code, the path to the |
Certainly, the images that I can recall failing are on private repos (and, thus, as detailed in #11159 , the workflow controller cannot read the command from the image when constructing the pod), I have tried both |
Signed-off-by: Ingvar <[email protected]>
Signed-off-by: Ingvar <[email protected]>
This is the command and args from the relevant pod:
I still cannot explain why it works in some cases and fail in others. |
Sorry for the delayed response; I wanted to take some time to see if we could root cause this and have been pretty overloaded. Thanks for looking more into this.
This is surprising... based on this and your main container's
This shouldn't matter, it has no impact on the
Based on my analysis in #11159 (comment), since we don't know the mode of the |
This is what Argo puts in the pod's
This is with the configmap configured to have that image mapped to: cmd:
- /bin/bash |
Apparently, per #13549, there was a separate issue filed exclusively for the script exec perms in #3496. Given both of those and the above, this is probably worthwhile to have in its own right, regardless of the Emissary nuances |
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.
Thanks for finding, fixing, and iterating on this again!
…#12787) Signed-off-by: Ingvar Mattsson <[email protected]> Signed-off-by: Ingvar <[email protected]> Co-authored-by: Ingvar Mattsson <[email protected]> Co-authored-by: Anton Gilgur <[email protected]>
Signed-off-by: Ingvar Mattsson <[email protected]> Signed-off-by: Ingvar <[email protected]> Co-authored-by: Ingvar Mattsson <[email protected]> Co-authored-by: Anton Gilgur <[email protected]>
I found the problem here. The bug is that for This is fixable by changing the ordering, but may be a breaking change for For clarity, the full [
"/var/run/argo/argoexec",
"emissary",
"--loglevel",
"info",
"--log-format",
"text",
"--",
"<k8s command OR, if not present, docker entrypoint>"
],
[
"<k8s args OR, if not present, docker cmd>",
"/argo/staging/script"
] where |
Fixes #3496
Motivation
As-was, staged scripts end up with the permission
0644
(rw-r--r--)
which is less than useful for shell scripts. With this modification in place, the scripts are executable.Modifications
Changed file permissions for the staged script.
Verification
Built a docker image of
argoexec
, changed the workflow-controller flags to use the private image and verified that pod logs no longer had a/argo/staging/script: permission denied
in them