2012-05-23 22:44:11 +00:00
|
|
|
=========================================
|
|
|
|
Cloning the Ceph Source Code Repository
|
|
|
|
=========================================
|
2012-11-08 06:17:46 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To clone a Ceph branch of the Ceph source code, go to `github Ceph
|
|
|
|
Repository`_, select a branch (``main`` by default), and click the **Download
|
|
|
|
ZIP** button.
|
2012-05-23 22:44:11 +00:00
|
|
|
|
2013-10-22 20:25:13 +00:00
|
|
|
.. _github Ceph Repository: https://github.com/ceph/ceph
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To clone the entire git repository, :ref:`install <install-git>` and configure
|
|
|
|
``git``.
|
2013-10-22 20:25:13 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. _install-git:
|
2013-10-22 20:25:13 +00:00
|
|
|
|
|
|
|
Install Git
|
|
|
|
===========
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To install ``git`` on Debian/Ubuntu, run the following command:
|
|
|
|
|
|
|
|
.. prompt:: bash $
|
|
|
|
|
|
|
|
sudo apt-get install git
|
2013-10-22 20:25:13 +00:00
|
|
|
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To install ``git`` on CentOS/RHEL, run the following command:
|
2014-07-10 18:30:00 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. prompt:: bash $
|
2014-07-10 18:30:00 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
sudo yum install git
|
2014-07-10 18:30:00 +00:00
|
|
|
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
You must have a ``github`` account. If you do not have a ``github``
|
|
|
|
account, go to `github.com`_ and register. Follow the directions for setting
|
|
|
|
up git at `Set Up Git`_.
|
2013-10-22 20:25:13 +00:00
|
|
|
|
2017-10-23 11:26:28 +00:00
|
|
|
.. _github.com: https://github.com
|
|
|
|
.. _Set Up Git: https://help.github.com/linux-set-up-git
|
2013-10-22 20:25:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
Add SSH Keys (Optional)
|
|
|
|
=======================
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To commit code to Ceph or to clone the respository by using SSH
|
2013-10-22 20:25:13 +00:00
|
|
|
(``git@github.com:ceph/ceph.git``), you must generate SSH keys for github.
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. tip:: If you want only to clone the repository, you can
|
2013-10-22 20:25:13 +00:00
|
|
|
use ``git clone --recursive https://github.com/ceph/ceph.git``
|
|
|
|
without generating SSH keys.
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To generate SSH keys for ``github``, run the following command:
|
|
|
|
|
|
|
|
.. prompt:: bash $
|
|
|
|
|
|
|
|
ssh-keygen
|
2013-10-22 20:25:13 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To print the SSH key that you just generated and that you will add to your
|
|
|
|
``github`` account, use the ``cat`` command. (The following example assumes you
|
|
|
|
used the default file path.):
|
2013-10-22 20:25:13 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. prompt:: bash $
|
2013-10-22 20:25:13 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
cat .ssh/id_rsa.pub
|
2013-10-22 20:25:13 +00:00
|
|
|
|
|
|
|
Copy the public key.
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
Go to your ``github`` account, click "Account Settings" (represented by the
|
|
|
|
'tools' icon), and click "SSH Keys" on the left side navbar.
|
2013-10-22 20:25:13 +00:00
|
|
|
|
|
|
|
Click "Add SSH key" in the "SSH Keys" list, enter a name for the key, paste the
|
|
|
|
key you generated, and press the "Add key" button.
|
2012-05-23 22:44:11 +00:00
|
|
|
|
2012-11-08 06:17:46 +00:00
|
|
|
|
2012-05-23 22:44:11 +00:00
|
|
|
Clone the Source
|
2012-11-08 06:17:46 +00:00
|
|
|
================
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
To clone the Ceph source code repository, run the following command:
|
2012-05-23 22:44:11 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. prompt:: bash $
|
2012-05-23 22:44:11 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
git clone --recursive https://github.com/ceph/ceph.git
|
|
|
|
|
|
|
|
After ``git clone`` has run, you should have a full copy of the Ceph
|
2012-05-23 22:44:11 +00:00
|
|
|
repository.
|
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. tip:: Make sure you maintain the latest copies of the submodules included in
|
|
|
|
the repository. Running ``git status`` will tell you whether the submodules
|
|
|
|
are out of date. See :ref:`update-submodules` for more information.
|
2012-11-08 06:17:46 +00:00
|
|
|
|
2012-05-23 22:44:11 +00:00
|
|
|
|
2022-12-10 20:25:13 +00:00
|
|
|
.. prompt:: bash $
|
|
|
|
|
|
|
|
cd ceph
|
|
|
|
git status
|
2012-05-23 22:44:11 +00:00
|
|
|
|
2022-10-12 08:27:42 +00:00
|
|
|
.. _update-submodules:
|
|
|
|
|
|
|
|
Updating Submodules
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
#. Determine whether your submodules are out of date:
|
|
|
|
|
|
|
|
.. prompt:: bash $
|
|
|
|
|
|
|
|
git status
|
|
|
|
|
2022-10-12 12:39:36 +00:00
|
|
|
A. If your submodules are up to date
|
2022-10-12 08:27:42 +00:00
|
|
|
If your submodules are up to date, the following console output will
|
|
|
|
appear:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
On branch main
|
|
|
|
Your branch is up to date with 'origin/main'.
|
|
|
|
|
|
|
|
nothing to commit, working tree clean
|
|
|
|
|
|
|
|
If you see this console output, then your submodules are up to date.
|
|
|
|
You do not need this procedure.
|
|
|
|
|
|
|
|
|
2022-10-12 12:39:36 +00:00
|
|
|
B. If your submodules are not up to date
|
2022-10-12 08:27:42 +00:00
|
|
|
If your submodules are not up to date, you will see a message that
|
|
|
|
includes a list of "untracked files". The example here shows such a
|
|
|
|
list, which was generated from a real situation in which the
|
|
|
|
submodules were no longer current. Your list of files will not be the
|
|
|
|
same as this list of files, but this list is provided as an example.
|
|
|
|
If in your case any untracked files are listed, then you should
|
|
|
|
continue to the next step of this procedure.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
On branch main
|
|
|
|
Your branch is up to date with 'origin/main'.
|
|
|
|
|
|
|
|
Untracked files:
|
|
|
|
(use "git add <file>..." to include in what will be committed)
|
|
|
|
src/pybind/cephfs/build/
|
|
|
|
src/pybind/cephfs/cephfs.c
|
|
|
|
src/pybind/cephfs/cephfs.egg-info/
|
|
|
|
src/pybind/rados/build/
|
|
|
|
src/pybind/rados/rados.c
|
|
|
|
src/pybind/rados/rados.egg-info/
|
|
|
|
src/pybind/rbd/build/
|
|
|
|
src/pybind/rbd/rbd.c
|
|
|
|
src/pybind/rbd/rbd.egg-info/
|
|
|
|
src/pybind/rgw/build/
|
|
|
|
src/pybind/rgw/rgw.c
|
|
|
|
src/pybind/rgw/rgw.egg-info/
|
|
|
|
|
|
|
|
nothing added to commit but untracked files present (use "git add" to track)
|
|
|
|
|
|
|
|
#. If your submodules are out of date, run the following commands:
|
|
|
|
|
|
|
|
.. prompt:: bash $
|
|
|
|
|
|
|
|
git submodule update --force --init --recursive
|
|
|
|
git clean -fdx
|
2022-12-10 20:25:13 +00:00
|
|
|
git submodule foreach git clean -fdx
|
|
|
|
|
|
|
|
If you still have problems with a submodule directory, use ``rm -rf
|
|
|
|
[directory name]`` to remove the directory. Then run ``git submodule update
|
|
|
|
--init --recursive`` again.
|
2022-10-12 08:27:42 +00:00
|
|
|
|
|
|
|
#. Run ``git status`` again:
|
|
|
|
|
|
|
|
.. prompt:: bash $
|
|
|
|
|
|
|
|
git status
|
|
|
|
|
|
|
|
Your submodules are up to date if you see the following message:
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
On branch main
|
|
|
|
Your branch is up to date with 'origin/main'.
|
|
|
|
|
|
|
|
nothing to commit, working tree clean
|
2012-08-02 15:29:50 +00:00
|
|
|
|
2012-05-23 22:44:11 +00:00
|
|
|
Choose a Branch
|
2012-11-08 06:17:46 +00:00
|
|
|
===============
|
|
|
|
|
2012-05-23 22:44:11 +00:00
|
|
|
Once you clone the source code and submodules, your Ceph repository
|
2022-10-06 04:30:07 +00:00
|
|
|
will be on the ``main`` branch by default, which is the unstable
|
2012-05-23 22:44:11 +00:00
|
|
|
development branch. You may choose other branches too.
|
|
|
|
|
2022-10-06 04:30:07 +00:00
|
|
|
- ``main``: The unstable development branch.
|
2022-11-15 20:03:46 +00:00
|
|
|
- ``stable-release-name``: The name of the stable, `Active Releases`_. e.g. ``Pacific``
|
2012-05-23 22:44:11 +00:00
|
|
|
- ``next``: The release candidate branch.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2022-10-06 04:30:07 +00:00
|
|
|
git checkout main
|
2022-11-15 20:03:46 +00:00
|
|
|
|
|
|
|
.. _Active Releases: https://docs.ceph.com/en/latest/releases/#active-releases
|