Changeset View
Changeset View
Standalone View
Standalone View
docker/README.rst
Show First 20 Lines • Show All 552 Lines • ▼ Show 20 Lines | Task 1 | |||||||||
Args: | Args: | |||||||||
Keyword args: | Keyword args: | |||||||||
origin_url: https://hg.logilab.org/master/cubicweb | origin_url: https://hg.logilab.org/master/cubicweb | |||||||||
- Respawn a task:: | - Respawn a task:: | |||||||||
(swh) ~/swh-environment$ swh scheduler task respawn 1 | (swh) ~/swh-environment$ swh scheduler task respawn 1 | |||||||||
.. _docker-persistence: | ||||||||||
Data persistence for a development setting | Data persistence for a development setting | |||||||||
------------------------------------------ | ------------------------------------------ | |||||||||
The default ``docker-compose.yml`` configuration is not geared towards | The default ``docker-compose.yml`` configuration is not geared towards | |||||||||
data persistence, but application testing. | data persistence, but application testing. | |||||||||
Volumes defined in associated images are anonymous and may get either | Volumes defined in associated images are anonymous and may get either | |||||||||
unused or removed on the next ``docker-compose up``. | unused or removed on the next ``docker-compose up``. | |||||||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | ||||||||||
or inaccurate. | or inaccurate. | |||||||||
So we have an alternative based on Redis' HyperLogLog feature, which you | So we have an alternative based on Redis' HyperLogLog feature, which you | |||||||||
can test with:: | can test with:: | |||||||||
~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.counters.yml up -d | ~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.counters.yml up -d | |||||||||
[...] | [...] | |||||||||
Efficient graph traversals | ||||||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||||||||||
:ref:`swh-graph <swh-graph>` is a work-in-progress alternative to swh-storage | ||||||||||
to perform large graph traversals/queries on the merkle DAG. | ||||||||||
For example, it can be used by the vault, as it needs to query all objects | ||||||||||
in the sub-DAG of a given node. | ||||||||||
You can use it with:: | ||||||||||
~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.graph.yml up -d | ||||||||||
ardumontUnsubmitted Not Done Inline Actions
ardumont: | ||||||||||
Done Inline ActionsI meant it as uncountable vlorentz: I meant it as uncountable | ||||||||||
On the first start, it will run some precomputation based on all objects already | ||||||||||
in your local SWH instance; so it may take a long time if you loaded many | ||||||||||
repositories. (Expect 5 to 10s per repository.) | ||||||||||
It **does not update automatically** when you load new repositories. | ||||||||||
You need to restart it every time you want to update it. | ||||||||||
You can :ref:`mount a docker volume <docker-persistence>` on | ||||||||||
:file:`/srv/softwareheritage/graph` to avoid recomputing this graph | ||||||||||
on every start. | ||||||||||
Then, you need to explicitly request recomputing the graph before restarts | ||||||||||
if you want to update it:: | ||||||||||
~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.graph.yml run swh-graph update | ||||||||||
~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.graph.yml stop swh-graph | ||||||||||
~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.graph.yml up swh-graph -d | ||||||||||
Keycloak | Keycloak | |||||||||
^^^^^^^^ | ^^^^^^^^ | |||||||||
If you really want to hack on swh-web's authentication features, | If you really want to hack on swh-web's authentication features, | |||||||||
you will need to enable Keycloak as well, instead of the default | you will need to enable Keycloak as well, instead of the default | |||||||||
Django-based authentication:: | Django-based authentication:: | |||||||||
~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.keycloak.yml up -d | ~/swh-environment/docker$ docker-compose -f docker-compose.yml -f docker-compose.keycloak.yml up -d | |||||||||
[...] | [...] | |||||||||
User registration in Keycloak database is available by following the Register link | User registration in Keycloak database is available by following the Register link | |||||||||
in the page located at http://localhost:5080/oidc/login/. | in the page located at http://localhost:5080/oidc/login/. | |||||||||
Please note that email verification is required to properly register an account. | Please note that email verification is required to properly register an account. | |||||||||
As we are in a testing environment, we use a MailHog instance as a fake SMTP server. | As we are in a testing environment, we use a MailHog instance as a fake SMTP server. | |||||||||
All emails sent by Keycloak can be easily read from the MailHog Web UI located | All emails sent by Keycloak can be easily read from the MailHog Web UI located | |||||||||
at http://localhost:8025/. | at http://localhost:8025/. | |||||||||
Using Sentry | Using Sentry | |||||||||
------------ | ------------ | |||||||||
All entrypoints to SWH code (CLI, gunicorn, celery, …) are, or should | All entrypoints to SWH code (CLI, gunicorn, celery, …) are, or should | |||||||||
be, instrumented using Sentry. By default this is disabled, but if you | be, instrumented using Sentry. By default this is disabled, but if you | |||||||||
run your own Sentry instance, you can use it. | run your own Sentry instance, you can use it. | |||||||||
To do so, you must get a DSN from your Sentry instance, and set it as | To do so, you must get a DSN from your Sentry instance, and set it as | |||||||||
Show All 27 Lines |