Image Name: petdog/battlescope-verifier:latest
Source: Dockerfile with build args SERVICE_SCOPE=@battlescope/verifier and BUILD_TARGET=backend/verifier
Validates data integrity and detects anomalies in the database. Runs periodic checks to ensure data quality and consistency.
| Variable | Description | Default | Required |
|---|---|---|---|
LOG_LEVEL | Logging level (trace, debug, info, warn, error) | info | No |
| Variable | Description | Default | Required |
|---|---|---|---|
DATABASE_URL | PostgreSQL connection string | - | Yes |
Checks for killmails not assigned to any battle (after clustering should have processed them).
SELECT COUNT(*) FROM battle_killmails
WHERE battle_id IS NULL
AND enriched_at IS NOT NULL
AND enriched_at < NOW() - INTERVAL '2 hours';
Checks for battles without any participants.
SELECT b.id FROM battles b
LEFT JOIN battle_participants bp ON b.id = bp.battle_id
WHERE bp.id IS NULL;
Checks for records with future timestamps or NULL timestamps.
SELECT COUNT(*) FROM killmails
WHERE occurred_at > NOW() OR occurred_at IS NULL;
Checks for duplicate killmail IDs in the database.
SELECT killmail_id, COUNT(*)
FROM killmails
GROUP BY killmail_id
HAVING COUNT(*) > 1;
Checks for entities without resolved names (should be resolved via ESI).
SELECT COUNT(*) FROM battle_participants
WHERE character_name IS NULL
OR corporation_name IS NULL;
docker run --rm \
-e DATABASE_URL=postgres://user:pass@postgres:5432/battlescope \
petdog/battlescope-verifier:latest
apiVersion: batch/v1
kind: CronJob
metadata:
name: verifier
namespace: battlescope
spec:
schedule: "0 2 * * *" # Daily at 2 AM UTC
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
metadata:
labels:
app: verifier
spec:
restartPolicy: OnFailure
containers:
- name: verifier
image: petdog/battlescope-verifier:latest
envFrom:
- secretRef:
name: battlescope-secrets
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 200m
memory: 512Mi
services:
verifier:
image: petdog/battlescope-verifier:latest
environment:
DATABASE_URL: postgres://battlescope:password@postgres:5432/battlescope
LOG_LEVEL: info
depends_on:
- postgres
command: ["node", "dist/backend/verifier/src/index.js"]
Typical execution time: 1-5 minutes depending on database size.
docker build \
--build-arg SERVICE_SCOPE=@battlescope/verifier \
--build-arg BUILD_TARGET=backend/verifier \
-t petdog/battlescope-verifier:latest \
-f Dockerfile \
.
The verifier service logs validation results:
{
"level": "info",
"msg": "Data validation complete",
"orphaned_killmails": 15,
"missing_participants": 0,
"invalid_timestamps": 2,
"duplicate_killmails": 0,
"missing_entity_names": 43,
"status": "warning"
}
Status Levels:
ok - All checks passedwarning - Minor issues detected (should be investigated)error - Critical issues detected (requires immediate action)Integrate with monitoring systems to alert on validation failures:
# Prometheus AlertManager rule example
- alert: DataIntegrityIssues
expr: battlescope_verifier_errors > 0
for: 5m
labels:
severity: warning
annotations:
summary: "BattleScope data integrity issues detected"
description: "Verifier found {{ $value }} data integrity issues"
Planned features:
Content type
Image
Digest
sha256:a7d3487cc…
Size
100.1 MB
Last updated
10 months ago
docker pull petdog/battlescope-verifier