You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/install.rst
+74-62
Original file line number
Diff line number
Diff line change
@@ -1,76 +1,22 @@
1
-
Development Setup and Standards
2
-
===============================
1
+
Install local development instance
2
+
==================================
3
3
4
4
.. meta::
5
5
:description lang=en: Install a local development instance of Read the Docs with our step by step guide.
6
6
7
-
These are development setup and standards that are adhered to by the core development team while
7
+
These are development setup and :ref:`standards<Core team standards>` that are adhered to by the core development team while
8
8
developing Read the Docs and related services. If you are a contributor to Read the Docs,
9
9
it might a be a good idea to follow these guidelines as well.
10
10
11
+
.. note::
11
12
12
-
Core team standards
13
-
-------------------
14
-
15
-
Core team members expect to have a development environment that closely
16
-
approximates our production environment, in order to spot bugs and logical
17
-
inconsistencies before they make their way to production.
18
-
19
-
This solution gives us many features that allows us to have an
20
-
environment closer to production:
21
-
22
-
Celery runs as a separate process
23
-
Avoids masking bugs that could be introduced by Celery tasks in a race conditions.
24
-
25
-
Celery runs multiple processes
26
-
We run celery with multiple worker processes to discover race conditions
27
-
between tasks.
28
-
29
-
Docker for builds
30
-
Docker is used for a build backend instead of the local host build backend.
31
-
There are a number of differences between the two execution methods in how
32
-
processes are executed, what is installed, and what can potentially leak
33
-
through and mask bugs -- for example, local SSH agent allowing code check
34
-
not normally possible.
35
-
36
-
Serve documentation under a subdomain
37
-
There are a number of resolution bugs and cross-domain behavior that can
38
-
only be caught by using `USE_SUBDOMAIN` setting.
39
-
40
-
PostgreSQL as a database
41
-
It is recommended that Postgres be used as the default database whenever
42
-
possible, as SQLite has issues with our Django version and we use Postgres
43
-
in production. Differences between Postgres and SQLite should be masked for
44
-
the most part however, as Django does abstract database procedures, and we
45
-
don't do any Postgres-specific operations yet.
46
-
47
-
Celery is isolated from database
48
-
Celery workers on our build servers do not have database access and need
49
-
to be written to use API access instead.
50
-
51
-
Use NGINX as web server
52
-
All the site is served via NGINX with the ability to change some configuration locally.
53
-
54
-
MinIO as Django storage backend
55
-
All static and media files are served using Minio --an emulator of S3,
56
-
which is the one used in production.
57
-
58
-
Serve documentation via El Proxito
59
-
Documentation is proxied by NGINX to El Proxito and proxied back to NGINX to be served finally.
60
-
El Proxito is a small application put in front of the documentation to serve files
61
-
from the Django Storage Backend.
62
-
63
-
Search enabled by default
64
-
Elasticsearch is properly configured and enabled by default.
65
-
All the documentation indexes are updated after a build is finished.
13
+
We do not recommend to follow this guide to deploy an instance of Read the Docs for production usage.
14
+
Take into account that this setup is only useful for developing purposes.
66
15
67
16
68
17
Set up your environment
69
18
-----------------------
70
19
71
-
After cloning ``readthedocs.org`` repository, you need to
72
-
73
-
74
20
#. install `Docker <https://www.docker.com/>`_ following `their installation guide <https://docs.docker.com/install/>`_.
75
21
76
22
#. clone the ``readthedocs.org`` repository:
@@ -112,7 +58,17 @@ After cloning ``readthedocs.org`` repository, you need to
112
58
113
59
inv docker.up --init # --init is only needed the first time
114
60
115
-
#. go to http://localhost:9000/ (MinIO S3 storage backend), click "..." and then "Edit Policy" and give "Read Only" access on all the buckets (``static`` and ``media``).
61
+
#. add read permissions to the storage backend:
62
+
63
+
* go to http://localhost:9000/ (MinIO S3 storage backend)
64
+
* login as admin / password
65
+
* click "..." next to the bucket name and then "Edit Policy"
66
+
* give "Read Only" access on all the buckets (``static`` and ``media``)
67
+
68
+
.. note::
69
+
70
+
``media`` bucket may be created after the first build is finished.
71
+
You will need to repeat this step after that.
116
72
117
73
#. go to http://community.dev.readthedocs.io to access your local instance of Read the Docs.
118
74
@@ -137,7 +93,7 @@ save some work while typing docker compose commands. This section explains these
137
93
``inv docker.shell``
138
94
Opens a shell in a container (web by default).
139
95
140
-
* ``--running`` the shell is open in a container that it's already running
96
+
* ``--no-running`` spins up a new container and open a shell
141
97
* ``--container`` specifies in which container the shell is open
142
98
143
99
``inv docker.manage {command}``
@@ -253,3 +209,59 @@ For others, the webhook will simply fail to connect when there are new commits t
253
209
* Take the "Client ID" and "Secret" for each service and enter it in your local Django admin at:
0 commit comments