yasithdev opened a new pull request, #596: URL: https://github.com/apache/airavata/pull/596
## AIRAVATA-3981 Resolves [AIRAVATA-3981](https://issues.apache.org/jira/browse/AIRAVATA-3981) ## What was done ### 1. ServiceRegistry + Monitoring Endpoints (`airavata-api`) - **`ServiceRegistry`** — Thread-safe registry tracking all background services (label → IServer + Thread + optional restart factory). Methods: `register()`, `getStatuses()`, `restart()`, `stopAll()`, `recordError()`. - **`ServiceStatus`** — DTO with `status` (UP/DOWN/DISABLED), `uptimeMs`, `lastError`. - **`MonitoringServer` rewritten** — Replaced Prometheus `HTTPServer` with `com.sun.net.httpserver.HttpServer` serving three endpoints: - `GET /metrics` — Prometheus metrics (same as before) - `GET /health/services` — JSON status of all background services - `POST /admin/restart/{name}` — Restart individual background service (200/404/400/500) - **`AiravataServer` refactored** — Uses `ServiceRegistry` instead of raw `List<IServer>` + `List<Thread>`. Records errors in registry. Passes registry to MonitoringServer. ### 2. Tiltfile (replaces ide-integration module) Single orchestration file for dev setup and integration verification: - `docker_compose('./compose.yml')` — infra services (MariaDB, RabbitMQ, ZooKeeper, Kafka, Keycloak) - `local_resource('build')` — `mvn package` with file deps for auto-rebuild - `local_resource('airavata-server')` — classpath mode with readiness probe on `/health/services` - `local_resource('integration-tests')` — manual trigger, runs JUnit suite `modules/ide-integration/` removed — fully replaced by Tiltfile. ### 3. integration-tests Maven Module 8 JUnit 5 test classes (all `@Tag("integration")`, skipped by default): | Test | Verifies | |------|----------| | `ThriftServiceHealthTest` | All 9 multiplexed services respond to `getAPIVersion()` on port 8930 | | `DatabaseHealthTest` | JDBC connection + 7 key tables exist | | `RabbitMQHealthTest` | AMQP connection + 3 exchanges exist | | `KafkaHealthTest` | Broker reachable via AdminClient | | `KeycloakHealthTest` | Realm OIDC endpoint + client_credentials token grant | | `PrometheusHealthTest` | `/metrics` returns Prometheus format | | `ServiceHealthEndpointTest` | `/health/services` returns UP for all non-disabled services | | `BackgroundServiceHealthTest` | All 8 expected background services are registered | ### 4. Cleanup - `docs/superpowers/` added to `.gitignore` and removed from VCS (specs live in JIRA, impl details in PRs) - `maven-dependency-plugin` added to `airavata-api` for classpath mode (`copy-dependencies`) ## How to test ```bash # Start infra + server + run tests via Tilt tilt up # Then trigger integration-tests from Tilt UI # Or manually: docker compose up -d mvn package -DskipTests -T4 java -cp "airavata-thrift-server/target/classes:airavata-api/target/classes:airavata-api/target/dependency/*" \ -Dairavata.config.dir=airavata-api/src/main/resources \ org.apache.airavata.api.server.AiravataServer & mvn test -pl integration-tests -Dgroups=integration ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
