@@ -6,44 +6,46 @@ Development Installation
66Instructions on how to install a local development version of SODAR Core are
77detailed here. Ubuntu 24.04 LTS is the supported OS for development. For
88deployment, the same Ubuntu version or a corresponding Debian release are
9- recommended. Other Linux variants can be used, but some system dependencies may
10- vary for different OS versions or distributions.
11-
12- Installation and development should be possible on most recent versions of
13- Linux, Mac and Windows (WSL2 recommended). However, this may require extra work
14- and your mileage may vary.
15-
16- If you need to set up the accompanying example site in Docker, please see online
17- for up-to-date Docker setup tutorials for Django related to your operating
18- system of choice.
9+ recommended. Other Linux variants can be used for development or deployment, but
10+ some system dependencies may vary for different OS versions or distributions.
1911
2012.. note ::
2113
22- These instructions are also valid for the
14+ These instructions are also valid for developing the
2315 `sodar-django-site <https://github.com/bihealth/sodar-django-site >`_
2416 repository.
2517
2618
27- System Dependencies
28- ===================
19+ .. _dev_core_install_database :
2920
30- To get started, install the OS dependencies, Python >=3.11 (3.13 recommended)
31- and PostgreSQL >=12 (16 recommended).
21+ 1. Setup Database Servers
22+ =========================
3223
33- .. code-block :: console
24+ Developing SODAR Core requires PostgreSQL v12+ (v16 recommended) and Redis.
25+ There are two options for setting up the databases: bringing up the
26+ pre-configured Docker Compose network or manual setup.
3427
35- $ sudo utility/install_os_dependencies.sh
36- $ sudo utility/install_python.sh
37- $ sudo utility/install_postgres.sh
28+ Setup with Docker Compose (Recommended)
29+ ---------------------------------------
3830
31+ The easiest way to set up the database servers is by cloning
32+ `sodar-core-docker-compose <https://github.com/bihealth/sodar-core-docker-compose >`_.
33+ This repository sets up a Docker Compose network with the database servers as
34+ containers. Follow the instructions in the repository readme to bring up the
35+ network. The SODAR Core database and user will be set up automatically on
36+ initial launch.
3937
40- .. _dev_core_install_database :
38+ Manual Setup
39+ ------------
4140
42- Database Setup
43- ==============
41+ It is also possible to set up a server manually or use an existing server. To
42+ install PostgreSQL prerequisites, run the following script:
4443
45- Next you need to setup the database and PostgreSQL user. You need to enter the
46- following SQL in ``psql ``:
44+ .. code-block :: console
45+
46+ $ sudo utility/install_postgres.sh
47+
48+ Once you have a PostgreSQL server running, you'll need to run the following SQL:
4749
4850.. code-block :: sql
4951
@@ -52,41 +54,58 @@ following SQL in ``psql``:
5254 ALTER DATABASE sodar_core OWNER TO sodar_core;
5355 ALTER USER sodar_core CREATEDB;
5456
55- Alternatively, if PostgreSQL is running directly on your development host, you
56- can use the following utility script (this does not work with a Docker setup) :
57+ If your PostgreSQL is running directly on your development host, you can also
58+ use the following utility script:
5759
5860.. code-block :: console
5961
6062 $ sudo utility/setup_database.sh
6163
62- You have to set the database URL and credentials for Django in the environment
63- variable ``DATABASE_URL ``. For development it is recommended to place
64- environment variables in file ``.env `` located in your project root. To enable
65- loading the file in Django, set ``DJANGO_READ_DOT_ENV_FILE=1 `` in your
66- environment variables when running SODAR or any of its management commands.
67- See ``config/settings/base.py `` for more information and the ``env.example ``
68- file for an example environment file.
64+ To install Redis manually, run the following script:
65+
66+ .. code-block :: console
67+
68+ $ sudo utility/install_redis.sh
6969
70- Example of the database URL variable as set within an ``.env `` file:
70+
71+ 2. Setup Repository
72+ ===================
73+
74+ Clone the SODAR Core repository from GitHub and create yourself a ``.env ``
75+ environment configuration file.
7176
7277.. code-block :: console
7378
74- DATABASE_URL="postgres://sodar_core:sodar_core@127.0.0.1/sodar_core"
79+ $ git clone https://github.com/bihealth/sodar-core.git
80+ $ cd sodar-core
81+ $ cp env.example .env
82+
83+ .. important ::
7584
76- Asynchronous Celery tasks require running a Redis server. For development, you
77- can install it with the following script:
85+ To enable loading environment variables from the ``.env `` file, make sure to
86+ set ``DJANGO_READ_DOT_ENV_FILE=1 `` in the environment variables of the
87+ development host.
88+
89+
90+ 3. Install OS Dependencies
91+ ==========================
92+
93+ For development, you are expected to run the Django server and possible Celery
94+ worker locally. To get started, install the OS dependencies and Python >=3.11
95+ (3.13 recommended).
7896
7997.. code-block :: console
8098
81- $ sudo utility/install_redis.sh
99+ $ sudo utility/install_os_dependencies.sh
100+ $ sudo utility/install_python.sh
82101
83102
84- Repository and Environment Setup
85- ================================
103+ 4. Install Python Dependencies
104+ ==============================
86105
87- Clone the repository, setup and activate the virtual environment. Once within
88- the repository and an active virtual environment, install Python requirements
89- for the project . Example:
106+ To set up Python dependencies for the repository, you'll first need to activate
107+ a virtual environment. Once within an active virtual environment, use the
108+ provided script to install the Python dependencies for development . Example:
90109
91110.. code-block :: console
92111
@@ -95,21 +114,21 @@ for the project. Example:
95114 $ utility/install_python_dependencies.sh
96115
97116
98- LDAP Setup (Optional)
99- =====================
117+ 5. Install LDAP Dependencies (Optional)
118+ =======================================
100119
101- If you will be using LDAP/AD auth on your site , make sure to also run:
120+ If you will be using LDAP/AD auth when developing , make sure to also run:
102121
103122.. code-block :: console
104123
105124 $ sudo utility/install_ldap_dependencies.sh
106125 $ pip install -r requirements/ldap.txt
107126
108127
109- Final Setup
110- ===========
128+ 6. Setup Django
129+ ===============
111130
112- Initialize the database (this will also synchronize django- plugins):
131+ Initialize the SODAR Core Django database (this will also synchronize plugins):
113132
114133.. code-block :: console
115134
@@ -150,20 +169,20 @@ terminal.
150169 process is not necessary.
151170
152171
153- Optional Steps
154- ==============
172+ 7. Create Development Users (Optional)
173+ ======================================
155174
156- For creating a group of example users for your development site, you can run the
157- ``createdevusers `` management command. This creates the users "alice", "bob",
158- " carol", "dan" and "erin". The users will be created with the password
159- "sodarpass", unless a custom password is supplied via the ``-p `` or
175+ For creating a group of example users for your development site, it is
176+ recommended to run the ``createdevusers `` management command. This creates the
177+ users "alice", "bob", " carol", "dan" and "erin". The users will be created with
178+ the password "sodarpass", unless a custom password is supplied via the ``-p `` or
160179``--password `` argument.
161180
162181.. code-block :: console
163182
164183 $ ./manage.py createdevusers
165184
166- .. note ::
185+ .. hint ::
167186
168187 Having multiple non-admin user accounts is useful for developing and trying
169188 out project and member access management features. It is recommended to log
0 commit comments