Setup the development environment on local


#1

Dear OpenNebula Developers,

I am trying to set up the development environment for OpenNebula on my local system.
I have cloned the repository (https://github.com/OpenNebula/one) and imported the same into IDE.
I have also started following documentation (https://docs.opennebula.org/5.6/integration/references/compile.html) but it would help in building the code to make it installable and not run or debug in the IDE itself.

Is it possible to set up such environment (similar to a web application where we can install a web server on local system and code could be run on local server or could be debugged from an IDE).
I guess in case of OpenNebula development environment , I need to somehow connect Hypervisor , external dependencies with the editor to make code run or debug in the editor itself !

Any leads or step by step documentation for this would be really appreciated as I would be doing some source code modification for the research purpose and need to test and debug my changes live.

Many Thanks in advance !


(Jan Orel) #2

Hello

Thank you for your interest in OpenNebula. I am afraid at the moment there is no prepared setup or step-by-step how-to for the development.

However, to setup the playground you can use the new evaluation tool [minione] (https://github.com/OpenNebula/minione/tree/v5.6.0).

Some code, mostly drivers (ruby, shell), you can modify directly on the server where you install it. But if your intention is to change the oned core you would perhaps still need to compile from the source as you mentioned.

Hope this helps, best regards
Jan


(Juan Jose Montiel Cano) #3

In my case, I use Virsual Studio Code and I have a launch.json file to debug the code. But I always compile the code before lauch the debugger.

launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "OpenNebula (GDB)",
        "type": "cppdbg",
        "request": "launch",
        "program": "$ONE_LOCATION/src/nebula/oned",
        "args": ["-f"],
        "stopAtEntry": false,
        "cwd": "$ONE_LOCATION",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ]
    }
]

}

Also, if you need to compile the code before to execute the debugger or stop one, you can create tasks in a file tasks.json and use the option preLaunchTask in your launch.json to execute these tasks.

“preLaunchTask”: “taskName”


#4

Thank You very much for the feedback.
Much appreciated !


#5

Appreciated the efforts and Thank You !