Skip to content

Commit 69b612e

Browse files
committed
added extractor info
1 parent 7aded42 commit 69b612e

14 files changed

+247
-53
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ gem "jekyll", "~> 4.3.4" # installed by `gem jekyll`
55

66
gem "just-the-docs", "0.10.0" # pinned to the current release
77
# gem "just-the-docs" # always download the latest release
8+
gem "jekyll-relative-links", "0.7.0"

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ GEM
3939
webrick (~> 1.7)
4040
jekyll-include-cache (0.2.1)
4141
jekyll (>= 3.7, < 5.0)
42+
jekyll-relative-links (0.7.0)
43+
jekyll (>= 3.3, < 5.0)
4244
jekyll-sass-converter (3.0.0)
4345
sass-embedded (~> 1.54)
4446
jekyll-seo-tag (2.8.0)
@@ -83,6 +85,7 @@ PLATFORMS
8385

8486
DEPENDENCIES
8587
jekyll (~> 4.3.4)
88+
jekyll-relative-links (= 0.7.0)
8689
just-the-docs (= 0.10.0)
8790

8891
BUNDLED WITH

README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ logo: /assets/fologos.png
88

99
aux_links:
1010
FleetOptimiser OS2: https://github.com/OS2fleetoptimiser/OS2fleetoptimiser
11+
12+
plugins:
13+
- jekyll-relative-links

developing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ docker run -p 6379:6379 redis -d
128128
npm run dev
129129
```
130130

131-
See [production](production.html) for environment variables for the backend.
131+
See [production](production.md) for environment variables for the backend.
132132

extractors.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

extractors/clevertrack.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Clevertrack
3+
layout: default
4+
parent: Extractors
5+
has_children: false
6+
---
7+
# Clevertrack
8+
9+
Clevertrack uses a method of patching already read trips.
10+
If one does not patch you would continuously have to load already _known_ trips, because it's not possible to query
11+
based off of vehicle id. Hence, you have to define a date from which you want to load trips, and manage patching.
12+
13+
The connection requires a `TOKEN` environment which is a classic uid format.
14+
In addition, you should provide a pickle path to;
15+
- `CAR_TRIPS_IDS` : path to a pickle that stores mapping between vehicle ids and patched trips
16+
- `PATCHED_IDS` : path to a pickle that stores record of patched trips
17+
18+
19+
Use the `docker-compose-extractor.yaml` file and define the functions you want to use in the extractor:
20+
21+
| function | description |
22+
|------------------|--------------------------------------|
23+
| set-vehicles | syncs the vehicles |
24+
| set-roundtrips | loads, aggregate and save roundtrips |
25+
| patch-roundtrips | patches read trips on the connection |
26+
27+
28+
```
29+
["/bin/sh", "-c", "python -m fleetmanager.extractors.clevertrack set-vehicles && python -m fleetmanager.extractors.clevertrack set-roundtrips && python -m fleetmanager.extractors.clevertrack patch-roundtrips"]
30+
```

extractors/extractors.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Extractors
3+
layout: default
4+
nav_order: 4
5+
has_children: true
6+
---
7+
8+
# Extractors
9+
The extractors are an important part of FleetOptimiser, which asserts that data is synced from the fleetmanagement systems.
10+
The extractor will synchronise available metadata with vehicles, and will delta load the latest trips.
11+
Trips will be aggregated from single GPS logs, to an aggregated format that will only contain coordinates of a saved start location,
12+
such that the system does not save sensitive information.
13+
14+
15+
The amount of exposed metadata differ from system to system, so with some integrations there are more sanitation of data.
16+
17+
18+
All extractors expect the following env variables:
19+
20+
| env | description |
21+
|-----|-------------|
22+
| DB_NAME | name of the database |
23+
| DB_USER | user of the database |
24+
| DB_PASSWORD | password of the user on the database |
25+
| DB_URL | host and port to the database |
26+
| DB_SERVER | dialect and driver |
27+
| TRIP_DURATION | maximum duration of a roundtrip |
28+
| MAX_DATE | first delta load date |
29+
| DESCRIPTION_FIELDS | additional fields to save from APIs
30+
31+
32+

extractors/fleetcomplete.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: FleetComplete
3+
layout: default
4+
parent: Extractors
5+
has_children: false
6+
---
7+
# FleetComplete
8+
9+
The FleetComplete extractor expects the connection key to be present in the env as a single string, like:
10+
11+
```
12+
KEYS=keyToFleetComplete
13+
```
14+
15+
16+
Use the `docker-compose-extractor.yaml` file and define the functions you want to use in the extractor:
17+
18+
| function | description |
19+
|------------------| ----------- |
20+
| set-starts | loads and saves new locations |
21+
| set-vehicles | syncs the vehicles |
22+
| set-roundtrips | loads, aggregate and save roundtrips |
23+
| clean-roundtrips | deletes X (keep_data in DB) month old roundtrips |
24+
25+
26+
27+
```
28+
entrypoint: ["/bin/sh", "-c", "python -m fleetmanager.extractors.fleetcomplete set-starts && python -m fleetmanager.extractors.fleetcomplete set-vehicles && python -m fleetmanager.extractors.fleetcomplete set-roundtrips && python -m fleetmanager.extractors.fleetcomplete clean-roundtrips"]
29+
```

extractors/gamfleet.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Gamfleet
3+
layout: default
4+
parent: Extractors
5+
has_children: false
6+
---
7+
# Gamfleet
8+
9+
You must modify the urls in the Gamfleet extractor code in order to point to the correct endpoints.
10+
11+
To make the load more effective, we use a `LOAD_RECORD_PATH` to store load history of each vehicle.
12+
This asserts that we don't load _old_ unusable trips.
13+
14+
- `LOAD_RECORD_PATH` : path to json history (optional)
15+
- `KEY` : key to the Gamfleet API
16+
17+
Use the `docker-compose-extractor.yaml` file and define the functions you want to use in the extractor:
18+
19+
| function | description |
20+
|------------------| ----------- |
21+
| set-starts | loads and saves new locations |
22+
| set-vehicles | syncs the vehicles |
23+
| set-roundtrips | loads, aggregate and save roundtrips |
24+
| clean-roundtrips | deletes X (keep_data in DB) month old roundtrips |
25+
26+
27+
28+
```
29+
entrypoint: ["/bin/sh", "-c", "python -m fleetmanager.extractors.gamfleet set-starts && python -m fleetmanager.extractors.gamfleet set-vehicles && python -m fleetmanager.extractors.gamfleet set-roundtrips && python -m fleetmanager.extractors.gamfleet clean-roundtrips"]
30+
```

0 commit comments

Comments
 (0)