Changeset View
Changeset View
Standalone View
Standalone View
docs/getting-started.rst
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | the testing-related dependencies using:: | ||||
pip install $( bin/pip-swh-packages --with-testing ) | pip install $( bin/pip-swh-packages --with-testing ) | ||||
Step 3 --- set up storage | Step 3 --- set up storage | ||||
------------------------- | ------------------------- | ||||
Then you will need a local storage service that will archive and serve source | Then you will need a local storage service that will archive and serve source | ||||
code artifacts via a REST API. The Software Heritage storage layer comes in two | code artifacts via a REST API. The Software Heritage storage layer comes in two | ||||
parts: a content-addressable object storage on your file system (for file | parts: a content-addressable :term:`object storage` on your file system (for file | ||||
contents) and a Postgres database (for the graph structure of the archive). See | contents) and a Postgres database (for the graph structure of the archive). See | ||||
the :ref:`data-model` for more information. The storage layer is configured via | the :ref:`data-model` for more information. The storage layer is configured via | ||||
a YAML configuration file, located at | a YAML configuration file, located at | ||||
``~/.config/swh/storage/storage.yml``. Create it with a content like: | ``~/.config/swh/storage/storage.yml``. Create it with a content like: | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
storage: | storage: | ||||
cls: local | cls: local | ||||
args: | args: | ||||
db: "dbname=softwareheritage-dev" | db: "dbname=softwareheritage-dev" | ||||
objstorage: | objstorage: | ||||
cls: pathslicing | cls: pathslicing | ||||
args: | args: | ||||
root: /srv/softwareheritage/objects/ | root: /srv/softwareheritage/objects/ | ||||
slicing: 0:2/2:4 | slicing: 0:2/2:4 | ||||
Make sure that the object storage root exists on the filesystem and is writable | Make sure that the :term:`object storage` root exists on the filesystem and is writable | ||||
to your user, e.g.:: | to your user, e.g.:: | ||||
sudo mkdir -p /srv/softwareheritage/objects | sudo mkdir -p /srv/softwareheritage/objects | ||||
sudo chown "${USER}:" /srv/softwareheritage/objects | sudo chown "${USER}:" /srv/softwareheritage/objects | ||||
You are done with object storage setup! Let's setup the database:: | You are done with :term:`object storage` setup! Let's setup the database:: | ||||
swh-db-init storage -d softwareheritage-dev | swh-db-init storage -d softwareheritage-dev | ||||
``softwareheritage-dev`` is the name of the DB that will be created, it should | ``softwareheritage-dev`` is the name of the DB that will be created, it should | ||||
match the ``db`` line in ``storage.yml`` | match the ``db`` line in ``storage.yml`` | ||||
To check that you can successfully connect to the DB (you should not be asked | To check that you can successfully connect to the DB (you should not be asked | ||||
for a password):: | for a password):: | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |