This is an automated email from the ASF dual-hosted git repository.

yasithdev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new a5829a069d dev: fix DevStorage cold-start init in the containerized 
server (#623)
a5829a069d is described below

commit a5829a069dab899dc6a56688f64715575bd9eb45
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Sat Jun 6 01:46:27 2026 -0400

    dev: fix DevStorage cold-start init in the containerized server (#623)
    
    Mount conf/ into the server so it finds the dev SFTP keypair and the
    credential-store keystore, and run DevStorageInitializer on
    ApplicationReadyEvent so the default gateway exists before its storage
    preference is added.
---
 .../apache/airavata/orchestration/util/DevStorageInitializer.java | 8 ++++----
 compose.yml                                                       | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/DevStorageInitializer.java
 
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/DevStorageInitializer.java
index 4574be358c..167959ffee 100644
--- 
a/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/DevStorageInitializer.java
+++ 
b/airavata-api/orchestration-service/src/main/java/org/apache/airavata/orchestration/util/DevStorageInitializer.java
@@ -1,6 +1,5 @@
 package org.apache.airavata.orchestration.util;
 
-import jakarta.annotation.PostConstruct;
 import org.apache.airavata.config.ServerSettings;
 import org.apache.airavata.credential.service.CredentialStoreService;
 import 
org.apache.airavata.model.appcatalog.gatewayprofile.proto.StoragePreference;
@@ -15,7 +14,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.annotation.Order;
+import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.context.event.EventListener;
 import org.springframework.stereotype.Component;
 
 import java.io.IOException;
@@ -30,7 +30,6 @@ import java.nio.file.Path;
  * Idempotent: checks if the storage resource already exists before creating.
  */
 @Component
-@Order(200) // Run after ExpCatalogDBInitConfig and AppCatalogDBInitConfig
 public class DevStorageInitializer {
 
     private static final Logger logger = 
LoggerFactory.getLogger(DevStorageInitializer.class);
@@ -53,7 +52,8 @@ public class DevStorageInitializer {
     @Autowired
     private CredentialStoreService credentialStoreService;
 
-    @PostConstruct
+    // Run after DBInitConfig.postInit() creates the default gateway (@Order 
can't sequence @PostConstruct).
+    @EventListener(ApplicationReadyEvent.class)
     public void initialize() {
         try {
             String gatewayId = ServerSettings.getDefaultUserGateway();
diff --git a/compose.yml b/compose.yml
index 769acc9ce6..7b7bce9a7e 100644
--- a/compose.yml
+++ b/compose.yml
@@ -220,6 +220,7 @@ services:
         exec java -jar airavata-server.jar
     volumes:
       - ./conf/traefik/certs/rootCA.pem:/certs/rootCA.pem:ro
+      - ./conf:/opt/airavata/conf:ro   # SSH key, credential keystore, TLS 
read from conf/
     ports:
       - "9090:9090"
     depends_on:

Reply via email to