Back to DevDoc
Virtualization
Virtualization is a good way for embedding binaries programs needed in a OpenMole workflow.
The problem with binaries programs is to ensure their portability for distribution and reproduceability.
The idea is to provide a bridge between OpenMole and a virtual machine where you can install your needed software. Then, this virtual machine can be easily deployed on target computer.
Qemu / Debian
We're making first attemps with Qemu and Debian GNU/Linux virtual machine. Qemu is a free software that provides good performance and is easily deployable on several systems. We have chosen Debian GNU/Linux for the guest operating system, for its well-known software repository that provides many scientific software already packaged.
See also this first attempt.
How to build an Ubuntu VM
Ubuntu is a distribution derivated from Debian. Here is some notes for building your own VM image:
- install qemu
- get a fresh installed ubuntu VM (like this one)
- start the VM with this command (adjust the local port 2223 to a free port on your machine, and yourVM.img to the filename of your image)
qemu -redir tcp:2223::22 -hda yourVM.img -nographic -monitor null -serial none
- login into the booted VM (in the providen sample, the password is toor)
ssh -p 2223 root@localhost
- install needed softwares with apt-get and maybe compile your non-prebuilt software
- logout, close qemu, your VM is ready
Example with Octave
You can for example easily build a portable and reproductible workflow with your Octave scripts.
- Let's install Octave (apt-get install octave-3.2) or download this prebuilt image.
- Consider this classical script in file script.m:
printf ("Hello, world!\n"); - You can now run your octave script with this workflow:
wd=new File(System.getProperty("user.dir")).getParent()+File.separator import org.openmole.plugin.resource.virtual.VirtualMachineResource import org.openmole.plugin.task.systemexec.VirtualSystemExecTask octaveCmd = 'octave -qf script.m' virtualMachine = new VirtualMachineResource(wd+"VMoctave.img", "root", "toor") octaveTask = new VirtualSystemExecTask("octave", virtualMachine, octaveCmd) octaveTask.addInFile(new File(wd+"script.m")) exec = builder.buildMoleExecution(octaveTask) exec.start()





