Jenkins Master/Slave Windows - python

Just want a clarification of the following. I am currently in the process of transferring a Bamboo plan into a Jenkins one and everything was working fine up until the point I ran a Python script on my CentOS Virtual Machine. The reason being that Python wants to import a library called winreg which is not available on RedHat distributions.
In order to fix this, I wanted to have my Master be a CentOS machine and my slave be a Windows 10 machine. Is that how it works? Will the plan be built on the Windows 10 machine while the output is handled by the CentOS machine?
Thanks

Yes, it will. This is usual Jenkins using - see documentation.

Related

node.js spawn python child process on Windows Virtual Machine

I have right now a node.js backend where I'm spawning a Python child_process. The Python file executes successfully and returns the data correctly. However in production, the node.js backend will run on a linux server and the python script needs to be run in a Windows environment.
Is there any possible way to spawn the python process directly on a Windows Virtual Machine instead of the current server? If not, what would be possible alternatives besides using a Windows server for node.js?
I don't think, that in this case the versions really matter, but here they are:
node.js 12.16.2
Python: 3.8.2
Linux server: Ubuntu

How to run python script on multiple remote machine? without installing the script?

I created a simple python script which can give what kind of operating system it is using. But I want this script to run multiple remote machine at a same time without installing it on other machine on the same network. Is it possible to run this script on remote machine without installing this script on remote machine? . I saw with ssh python can do this .
Based on the way your question is worded, I think the answer is no.
If you want to run a python script on a remote machine, you will need to have a python interpreter of some kind available on the remote machine to execute the code.

Run Ansible-Playbook on localhost on Windows

I know Ansible supports Windows clients/nodes. What I really enjoy about Ansible is that I can create a Linux VM, pull a git repo that contains Ansible playbooks for and without any configuration or setup of a control server, I am able to run the playbook on the local machine.
Since you can execute Python on Windows, would it be possible to run roles/playbooks on localhost on Windows?
This would be the first step for running Ansible in a datacenter with only Windows where it is not possible to even run Linux in VirtualBox.
Ansible won't run on a windows control machine, as stated in the documentation:
Reminder: You Must Have a Linux Control Machine
Note running Ansible from a Windows control machine is NOT a goal of the project. Refrain from asking for this feature, as it limits what technologies, features, and code we can use in the main project in the future. A Linux control machine will be required to manage Windows hosts.
Cygwin is not supported, so please do not ask questions about Ansible running from Cygwin.

Cannot automate a remote program using python and dogtail, no graphical interface in the remote server…

I wrote a code using python and dogtail (automation program from redhat) to automate a program. This program is running in a virtual machine without desktop graphical environment.
I ssh the virtual machine and run the program and the graphical interface start on my machine.
I then run my python program on my machine to automate this program. And here is the problem... the python code does not work because it did not recognize the remote program that is run via ssh. And if I move the python code to the virtual machine it asks me to enable the “assistive technologies” and I can’t because I do not have gnome or any graphical environment in the virtual machine?
All used operating systems are Ubuntu…
I try to find solution everywhere without success. I wish I explain the problem clearly, if not please let me know...
Please help… thank you
There is a dogtail-run-headless-next binary in dogtail and it should be able to start X (or more precisely gdm service) and log in (with autologin of test user). Then it's parameter is executed in desktop environment.
we use (under root)
sudo -u test dogtail-run-headless-next "./your_script"
I hope this will enable assistive technology, too. If not you can always use:
if not isA11yEnabled():
enableA11y(True)
You can automate ssh into a machine via pexpect. See new: http://pexpect.readthedocs.org/en/latest/api/pxssh.html
or older:
http://pexpect.sourceforge.net/pexpect.html

Is it possible to run pydev connected to a virtualbox instance?

At the moment I'm developing using a simple editor, putty, and a VirtualBox instance of a linux server. I've heard good things about pydev and would like to try it, but I'd like to use the python install & terminal from my VirtualBox guest OS.
I'm already using a Shared Folder with VirtualBox so my Guest OS can see my local files.
Is it possible to tell pydev to use this "remote" host over SSH to execute its python-related commands?
UPDATE:
My main environment is windows, but I'd also like to be able to work this way on OS X.
I assume your host box is windows.
I also assume that pydev will run under linux (since it's eclipse based). Are you ok installing the dev environment on your linux server?
In which case:
install and run xming on your windows box
Install eclipse & pydev on your linux box
Configure x forwarding in putty
Run pydev through putty and you'll have the UI appear on your windows machine like normal
Then pydev will be running on the linux box quite happily, and so using the python environment on there.
Downsides: you will need to install the X libraries & java on your server (installing eclipse using your normal package manager should be enough), although you won't need to run X itself, since that's what Xming is for.
UPDATE:
Let me understand the situation, Windows is hosting the virtualBox which host the linux.
You connect to the linux using putty.
Python files are on the linux machine and you wish to edit them from your Windows using pydev. So either do that using the sharing features of virtual box (which can work for you in vboth ways) or use ssh to edit the linux files from windows.
both options would be valid for MacOSx AFAIK
Below you cna find the way to do so over SSH
You map a netwrok drive over SSH and then you can access the files via that drive letter
see more at
http://www.neophob.com/serendipity/index.php?/archives/103-Map-a-Network-drive-net-use-over-SSH.html
and
http://smithii.com/map_a_network_drive_over_ssh_in_windows

Categories

Resources