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: README.md
+47-5Lines changed: 47 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,11 +46,53 @@ library code.
46
46
graph of required docker images that represent the production environment.
47
47
48
48
`docker-compose-dev.yml` is a similar file which sets up a dev environment,
49
-
with Redis and a MariaDB server for the `enwp10` database. Use it like so
49
+
with Redis and a MariaDB server for the `enwp10` database. Through profiles like `zimfarm` and `zimfarm-worker`, you can start the Zimfarm containers required to execute a task.
50
50
51
-
```bash
52
-
docker compose -f docker-compose-dev.yml up -d
53
-
```
51
+
### Setting up the development services
52
+
53
+
The dev stack has various containers which can be activated via various profiles. The `zimfarm` profile sets up a local zimfarm DB, API and UI.
54
+
The `zimfarm-worker` profile sets up a local zimfarm worker manager and receiver that stores the results/files of tasks.
55
+
56
+
If it is your first execution of the dev stack, you need to create offliners and a "virtual" worker in Zimfarm DB. Thus, you need to start the services without the worker
57
+
profile till you register a worker.
58
+
59
+
#### Registering a worker
60
+
61
+
- Start the dev stack (with only the Zimfarm API):
62
+
63
+
```sh
64
+
docker compose -f docker-compose-dev.yml --profile zimfarm up --build
65
+
```
66
+
67
+
This starts the API, creates an admin user with username: `admin` and password `admin`
68
+
69
+
- Register offliners in the database
70
+
71
+
```sh
72
+
docker/zimfarm/create_offliners.sh
73
+
```
74
+
75
+
This pulls the latest offliner definitions from the respective offliner repositories
76
+
and registers them with the Zimfarm API. The versions of the offliner definitions
77
+
are hardcoded to "dev".
78
+
79
+
- To register a worker
80
+
81
+
```sh
82
+
docker/zimfarm/create_worker.sh
83
+
```
84
+
85
+
This registers a worker with username `test_worker` and generates SSH keys for it to authenticat with the Zimfarm API
86
+
87
+
- If you are running with worker profile, you will need to create warehouse paths to upload the logs and files for each task.
88
+
```sh
89
+
docker exec -it zimfarm-receiver bash
90
+
/contrib/create-warehouse-paths.sh
91
+
```
92
+
- To start the dev stack (with worker)
93
+
```sh
94
+
docker compose -f docker-compose-dev.yml --profile zimfarm --profile zimfarm-worker up --build
95
+
```
54
96
55
97
`docker-compose-test.yml` is a another docker file which sets up the test db
56
98
for python "nosetests" (unit tests). Run it similarly:
@@ -244,7 +286,7 @@ developing the frontend.
244
286
245
287
## Running a ZIM Farm
246
288
247
-
If you wish to run a ZIM Farm instance for testing purposes, the easiest way is to
289
+
If you wish to run a ZIM Farm instance for testing purposes, the easiest way is to
248
290
clone the zimfarm repository and then setup a development instance of it:
0 commit comments