A comprehensive Docker-based solution for AI-driven shipping line tracking automation with built-in evaluation capabilities.
This project provides two main components:
- Automation Container: A browser automation environment with VNC access and REST API
- Evaluation Container: Automated testing and evaluation of the automation container
# Run both automation and evaluation containers
docker compose up --build
# The evaluation container will automatically test the automation container
# Access points during testing:
# - VNC Viewer: localhost:5900 (password: secret)
# - Web VNC: http://localhost:6080
# - API: http://localhost:5001 (configurable via API_PORT env var)browseraivnc/
βββ src/ # Automation scripts
β βββ api.py # Flask API for automation
β βββ main-simple-test.py # Visual automation demo
βββ evaluator/ # Evaluation container
β βββ src/
β β βββ evaluator.py # Simple evaluation script
β βββ Dockerfile # Evaluation container image
β βββ requirements.txt # Evaluation dependencies
βββ docker-compose.yml # Full evaluation setup
βββ README.md # This file
- VNC Access: Visual browser automation with remote desktop
- REST API: Programmatic access to automation functions
- Caching: Intelligent in-memory caching for repeated requests
- Multi-Browser: Support for Chrome, Firefox, and Chromium
GET /healthPOST /track
Content-Type: application/json
{
"booking_id": "SINI25432400",
"force_fresh": false
}import requests
# Health check
response = requests.get("http://localhost:5001/health")
print(response.json())
# Track a booking
payload = {"booking_id": "SINI25432400"}
response = requests.post("http://localhost:5001/track", json=payload)
print(response.json())The evaluation container automatically tests the automation container to ensure:
- β Tracking returns correct voyage number and arrival date
- β Caching improves performance on repeat requests
- β System works reliably
- Fresh Tracking Test: Tests initial tracking request and verifies correct data (YM MANDATE 0096W, 2025-02-28)
- Cached Tracking Test: Tests repeat request is faster and uses cache
# Run full evaluation suite
docker compose up --build
# View evaluation logs
docker logs evaluation_containerπ§ͺ Starting Simple Evaluation
========================================
β³ Waiting for API to be ready...
β
API is ready
π’ Testing Fresh Request...
β
Fresh request passed (12.3s)
πΎ Testing Cached Request...
β
Cached request passed (2.1s)
π Results: 2/2 tests passed
π All tests passed!
DISPLAY: X11 display (default: :99)SCREEN_WIDTH: Screen width (default: 1920)SCREEN_HEIGHT: Screen height (default: 1080)BROWSER: Browser choice (chrome/firefox/chromium)
AUTOMATION_API_URL: API URL (default: http://automation:5000)PYTHONUNBUFFERED: Python output buffering (default: 1)
None - all evaluation output is shown in console logs
# Build automation container
docker compose build
# Run automation container
docker compose up -d
# Run evaluation suite
docker compose up --build
# Stop all containers
docker compose down# View automation container logs
docker logs automation_container
# View evaluation container logs
docker logs evaluation_container
# Execute commands in running container
docker exec -it automation_container bashThis project was developed for the AI-based Shipping Line Tracking Assignment with the following requirements:
- Natural Language Processing: Use AI to interpret tracking requests
- Process Persistence: Cache and reuse automation steps
- Adaptability: Handle different booking IDs without hardcoding
- Repeatability: Consistent results across multiple runs
SINI25432400(Test case with voyage: YM MANDATE 0096W, arrival: 2025-02-28)
- Voyage Number: "YM MANDATE 0096W"
- Arrival Date: "2025-02-28"
- Execution Time: Performance metrics
- Cache Status: Whether cached data was used
-
Container won't start
# Check port conflicts docker ps -a # Clean up containers docker system prune -f
-
VNC connection fails
# Check VNC logs docker logs automation_container | grep vnc # Restart container docker-compose restart
-
API not responding
# Check API health curl http://localhost:5001/health # Check container logs docker logs automation_container | grep Flask
-
Evaluation fails
# Check evaluation logs docker logs evaluation_container # Verify network connectivity docker network ls
# Monitor container resources
docker stats
# Check disk usage
docker system df
# Monitor API requests
docker logs automation_container | grep -E "(GET|POST)"