refactor: collapse server modules, flatten structure, eliminate internal Thrift clients#601
Merged
refactor: collapse server modules, flatten structure, eliminate internal Thrift clients#601
Conversation
Move airavata-rest-server, airavata-grpc-server, and airavata-thrift-server
into airavata-server/{rest,grpc,thrift}/ sub-modules with unified package
namespace org.apache.airavata.server.{rest,grpc,thrift}.
…injection Replace all internal ThriftClientPool<RegistryService.Client> and RegistryServiceClientFactory usages in airavata-api with direct calls to the RegistryServerHandler @component via RegistryService.Iface. The handler is registered as a global static reference via Utils.setRegistryHandler() from a @PostConstruct in RegistryServerHandler. All pool/factory patterns (getResource/returnResource/returnBrokenResource, ThriftUtils.close) are removed.
…ect injection
- Replace CredentialStoreClientFactory usages with direct CredentialStoreServerHandler
instantiation in SSHAccountManager, GatewayGroupsInitializer, AgentUtils,
IamAdminServicesHandler, TenantProfileServiceHandler, and AiravataDataMigrator
- Replace ProfileServiceClientFactory usages:
- AiravataTask/TaskContext: use UserProfileRepository directly instead of
UserProfileService Thrift client (avoids circular dep with airavata-server)
- UserProfileServiceHandler: use IamAdminServicesHandler directly
- AiravataDataMigrator: use TenantManagementKeycloakImpl directly
- AiravataService (research-service): use UserProfileRepository directly
- Remove unused getCredentialStoreServiceClient from KeyCloakSecurityManager
- Delete CredentialStoreClientFactory (no remaining references)
- Keep ProfileServiceClientFactory (still used by example clients)
…tion Replace RegistryServiceClientFactory usages in SSHAccountManager, AiravataDataMigrator, KeyCloakSecurityManager, GatewayGroupsInitializer, OrchestratorServerHandler, and IamAdminServicesHandler with direct RegistryServerHandler instantiation. Remove SharingRegistryServiceClientFactory and update GroupManagerServiceHandler and SharingServiceDBEventHandler likewise.
…EntityManagerFactory - Delete 7 JPAUtils classes, 4 catalog-specific abstract repos, 6 JDBCConfig impls - Create EntityManagerFactoryHolder (static bridge) + EntityManagerFactoryRegistrar (@component) - 52 concrete repos now extend base AbstractRepository directly - Fix ~70 entity classes for Hibernate 6 column mapping strictness - Test persistence.xml (test-scope) with single "airavata" unit - 199 unit tests pass, 0 failures
Replace @transient with proper @manytoone @joincolumn(insertable=false, updatable=false) on 48 fields across 47 entity files. Fix duplicate column mappings. Integration tests: 50 pass, 18 errors (test data issues), 33 skipped.
…in/proto Recover directories lost in 384281d when modules/ was removed: - modules/agent-framework/airavata-agent → airavata-agent/ - modules/agent-framework/airavata-fuse → airavata-fuse/ - modules/research-framework/research-hub → airavata-jupyterhub/ - modules/research-framework/simexr_mod → dev-tools/simexr_mod/ Move agent-service proto files to src/main/proto/ for consistency with research-service layout, and update pom.xml sourceDirectory.
- Fix JPQL alias case mismatch (dp → DP) in QueryConstants - Fix ComputeResourceRepository remove operations using orphanRemoval - Fix SharingRegistry cascade (remove CascadeType.PERSIST from UserGroupEntity.groupAdmins) - Fix AbstractRepository.get() with FlushMode.MANUAL to prevent cascade-persist - Fix AbstractRepository.select() to call initializeEntity on results - Replace PersistentMap with HashMap in DataReplicaLocationRepository.initializeEntity - Fix DataReplicaLocationRepositoryTest to avoid duplicate key insertion Integration tests: 102 run, 0 failures, 0 errors, 33 skipped Unit tests: 199 run, 0 failures, 0 errors, 26 skipped
…erge integration-tests - Surefire 3.5.5 with forkCount=1C (1 fork per CPU) - JUnit 5 parallel execution for unit tests (concurrent classes + methods) - @execution(SAME_THREAD) on non-thread-safe tests (DB, SFTP, ServiceLoader) - Clean profile split: mvn test (unit, parallel), mvn test -Pintegration (sequential) - @tag("runtime") for health checks that need full tilt stack - Merge integration-tests module into airavata-api test sources - Fix SharedMariaDBLauncherSessionListener to detect surefire.groups property - Remove build cache extension (Java 25 incompatible) Unit: 182 pass, 0 fail | Integration: 119 pass, 0 fail
Enable SharingServiceIntegrationTest (13 tests) and WorkflowRepositoryTest (1 test) which now pass with the consolidated persistence setup. Fix test logic in addAndRemoveGroupAdmin (user must be group member before admin). Update @disabled reasons on remaining tests to reflect actual root causes (Dozer mapping, FK constraints, test isolation).
- Enable SharingServiceIntegrationTest (13 tests) — single EMF resolved caching issue - Enable WorkflowRepositoryTest (1 test) — works with Hibernate 6 - Fix addAndRemoveGroupAdmin test — user must be added to group before admin - Remaining 19 disabled: all Dozer mapping issues (MapStruct migration needed) Unit: 182 pass, 0 fail, 26 skip | Integration: 119 pass, 0 fail, 19 skip
…READ - ObjectMapperSingleton: eager static init (eliminates 2-3s first-test penalty) - SFTPDeleteDirTest: use OS-assigned port (no more port conflicts, can run parallel) - Fixes race condition in ObjectMapperSingleton (was lazy init without synchronization) Unit: 52s wall clock, 182 pass | Integration: 2:45, 119 pass
5 MapStruct mappers replacing runtime Dozer reflection with compile-time code. 63 repos updated, 3 AbstractRepository bases cleaned, Dozer dependency removed. Unit: 179 pass, 0 fail | Integration: 119 pass, 0 fail
Replace truncate-all-tables cleanup with per-test transaction rollback: - EntityManagerFactoryHolder: ThreadLocal test EntityManager support - 3 AbstractRepository bases: test mode skips transaction management - TestBase: @beforeeach begins transaction, @AfterEach rolls back - 33 test constructors updated (removed Database enum) - Integration profile: classes run in parallel (ForkJoinPool) Integration tests: 2:23 (was 2:45) — 22s saved from parallelism Unit: 179 pass | Integration: 119 pass | 0 failures
…r gaps Re-enabled tests: - ComputeResourceRepositoryTest: listComputeResourcesTest, updateComputeResourceTest, addComputeResourceTest, addUnicoreDataMovementTest - ExperimentStatusRepositoryTest: ExperimentStatusRepositoryTest Mapper fixes: - BatchQueue: maxRuntime <-> maxRunTime field name mismatch - UnicoreDataMovement: unicoreEndpointUrl <-> unicoreEndPointURL mismatch - ApplicationDeployment: defaultWallTime <-> defaultWalltime mismatch - UserResourceProfile: gatewayId <-> gatewayID mismatch - GatewayResourceProfile: gatewayId <-> gatewayID mismatch JPA fixes: - Add insertable=false to @joincolumn on GroupComputeResourcePrefEntity, BatchQueueResourcePolicyEntity, ComputeResourcePolicyEntity to prevent duplicate column mapping with @id fields Updated @disabled reasons on 14 remaining tests to reflect actual root causes.
Add @onetomany(cascade=ALL, orphanRemoval=true) on ResourceJobManagerEntity for JobManagerCommandEntity and ParallelismCommandEntity children, enabling cascading deletes. Re-enable deleteResourceJobManagerTest. Switch integration test parallelism from same_thread to concurrent for methods, increase dynamic factor to 2, add forkCount=1C. Guard deadlock-prone tests (ApplicationInterfaceRepositoryTest, SharingServiceIntegrationTest, DatabaseTestCases) with @execution(SAME_THREAD).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Structure
modules/{research-service,agent-service,file-server}→airavata-api/sub-modulesairavata-rest-server,airavata-grpc-server,airavata-thrift-server→airavata-server/{rest,grpc,thrift}sub-modulesairavata-agent/,airavata-fuse/,airavata-jupyterhub/,dev-tools/simexr_mod/agent-service/proto/→agent-service/src/main/proto/airavata-apitest sourcesPersistence
Thrift Client Elimination
Dozer → MapStruct
Build & Test
forkCount=1C, JUnit 5 parallel executionmvn test(unit, parallel),mvn test -Pintegration(parallel, Testcontainers)@Tag("runtime")for health checks requiring full tilt stackFinal structure
686 files changed, -3,082 lines net
Test Results
mvn test— 179 unit tests pass (52s, parallel)mvn test -Pintegration— 119 integration tests pass (1:15, parallel, Testcontainers)mvn clean install -DskipTests -T4— all modules build🤖 Generated with Claude Code