Run .exe executable file from Dataiku DSS on Remote Windows Server through SSH connection

laurelix
Level 1
Run .exe executable file from Dataiku DSS on Remote Windows Server through SSH connection

Hello, 

Is it possible to run .exe file on remote windows server when an activity is triggered in dataiku.
I was thinking using SSH connection.

On theory, SSh enable user to run exe from Linux to Windows with this command

ssh user@hostwindows calc.exe : this command from linux can run calculator on remote windows server.

I was thinking I will wrap that ssh command over python and run with scenarios within dataiku.
I only try using ! on jupyter notebook to process this

!ssh user@hostwindows calc.exe

but i don't know how to input the password. i also tried subprocess.

My question is 

1. how to run command from dataiku like ssh user@hostwindows calc.exe

2. is there any way I can run exe from dataiku dss?

Thank you, your help will be much appreciated

 

 

0 Kudos
4 Replies
AlexT
Dataiker

Hi,

You may want o look at https://pypi.org/project/WMI/  or https://pypi.org/project/pywinrm/

Add one of those libraries to the code environment and execute a recipe based on those.

If you do want to use SSH you can as long as the Windows Server is running SSH. It's best to avoid having to enter passwords in scripts.  Instead, create an SSH key on the DSS server and add the public key to authorized_keys on the Windows server.

Then you can issue the ssh command using subprocess, os command using ssh -i /path/.ssh/key_name username@host  to initiate the password-less connection.

https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement#standar... 

 

 

0 Kudos
laurelix
Level 1
Author

Thank you! yes i will try that out, i was thinking about that too. But, I don't have the access to the dataiku dss root folder where dataiku is installed, it's managed by our clients IT team.

I might have to ask for that permission. 
Thank you!

0 Kudos
modichirag
Level 1

Is this solution only applicable when dataiku installed in Windows and not in Linux? If it is only applicable for windows machine, Could you provide a solution on how to proceed when dataiku is installed in Linux machine?

0 Kudos
tgb417

@modichirag ,

First Iโ€™ve not made a scenario like this work personally.  If anyone here has I invite you to jump in on this thread. But here are a few thoughts that  come to mind.

As you already likely know windows .exe files only run natively under the windows operating system. One can run some windows .exe programs on Linux using some additional software like wine or by running some form of virtualization.

If you have an existing .exe program that does an important data transformation for you.  I would first see if I could get the .exe file to run on Linux from the terminal without Dataiku. Can I run the entire process from the command line. (This would likely work best with programs that does not have a graphical interface.) If I could do that successfully. 

Second Iโ€™d look to determine where the .exe returns itโ€™s results.  Do the results get returned to the terminal window or to a file on the file system. You may be able to use the shell visual recipe to use this .exe from within Dataiku DSS.

https://doc.dataiku.com/dss/latest/code_recipes/shell.html

Personally from a reliability and security point of view Iโ€™m not sure that I would try an approach like this. Iโ€™d likely look for a native Linux solution or a Native Dataiku solution rather than trying to use an existing .exe program in this way.  

Good luck.  Let us know how you get on with your project. 

--Tom
0 Kudos