Skip to content

Developer guide

Enno G edited this page Mar 11, 2022 · 11 revisions

General

  1. Clone the repository: git clone git@github.com:cobbler/cobbler.git
  2. Install the development dependencies (see the individual distros)
  3. Install the runtime dependencies (see the individual distros)
  4. Install the pre-commit commit hocks via pre-commit install (Install via pip install pre-commit)
  5. Optional: Configure your preferred IDE

Docker

You can develop and test Cobbler in our Docker container. See Developing and testing inside a container for more information on that.

SUSE based distros

Development dependencies

$ zypper in git make python3-devel python3-pyflakes python3-Sphinx python3-sphinx_rtd_theme rpm-build

Runtime dependencies

Create a virtualenv, activate it and run pip install . in the project root folder.

Red Hat based distros

The preferred development platform is CentOS 7, you will also need the EPEL repository. Get the latest epel-release RPM from

http://download.fedoraproject.org/pub/epel/7/x86_64/repoview/epel-release.html

Install development dependencies:

# yum install git make python-devel pyflakes python-pep8 python-sphinx rpm-build

Install runtime dependencies:

# yum install python-netaddr python-simplejson PyYAML python-cheetah httpd mod_wsgi

Initially, to run Cobbler without using packages:

# make install

For each successive run, do not run make install again, to avoid blowing away your configuration. Instead run make clean and make devinstall.

This will install Cobbler and restart apache/cobblerd, but move your configuration files and settings aside and restore them, rather than blindly overwriting them.

IDEs to develop with

PyCharm

Just open the project and wait for PyCharm to initialize everything. The defaults should in most cases do the trick.

Visual Studio (Code)

There are several good Python plugins available (e.g. Python, Pylance, Python Indent, Python Test Explorer).

Debugging

If you need to debug a remote process, rpdb provides some very nice capabilities beyond the standard python debugger, just insert an import rpdb; rpdb.set_trace() in your command line, and from the console:

nc localhost 4444

to connect to the debugger.

Branches

Cobbler has a development branch called "master" (where the action is), and branches for all releases that are in maintenance mode. All work on new features should be done against the master branch. If you want to address bugs then please target the latest release branch, also please submit the fix against master. If your fix is specific for a specific release version the submission against master is not needed.

git branch -r
git checkout <branch>
git checkout -b <new branch name>

Website

The website should contain promotional material and more complex guides. More information about how to contribute there, can be found here.