Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Thanks for writing in! Technically, you could execute a shell script in a plugin, however, you cannot convert a Shell recipe into a plugin as you can do with R or Python. Without knowing what your goal is, it's hard to say what your best options might be, but you can execute a shell script in a Python Notebook, convert it to a recipe and then convert the recipe into a plugin (as shown below). If you could describe in detail what you are trying to accomplish, we would be happy to provide you with possible solutions.
Also, I recommend taking a look at our documentation on Plugin Development: https://doc.dataiku.com/dss/latest/plugins/index.html
I did execute a shell script from a python plugin by using the `subprocess` library.
Now how can I pass in my credentials to the shell script so the shell script has all the same permissions that I have?
It appears that the shell script cannot access some of the resources that the python script has no issue with.
Additionally, when that shell script fires off a separate python file, that python file also does not have the same credentials that I have.
How can I pass my credentials to a separate python file ?
I do want to do this securely and anytime this plugin runs and any bash or python subprocess that gets executed by the plugin, should be able to adopt the credentials of the person that ran it.
Thus far, it appears that the only python files that run with my credentials are the plugin's recipe.py file and nothing else.
I would suggest trying the python library, Pexpect, which you can find more information on here: https://pexpect.readthedocs.io/en/stable/
You can find examples using Pexpect as well as the subprocess.popen class(used to execute and send data to a child process) here: https://stackoverflow.com/questions/25189348/unable-to-provide-password-to-a-process-with-subprocess...
Please let us know if you have any questions.