]> git.proxmox.com Git - ceph.git/blame - ceph/doc/dev/developer_guide/essentials.rst
update ceph source to reef 18.1.2
[ceph.git] / ceph / doc / dev / developer_guide / essentials.rst
CommitLineData
9f95a23c
TL
1Essentials (tl;dr)
2==================
3
4This chapter presents essential information that every Ceph developer needs
5to know.
6
7Leads
8-----
9
1e59de90
TL
10The Ceph project was created by Sage Weil and is led by the Ceph Leadership
11Team (CLT). In addition, each major project component has its own lead. The
12following table shows all the leads and their nicks on `GitHub`_:
9f95a23c
TL
13
14.. _github: https://github.com/
15
16========= ================ =============
17Scope Lead GitHub nick
18========= ================ =============
19Ceph Sage Weil liewegas
20RADOS Neha Ojha neha-ojha
21RGW Yehuda Sadeh yehudasa
22RGW Matt Benjamin mattbenjamin
20effc67 23RBD Ilya Dryomov dis
1e59de90 24CephFS Venky Shankar vshankar
20effc67 25Dashboard Ernesto Puerta epuertat
9f95a23c
TL
26MON Joao Luis jecluis
27Build/Ops Ken Dreyer ktdreyer
f67539c2 28Docs Zac Dover zdover23
9f95a23c
TL
29========= ================ =============
30
31The Ceph-specific acronyms in the table are explained in
32:doc:`/architecture`.
33
34History
35-------
36
37See the `History chapter of the Wikipedia article`_.
38
39.. _`History chapter of the Wikipedia article`: https://en.wikipedia.org/wiki/Ceph_%28software%29#History
40
41Licensing
42---------
43
44Ceph is free software.
45
46Unless stated otherwise, the Ceph source code is distributed under the
47terms of the LGPL2.1 or LGPL3.0. For full details, see the file
48`COPYING`_ in the top-level directory of the source-code tree.
49
50.. _`COPYING`:
51 https://github.com/ceph/ceph/blob/master/COPYING
52
53Source code repositories
54------------------------
55
56The source code of Ceph lives on `GitHub`_ in a number of repositories below
57the `Ceph "organization"`_.
58
59.. _`Ceph "organization"`: https://github.com/ceph
60
f67539c2 61A working knowledge of git_ is essential to make a meaningful contribution to the project as a developer.
9f95a23c
TL
62
63.. _git: https://git-scm.com/doc
64
65Although the `Ceph "organization"`_ includes several software repositories,
66this document covers only one: https://github.com/ceph/ceph.
67
68Redmine issue tracker
69---------------------
70
71Although `GitHub`_ is used for code, Ceph-related issues (Bugs, Features,
72Backports, Documentation, etc.) are tracked at http://tracker.ceph.com,
73which is powered by `Redmine`_.
74
75.. _Redmine: http://www.redmine.org
76
77The tracker has a Ceph project with a number of subprojects loosely
78corresponding to the various architectural components (see
79:doc:`/architecture`).
80
81Mere `registration`_ in the tracker automatically grants permissions
82sufficient to open new issues and comment on existing ones.
83
84.. _registration: http://tracker.ceph.com/account/register
85
86To report a bug or propose a new feature, `jump to the Ceph project`_ and
87click on `New issue`_.
88
89.. _`jump to the Ceph project`: http://tracker.ceph.com/projects/ceph
90.. _`New issue`: http://tracker.ceph.com/projects/ceph/issues/new
91
39ae355f
TL
92Slack
93-----
94
95Ceph's Slack is https://ceph-storage.slack.com/.
96
f67539c2 97.. _mailing-list:
9f95a23c 98
f67539c2
TL
99Mailing lists
100-------------
101
102Ceph Development Mailing List
20effc67 103~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9f95a23c
TL
104The ``dev@ceph.io`` list is for discussion about the development of Ceph,
105its interoperability with other technology, and the operations of the
106project itself.
107
f67539c2
TL
108The email discussion list for Ceph development is open to all. Subscribe by
109sending a message to ``dev-request@ceph.io`` with the following line in the
110body of the message::
9f95a23c
TL
111
112 subscribe ceph-devel
113
9f95a23c 114
f67539c2 115Ceph Client Patch Review Mailing List
20effc67 116~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9f95a23c
TL
117The ``ceph-devel@vger.kernel.org`` list is for discussion and patch review
118for the Linux kernel Ceph client component. Note that this list used to
f67539c2
TL
119be an all-encompassing list for developers. When searching the archives,
120remember that this list contains the generic devel-ceph archives before mid-2018.
9f95a23c 121
f67539c2
TL
122Subscribe to the list covering the Linux kernel Ceph client component by sending
123a message to ``majordomo@vger.kernel.org`` with the following line in the body
124of the message::
9f95a23c
TL
125
126 subscribe ceph-devel
127
9f95a23c 128
f67539c2 129Other Ceph Mailing Lists
20effc67 130~~~~~~~~~~~~~~~~~~~~~~~~
9f95a23c
TL
131
132There are also `other Ceph-related mailing lists`_.
133
134.. _`other Ceph-related mailing lists`: https://ceph.com/irc/
135
f67539c2
TL
136.. _irc:
137
9f95a23c
TL
138
139IRC
140---
141
f67539c2
TL
142In addition to mailing lists, the Ceph community also communicates in real time
143using `Internet Relay Chat`_.
9f95a23c
TL
144
145.. _`Internet Relay Chat`: http://www.irchelp.org/
146
20effc67
TL
147The Ceph community gathers in the #ceph channel of the Open and Free Technology
148Community (OFTC) IRC network.
149
150Created in 1988, Internet Relay Chat (IRC) is a relay-based, real-time chat
151protocol. It is mainly designed for group (many-to-many) communication in
152discussion forums called channels, but also allows one-to-one communication via
153private message. On IRC you can talk to many other members using Ceph, on
154topics ranging from idle chit-chat to support questions. Though a channel might
155have many people in it at any one time, they might not always be at their
156keyboard; so if no-one responds, just wait around and someone will hopefully
157answer soon enough.
158
159Registration
160~~~~~~~~~~~~
161
162If you intend to use the IRC service on a continued basis, you are advised to
163register an account. Registering gives you a unique IRC identity and allows you
164to access channels where unregistered users have been locked out for technical
165reasons.
166
2a845540
TL
167See ``the official OFTC (Open and Free Technology Community) documentation's
168registration instructions
169<https://www.oftc.net/Services/#register-your-account>`` to learn how to
170register your IRC account.
20effc67
TL
171
172Channels
173~~~~~~~~
174
175To connect to the OFTC IRC network, download an IRC client and configure it to
176connect to ``irc.oftc.net``. Then join one or more of the channels. Discussions
177inside #ceph are logged and archives are available online.
178
179Here are the real-time discussion channels for the Ceph community:
180
181 - #ceph
182 - #ceph-devel
183 - #cephfs
184 - #ceph-dashboard
185 - #ceph-orchestrators
186 - #sepia
187
9f95a23c 188
f67539c2
TL
189.. _submitting-patches:
190
9f95a23c
TL
191Submitting patches
192------------------
193
194The canonical instructions for submitting patches are contained in the
195file `CONTRIBUTING.rst`_ in the top-level directory of the source-code
196tree. There may be some overlap between this guide and that file.
197
198.. _`CONTRIBUTING.rst`:
2a845540 199 https://github.com/ceph/ceph/blob/main/CONTRIBUTING.rst
9f95a23c
TL
200
201All newcomers are encouraged to read that file carefully.
202
203Building from source
204--------------------
205
206See instructions at :doc:`/install/build-ceph`.
207
208Using ccache to speed up local builds
209-------------------------------------
f67539c2
TL
210`ccache`_ can make the process of rebuilding the ceph source tree faster.
211
212Before you use `ccache`_ to speed up your rebuilds of the ceph source tree,
213make sure that your source tree is clean and will produce no build failures.
214When you have a clean source tree, you can confidently use `ccache`_, secure in
215the knowledge that you're not using a dirty tree.
216
217Old build artifacts can cause build failures. You might introduce these
218artifacts unknowingly when switching from one branch to another. If you see
219build errors when you attempt a local build, follow the procedure below to
220clean your source tree.
9f95a23c 221
f67539c2 222Cleaning the Source Tree
20effc67 223~~~~~~~~~~~~~~~~~~~~~~~~
9f95a23c 224
f67539c2 225.. prompt:: bash $
9f95a23c 226
20effc67 227 ninja clean
f67539c2
TL
228
229.. note:: The following commands will remove everything in the source tree
230 that isn't tracked by git. Make sure to back up your log files
231 and configuration options before running these commands.
9f95a23c 232
f67539c2 233.. prompt:: bash $
9f95a23c 234
f67539c2 235 git clean -fdx; git submodule foreach git clean -fdx
9f95a23c 236
f67539c2 237Building Ceph with ccache
20effc67
TL
238~~~~~~~~~~~~~~~~~~~~~~~~~
239
f67539c2
TL
240``ccache`` is available as a package in most distros. To build ceph with
241ccache, run the following command.
9f95a23c 242
f67539c2 243.. prompt:: bash $
9f95a23c 244
f67539c2 245 cmake -DWITH_CCACHE=ON ..
9f95a23c 246
f67539c2 247Using ccache to Speed Up Build Times
20effc67
TL
248~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249
f67539c2
TL
250``ccache`` can be used for speeding up all builds of the system. For more
251details, refer to the `run modes`_ section of the ccache manual. The default
252settings of ``ccache`` can be displayed with the ``ccache -s`` command.
253
254.. note:: We recommend overriding the ``max_size``. The default is 10G.
255 Use a larger value, like 25G. Refer to the `configuration`_ section
256 of the ccache manual for more information.
9f95a23c
TL
257
258To further increase the cache hit rate and reduce compile times in a
f67539c2
TL
259development environment, set the version information and build timestamps to
260fixed values. This makes it unnecessary to rebuild the binaries that contain
261this information.
9f95a23c
TL
262
263This can be achieved by adding the following settings to the ``ccache``
264configuration file ``ccache.conf``::
265
266 sloppiness = time_macros
267 run_second_cpp = true
268
269Now, set the environment variable ``SOURCE_DATE_EPOCH`` to a fixed value (a
270UNIX timestamp) and set ``ENABLE_GIT_VERSION`` to ``OFF`` when running
f67539c2
TL
271``cmake``:
272
273.. prompt:: bash $
9f95a23c 274
f67539c2
TL
275 export SOURCE_DATE_EPOCH=946684800
276 cmake -DWITH_CCACHE=ON -DENABLE_GIT_VERSION=OFF ..
9f95a23c
TL
277
278.. note:: Binaries produced with these build options are not suitable for
279 production or debugging purposes, as they do not contain the correct build
280 time and git version information.
281
282.. _`ccache`: https://ccache.samba.org/
283.. _`run modes`: https://ccache.samba.org/manual.html#_run_modes
284.. _`configuration`: https://ccache.samba.org/manual.html#_configuration
285
286Development-mode cluster
287------------------------
288
289See :doc:`/dev/quick_guide`.
290
291Kubernetes/Rook development cluster
292-----------------------------------
293
294See :ref:`kubernetes-dev`
295
f67539c2
TL
296.. _backporting:
297
9f95a23c
TL
298Backporting
299-----------
300
2a845540 301All bugfixes should be merged to the ``main`` branch before being
9f95a23c
TL
302backported. To flag a bugfix for backporting, make sure it has a
303`tracker issue`_ associated with it and set the ``Backport`` field to a
304comma-separated list of previous releases (e.g. "hammer,jewel") that you think
305need the backport.
306The rest (including the actual backporting) will be taken care of by the
307`Stable Releases and Backports`_ team.
308
309.. _`tracker issue`: http://tracker.ceph.com/
310.. _`Stable Releases and Backports`: http://tracker.ceph.com/projects/ceph-releases/wiki
311
2a845540
TL
312Dependabot
313----------
314
315Dependabot is a GitHub bot that scans the dependencies in the repositories for
316security vulnerabilities (CVEs). If a fix is available for a discovered CVE,
317Dependabot creates a pull request to update the dependency.
318
319Dependabot also indicates the compatibility score of the upgrade. This score is
320based on the number of CI failures that occur in other GitHub repositories
321where the fix was applied.
322
323With some configuration, Dependabot can perform non-security updates (for
324example, it can upgrade to the latest minor version or patch version).
325
326Dependabot supports `several languages and package managers
327<https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates#supported-repositories-and-ecosystems>`_.
328As of July 2022, the Ceph project receives alerts only from pip (based on the
329`requirements.txt` files) and npm (`package*.json`). It is possible to extend
330these alerts to git submodules, Golang, and Java. As of July 2022, there is no
331support for C++ package managers such as vcpkg, conan, C++20 modules.
332
333Many of the dependencies discovered by Dependabot will best be updated
334elsewhere than the Ceph Github repository (distribution packages, for example,
335will be a better place to update some of the dependencies). Nonetheless, the
336list of new and existing vulnerabilities generated by Dependabot will be
337useful.
338
339`Here is an example of a Dependabot pull request.
340<https://github.com/ceph/ceph/pull/46998>`_
341
9f95a23c
TL
342Guidance for use of cluster log
343-------------------------------
344
345If your patches emit messages to the Ceph cluster log, please consult
f67539c2 346this: :doc:`/dev/logging`.