Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent Sellier
swh-docs
Commits
5f92841c
Commit
5f92841c
authored
3 years ago
by
vlorentz
Browse files
Options
Downloads
Patches
Plain Diff
Add an overview of the metadata workflow
parent
35feff31
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/architecture/index.rst
+1
-0
1 addition, 0 deletions
docs/architecture/index.rst
docs/architecture/metadata.rst
+98
-0
98 additions, 0 deletions
docs/architecture/metadata.rst
docs/glossary.rst
+2
-2
2 additions, 2 deletions
docs/glossary.rst
docs/index.rst
+2
-0
2 additions, 0 deletions
docs/index.rst
with
103 additions
and
2 deletions
docs/architecture/index.rst
+
1
−
0
View file @
5f92841c
...
...
@@ -10,4 +10,5 @@ Software Architecture
overview
mirror
metadata
../keycloak/index
This diff is collapsed.
Click to expand it.
docs/architecture/metadata.rst
0 → 100644
+
98
−
0
View file @
5f92841c
.. _architecture-metadata:
Metadata workflow and architecture
==================================
|swh| calls "metadata" information it collects and extracts that describes and provides additional information on source code.
This metadata is partitioned into three types:
1. development metadata, which is part of the :ref:`data-model`, such as authorship
and date of revisions and releases,
2. :term:`intrinsic metadata`, which is extracted from a source code repository itself,
usually mined from metadata files like :file:`package.json` or :file:`Gemfile`.
It is intrinsically part of the software origin, because both are distributed
together from the origin's VCS repository or release tarballs.
3. :term:`extrinsic metadata`, which is collected or deposited from external sources.
It can have a straightforward relationship with the repository (eg. number of stars
of GitHub origins or checksums of release tarballs),
or be more distant (provided by a third-party like Wikidata).
This document is only about the latter two.
Raw metadata storage
--------------------
As an archive, |swh| chooses to store original metadata objects unmodified
in its long-term storage databases (:ref:`swh-storage <swh-storage>` and
:ref:`swh-objstorage <swh-objstorage>`).
For intrinsic metadata, this only means it is treated as any other source code content;
ie. there is no difference between a metadata file like :file:`package.json`
and a source code file like :file:`index.js` from the loaders' and the database's
points of view.
Extrinsic metadata, however, are stored in a :ref:`dedicated storage service
<extrinsic-metadata-specification>` (in practice, this is currently in the same database
as the :ref:`data-model`'s Merkle DAG; but in separate tables).
As they are both stored verbatim, they are in various formats depending on their source,
and are not directly usable.
Indexed metadata storages
-------------------------
|swh| also stores metadata in indexed databases, which are directly usable
for searching and querying.
Currently, there are two:
1. the "indexer storage", a postgresql database that acts as a cache, and provides
limited search functionality
2. :ref:`swh-search <swh-search>`, an advanced search service backed by
`ElasticSearch`_.
Each of these databases has a consistent schema for ease of use.
Differences between raw and indexed metadata
--------------------------------------------
The raw metadata is the authentic piece of metadata while the indexed metadata
is a processed version, where the raw metadata is translated to a uniform vocabulary.
Both intrinsic and extrinsic metadata can be indexed and translated.
Therefore, most metadata stored twice in |swh|: raw and indexed.
The reason for this apparent duplication is robustness and future-proofing.
Indeed, indexing metadata is a complex process.
By keeping the raw metadata we ensure the possibility to re-compute the metadata
in the future with other vocabularies.
Furthermore, if we did not store the raw metadata, this would mean bugs in indexers
could easily lose data, forever.
Thanks to this redundant architecture, bugs can be fixed and indexers re-ran
from the raw metadata to fix the indexed metadata.
This also makes it easier to add features on metadata mining or change schema
in the future: instead of re-loading
from original sources (which may have disappeared since!), new indexers can simply
read stored metadata into new indexed storages.
Metadata mining
---------------
Some of the stored raw metadata is read and interpreted by worker processes known
as :ref:`indexers <swh-indexer>`.
Currently, they convert this metadata into a common format, `CodeMeta`_.
Some indexers also read source code files to generate metadata about these files,
such as their license, language, etc.
Then, they either send their results directly to a caller, or write it to an
indexed metadata storage (either directly or through :ref:`swh-journal <swh-journal>`).
.. _CodeMeta: https://codemeta.github.io/
.. _ElasticSearch: https://www.elastic.co/elasticsearch/
This diff is collapsed.
Click to expand it.
docs/glossary.rst
+
2
−
2
View file @
5f92841c
...
...
@@ -73,7 +73,7 @@ Glossary
homepage, maintainer contact information, and popularity information
("stars") as listed on GitHub/GitLab repository pages.
See also: :term:`intrinsic metadata`.
See also: :term:`intrinsic metadata`
:ref:`architecture-metadata`
.
journal
...
...
@@ -126,7 +126,7 @@ Glossary
for Python packages, `pom.xml` for Maven-based Java projects,
`debian/control` for Debian packages, `metadata.json` for NPM, etc.
See also: :term:`extrinsic metadata`.
See also: :term:`extrinsic
metadata`, :ref:`architecture-
metadata`.
objstore
objstorage
...
...
This diff is collapsed.
Click to expand it.
docs/index.rst
+
2
−
0
View file @
5f92841c
...
...
@@ -27,6 +27,8 @@ Architecture
architecture
* :ref:`mirror` → learn what a Software Heritage mirror is and how to set up
one
* :ref:`Metadata workflow <architecture-metadata>` → learn how Software Heritage
stores and handles metadata
* :ref:`Keycloak <keycloak>` → learn how to use Keycloak,
the authentication system used by |swh|'s web interface and public APIs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment