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
MapSwipe Workers requires GDAL/OGR (`gdal-bin`) and GDAL for Python (`libgdal-dev`, `python-gdal`) to be installed.
22
-
Furthermore, we rely on Docker to set up Postgres.
23
-
24
-
25
19
### Clone from GitHub
26
20
27
21
... and switch to development branch.
@@ -32,15 +26,29 @@ cd python-mapswipe-workers
32
26
git checkout dev
33
27
```
34
28
29
+
### Requirements
30
+
31
+
MapSwipe Workers requires GDAL/OGR (`gdal-bin`) and GDAL for Python (`libgdal-dev`, `python-gdal`) to be [installed](https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html).
32
+
Furthermore, we rely on Docker to set up Postgres.
33
+
35
34
36
35
### Configuration
37
36
38
37
All configurations values are stored in environment variables. Please refer to the documentation on [Configuration](configuration.html) for further details.
39
38
39
+
#### Service Account Key
40
40
41
-
### Directories
41
+
The MapSwipe Workers requires a Service Account Key (`serviceAccountKey.json`) to access Firebase database.
42
+
Request yours from the MapSwipe working group.
42
43
43
-
MapSwipe Workers needs access to a data directory for logs and data for data for the API:
44
+
The path to the Service Account Key is defined in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
45
+
46
+
You could also set up your own Firebase instance. However, this is not recommended.
47
+
If you still want to do it, get your Service Account Key from Firebase from [Google Cloud Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).
48
+
49
+
#### Directories
50
+
51
+
MapSwipe Workers needs access to a data directory for logs and data for the API:
> Note: XDG Base Directory Specification is respected
51
59
52
60
53
-
### Service Account Key
54
-
55
-
The MapSwipe Workers requires a Service Account Key (`serviceAccountKey.json`) to access Firebase database.
56
-
Request yours from the MapSwipe working group.
57
-
58
-
The path to the Service Account Key is defined in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable.
59
-
60
-
You could also set up your own Firebase instance. However, this is not recommended.
61
-
If you still want to do it, get your Service Account Key from Firebase from [Google Cloud Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).
62
-
63
-
64
-
### Postgres
61
+
### Database
65
62
66
63
Setup a local Postgres instance for MapSwipe Workers using the Dockerfile provided for development purposes (`postgres/Dockerfile-dev`).
67
64
The Dockerfile for production (`postgres/Dockerfile`) does need additional setup for build-in backup to Google Cloud Storage, which is not needed for local development. That is why a simplified Dockerfile for development is provided.
Or set up Postgres using the `initdb.sql` file in the `postgres/` folder.
76
73
77
74
78
-
### Install MapSwipe Workers Python Package
75
+
### Mapswipe-Workers Python Package
79
76
80
77
1. Export environment variables to current shell.
81
78
2. Create a Python virtual environment with `system-site-packages` option enabled to get access to GDAL/OGR Python packages
@@ -94,11 +91,12 @@ mapswipe_workers --help
94
91
95
92
> Yeah! If you reached this point, you are ready to get into coding. Below you find some more information on Logging, Firebase Functions and Database Backup. However, you don't need this to get started for now.
96
93
94
+
# Further Information
97
95
98
96
## Logging
99
97
100
98
Mapswipe workers logs are generated using the Python logging module of the standard library (See [Official docs](https://docs.python.org/3/library/logging.html) or this [Tutorial](https://realpython.com/python-logging/#the-logging-module).
101
-
To use the logger object import the it from the `definitions` module:
99
+
To use the logger object import it from the `definitions` module:
102
100
103
101
```python
104
102
from mapswipe_workers.definitions import logger
@@ -145,6 +143,7 @@ On how to setup the development environment and how to deploy functions to the F
145
143
For more information refer to the official [Reference on Cloud Function for Firebase](https://firebase.google.com/docs/reference/functions/).
146
144
For example function take a look at this [GitHub repository](https://github.com/firebase/functions-samples).
0 commit comments