Virtualization within OpenMOLE

Virtualization has been implemented within OpenMOLE.

For instance, in this MOLE, the task "hello" launches a VM and execute commands inside this VM:

import org.openmole.core.implementation.capsule.*
import org.openmole.plugin.task.groovy.*
import org.openmole.core.implementation.mole.*
import org.openmole.plugin.task.systemexec.*
import org.openmole.plugin.resource.virtual.*
import org.openmole.core.implementation.data.*
import org.openmole.core.implementation.transition.*
fileForVM = new Prototype("fileForVM", File)
file = new Prototype("file", File)
generateFileForVM = new GroovyTask("generateFileFor")
generateFileForVM.setCode("fileForVM = workspace.newTmpFile();\nfileForVM.write('Hello from groovy');\n")
generateFileForVM.addOutput(fileForVM)
virtualMachine = new VirtualMachineResource("/home/reuillon/Documents/Tmp/qemu/lucid_mini_comp.img","root","toor")
hello = new VirtualSystemExecTask("hello",virtualMachine,"hostname ; pwd ; echo `cat fileForVM` and also hello from vm >file")
hello.exportFileFromContextAs(fileForVM, "fileForVM")
hello.importFileInContext(file, "file")
disp = new GroovyTask("disp")
disp.setCode("println 'read from groovy: ' + file.text")
disp.addInput(file)
generateFileForVMC = new TaskCapsule(generateFileForVM)
helloC = new TaskCapsule(hello)
dispC = new TaskCapsule(disp)
new SingleTransition(generateFileForVMC, helloC)
new SingleTransition(helloC, dispC)
new Mole(generateFileForVMC).run()

The result of this MOLE is:

ubuntu
/root/fd394922-1e8d-441b-889b-8e052b8e43c0
read from groovy: Hello from groovy and also hello from vm

More testing has to be done.

For now OpenMOLE virtualization supports only GNU/Linux host. We need to compile qemu for Windows, MacOS, *BSD, Solaris and so on.

Next work will be to integrate legacy scientific software such as Scilab, Octave and R.

Comments

No comments.

Add New Comment



logo cemagref

logo iscpif

logo lifegrid

logo region auvergne

logo patres project