Skip to content

refactor: unified transport servers — Spring module reorganization#600

Merged
yasithdev merged 11 commits intomasterfrom
feat/spring-module-reorg
Mar 28, 2026
Merged

refactor: unified transport servers — Spring module reorganization#600
yasithdev merged 11 commits intomasterfrom
feat/spring-module-reorg

Conversation

@yasithdev
Copy link
Copy Markdown
Contributor

Summary

  • Hibernate migration: Replaced OpenJPA with Hibernate across all 127 entities in airavata-api (13 @ForeignKey@OnDelete annotations, removed bytecode enhancement plugin, deleted persistence.xml)
  • Module conversion: Converted research-service, agent-service, and file-server from standalone Spring Boot apps to plain library jars — stripped @SpringBootApplication, auth filters, OpenAPI/CORS config, assembly descriptors
  • New transport servers: Created airavata-rest-server (unified REST surface with centralized auth, OpenAPI, CORS, absorbed Kafka proxy from restproxy) and airavata-grpc-server (unified gRPC with auth interceptor)
  • Thrift server Spring Boot wrap: Converted airavata-thrift-server from custom main() bootstrap to Spring-managed SmartLifecycle with handlers as @Component beans
  • Unified launcher: Created airavata-server module with @SpringBootApplication, conditional server activation via @ConditionalOnServer, single application.yml, distribution tarball
  • Shared infrastructure: @ConditionalOnServer annotation, unified UserContext, AiravataServerProperties
  • API normalization: File-server endpoints moved under /api/v1/files/*

Architecture after this PR

airavata-server (launcher — @SpringBootApplication)
├── airavata-rest-server   (@ConditionalOnServer("rest"))
├── airavata-grpc-server   (@ConditionalOnServer("grpc"))
├── airavata-thrift-server (@ConditionalOnServer("thrift"))
└── modules/ (plain library jars)
    ├── research-service
    ├── agent-service
    └── file-server

All servers share one ApplicationContext and can be selectively activated:

./bin/airavata.sh --airavata.servers=rest --airavata.servers=grpc

Test Plan

  • Full mvn clean install -DskipTests -T4 passes (all 10 modules)
  • mvn test passes on airavata-api and airavata-thrift-server
  • tilt up starts unified server with all three transports
  • REST endpoints accessible on port 18889 (Swagger UI at /swagger-ui.html)
  • gRPC services accessible on port 19900
  • Thrift services accessible on port 8930
  • Auth filter correctly extracts Bearer token and X-Claims headers

🤖 Generated with Claude Code

Replace OpenJPA dependency, bytecode enhancement plugin, and
@foreignkey annotations with Hibernate equivalents (@onDelete).
Delete persistence.xml — no longer needed with Hibernate runtime
proxies. EntityManagerFactory usage in JPAUtils noted but left for
the Spring Boot wrapping task.
…rary

- Remove spring-boot-maven-plugin, maven-assembly-plugin, and actuator dependency
- Add AgentServiceConfig for component scanning, entity scanning, JPA repos
- Add AgentProperties (@ConfigurationProperties) replacing @value annotations
- Replace local UserContext with unified org.apache.airavata.common.security.UserContext
- Delete AgentServiceApplication, AuthzTokenFilter, application.yml, assembly descriptor
Replace the custom main() bootstrap in AiravataServer.java with
Spring-managed components:

- AiravataThriftServerConfig: @ConditionalOnServer("thrift") entry point
- ThriftProcessorConfig: builds TMultiplexedProcessor as a @bean
- ThriftServerLifecycle: SmartLifecycle that manages TThreadPoolServer
- BackgroundServicesConfig: @PostConstruct DB initialization

All handlers annotated with @component. OrchestratorServerHandler
created via @bean factory with graceful fallback on init failure.
Background services (Helix, monitoring, etc.) deferred to future task.
Replace 5 separate service definitions (airavata-server, research-service,
agent-service, file-server, rest-proxy) with a single unified airavata-server
entry. Update build deps to track new server modules.
The unified airavata-server module now produces the distribution tarball,
so the assembly plugin and descriptor files in airavata-api are no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant