diff --git a/README.md b/README.md deleted file mode 100644 index d1bb762..0000000 --- a/README.md +++ /dev/null @@ -1,9 +0,0 @@ -swh-vault -========= - -User-facing service that allows to retrieve parts of the archive as -self-contained bundles. - -See the -[documentation](https://docs.softwareheritage.org/devel/swh-vault/index.html) -for more details. diff --git a/README.rst b/README.rst new file mode 120000 index 0000000..cffceba --- /dev/null +++ b/README.rst @@ -0,0 +1 @@ +docs/README.rst \ No newline at end of file diff --git a/docs/README.rst b/docs/README.rst new file mode 100644 index 0000000..42c70e0 --- /dev/null +++ b/docs/README.rst @@ -0,0 +1,45 @@ +Software Heritage - Vault +========================= + +User-facing service that allows to retrieve parts of the archive as +self-contained bundles (e.g., individual releases, entire repository snapshots, +etc.) +The creation of a bundle is called "cooking" a bundle. + + +Architecture +------------ + +The vault is made of two main parts: + +1. a stateful RPC server called the **backend** +2. Celery tasks, called **cookers** + +The Vault backend +~~~~~~~~~~~~~~~~~ + +The Vault backend is the RPC server other |swh| components (mainly +:ref:`swh-web `) interact with. + +It is in charge of receiving cooking requests, scheduling corresponding tasks (via +:ref:`swh-scheduler ` and Celery), getting heartbeats and final +results from these, cooking tasks, and finally serving the results. + +It uses the same RPC protocol as the other component of the archive, and +its interface is described in :mod:`swh.vault.interface`. + +The cookers +~~~~~~~~~~~ + +Cookers are Python modules/classes, each in charge of cooking a type of bundle. +The main ones are :mod:`swh.vault.cookers.directory` for flat tarballs of directories, +and :mod:`swh.vault.cookers.git_bare` for bare ``.git`` repositories of any +type of git object. +They all derive from :class:`swh.vault.cookers.base.BaseVaultCooker`. + +The base cooker first notifies the backend the cooking task is in progress, +then runs the cooker (which does the bundle-specific handling and uploads the result), +then notifies the backend of the final result (success/failure). + +Cookers may notify the backend of the progress, so they can be displayed in +swh-web's vault interface, which polls the status from the vault backend. diff --git a/docs/index.rst b/docs/index.rst index 74ab82d..9d16724 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,26 +1,21 @@ .. _swh-vault: -Software Heritage - Vault -========================= - -User-facing service that allows to retrieve parts of the archive as -self-contained bundles (e.g., individual releases, entire repository snapshots, -etc.) +.. include:: README.rst .. toctree:: :maxdepth: 2 :caption: Contents: getting-started.rst api.rst Reference Documentation ----------------------- .. toctree:: :maxdepth: 2 cli /apidoc/swh.vault diff --git a/setup.py b/setup.py index 5c94d3d..832416c 100755 --- a/setup.py +++ b/setup.py @@ -1,74 +1,74 @@ #!/usr/bin/env python3 # Copyright (C) 2015-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information from io import open from os import path from setuptools import find_packages, setup here = path.abspath(path.dirname(__file__)) # Get the long description from the README file -with open(path.join(here, "README.md"), encoding="utf-8") as f: +with open(path.join(here, "README.rst"), encoding="utf-8") as f: long_description = f.read() def parse_requirements(name=None): if name: reqf = "requirements-%s.txt" % name else: reqf = "requirements.txt" requirements = [] if not path.exists(reqf): return requirements with open(reqf) as f: for line in f.readlines(): line = line.strip() if not line or line.startswith("#"): continue requirements.append(line) return requirements setup( name="swh.vault", description="Software Heritage vault", long_description=long_description, - long_description_content_type="text/markdown", + long_description_content_type="text/x-rst", python_requires=">=3.7", author="Software Heritage developers", author_email="swh-devel@inria.fr", url="https://forge.softwareheritage.org/diffusion/DVAU/", packages=find_packages(), install_requires=parse_requirements() + parse_requirements("swh"), setup_requires=["setuptools-scm"], use_scm_version=True, extras_require={ "testing": parse_requirements("test"), "graph": parse_requirements("swh-graph"), }, include_package_data=True, zip_safe=False, entry_points=""" [swh.cli.subcommands] vault=swh.vault.cli """, classifiers=[ "Programming Language :: Python :: 3", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Development Status :: 5 - Production/Stable", ], project_urls={ "Bug Reports": "https://forge.softwareheritage.org/maniphest", "Funding": "https://www.softwareheritage.org/donate", "Source": "https://forge.softwareheritage.org/source/swh-vault", "Documentation": "https://docs.softwareheritage.org/devel/swh-vault/", }, )