Ansible Trekker Infra (Share Everything)
Purpose
Manages shared infrastructure components used across all tenants.
Components

1. Snapheadcount
A tool written in Go for generating headcount snapshots. It operates in three modes: a command-line tool, a server component responding to REST API calls, and via NATS message server triggers. The server mode also supports caching lookup data for efficiency.
2. Georest
A Go-based service that replicates the Traccar /api/positions API and supports backdated queries. It allows multiple clients to fetch positional data using a client-specific parameter. Example usage:
http://103.233.3.52:9900/api/positions?client=gpp4&asat=2022-11-05T12:00:00Z
3. Cloud Config
Centralized configuration management for tenant-specific parameters. This includes defining tenant-specific configurations such as database locations, working hours, datetime formats, and other customizable settings to ensure proper operation across diverse client requirements.
4. Trekker WebUI
Shared web-based interface for managing Trekker services (written in Go).
5. Keycloak
Manages identity and access control. Refer to official documentation at https://www.keycloak.org/documentation
6. NATS MQ/Streaming
High-performance message queue for inter-service communication.
7. MariaDB
Centralized relational database supporting multi-tenancy. It is deployed across two different servers using a master-slave configuration. This setup ensures redundancy, improved read performance, and data availability. However, in certain scenarios, synchronization issues can occur, particularly during server downtimes, which can lead to data inconsistencies and the need for manual reconciliation.
8. TrekkerTree
This tool supports querying headcount, manhour, and productivity data across multiple tenants. Environment variables define the tenant to operate under, such as mlng, gpp4, or graphite. Example usage:
- Querying data:
- For headcount snapshots:
https://[client].ttree.trekker.my/getdata/:timestamp/:groups https://[client].ttree.trekker.my/getdata?date=08-11-2023T00:00:00Z&groups=workzoneType,workzonePackage - For manhour snapshots:
https://[client].ttree.trekker.my/manhours/:fromDate/:toDate/:groups https://[client].ttree.trekker.my/manhoursraw/:fromDate/:toDate/:groups - For productivity:
https://[client].ttree.trekker.my/productivity/:fromDate/:toDate/:duration - Example query:
http://mrcsb2.ttree.trekker.my/getdata/09-11-2023%2007:00:00/10-11-2023%2006:59:00
Other Non-Central Components
statping: Deploys Statping for status monitoring.hcquery: Implements health check query tools.backup: Automates data backup processes.