You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2024/09/16 21:00:16 UTC
(airavata) branch agent-framewok-refactoring created (now 7781882abc)
This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a change to branch agent-framewok-refactoring
in repository https://gitbox.apache.org/repos/asf/airavata.git
at 7781882abc Refactoring agent service and adding db connection
This branch includes the following new commits:
new 7781882abc Refactoring agent service and adding db connection
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(airavata) 01/01: Refactoring agent service and adding db connection
Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dimuthuupe pushed a commit to branch agent-framewok-refactoring
in repository https://gitbox.apache.org/repos/asf/airavata.git
commit 7781882abc4655fa0761d347871cef9e2d4ca407
Author: Dimuthu Wannipurage <di...@gatech.edu>
AuthorDate: Mon Sep 16 17:00:04 2024 -0400
Refactoring agent service and adding db connection
---
.../{connection-service => agent-service}/pom.xml | 23 +++++--
.../main/assembly/agent-service-bin-assembly.xml} | 2 +-
.../service/AgentServiceApplication.java} | 6 +-
.../agent/connection/service/UserContext.java | 0
.../service/config/AuthzTokenFilter.java | 0
.../service/config/ClusterApplicationConfig.java | 0
.../service/controllers/AgentController.java | 24 +++----
.../service/controllers/ExperimentController.java | 16 ++---
.../service/db/entity/AgentDeploymentInfo.java | 59 ++++++++++++++++
.../service/db/entity/AgentExecution.java | 48 +++++++++++++
.../service/db/entity/AgentExecutionStatus.java | 76 +++++++++++++++++++++
.../service/db/repo/AgentDeploymentInfoRepo.java | 9 +++
.../service/db/repo/AgentExecutionRepo.java | 9 +++
.../service/db/repo/AgentExecutionStatusRepo.java | 9 +++
.../service/handlers/AgentConnectionHandler.java} | 6 +-
.../service/handlers/AgentManagementHandler.java} | 6 +-
.../connection/service/handlers/FuseFSHandler.java | 0
.../connection/service/models/AgentCommandAck.java | 0
.../service/models/AgentCommandRequest.java | 0
.../service/models/AgentCommandResponse.java | 0
.../service/models/AgentInfoResponse.java | 0
.../connection/service/models/AgentTunnelAck.java | 0
.../service/models/AgentTunnelCreationRequest.java | 0
.../connection/service/models/DirectoryInfo.java | 0
.../service/models/ExperimentStorageResponse.java | 0
.../agent/connection/service/models/FileInfo.java | 0
.../service/models/JupyterExecutionAck.java | 0
.../service/models/JupyterExecutionRequest.java | 0
.../service/models/JupyterExecutionResponse.java | 0
.../service/models/LaunchAgentRequest.java | 0
.../service/models/LaunchAgentResponse.java | 0
.../service/models/TerminateAgentResponse.java | 0
.../service/services/AiravataFileService.java | 0
.../service/services/AiravataService.java | 0
.../src/main/proto/agent-communication.proto | 0
.../src/main/proto/airavata-fuse.proto | 0
.../src/main/resources/application.yml | 37 ++++++++++
.../distribution/bin/connection-service-daemon.sh | 0
.../distribution/bin/connection-service.sh | 0
.../src/main/resources/distribution/bin/setenv.sh | 0
.../resources/distribution/conf/application.yml | 2 +-
.../resources/distribution/conf/truststore.jks | Bin
.../src/main/resources/truststore.jks | Bin
.../src/main/resources/application.yml | 19 ------
modules/agent-framework/pom.xml | 2 +-
45 files changed, 298 insertions(+), 55 deletions(-)
diff --git a/modules/agent-framework/connection-service/pom.xml b/modules/agent-framework/agent-service/pom.xml
similarity index 87%
rename from modules/agent-framework/connection-service/pom.xml
rename to modules/agent-framework/agent-service/pom.xml
index 619c872692..167d08871b 100644
--- a/modules/agent-framework/connection-service/pom.xml
+++ b/modules/agent-framework/agent-service/pom.xml
@@ -9,7 +9,7 @@
<version>0.21-SNAPSHOT</version>
</parent>
- <artifactId>connection-service</artifactId>
+ <artifactId>agent-service</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
@@ -24,7 +24,7 @@
<protobuf.version>3.23.4</protobuf.version>
<protobuf-plugin.version>0.6.1</protobuf-plugin.version>
<grpc.version>1.63.0</grpc.version>
- <connection.service.dist.name>Connection-Service-0.01</connection.service.dist.name>
+ <agent.service.dist.name>Agent-Service-0.01</agent.service.dist.name>
</properties>
<dependencyManagement>
@@ -40,6 +40,11 @@
</dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>1.5.7</version>
+ </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
@@ -50,6 +55,16 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-to-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
@@ -105,9 +120,9 @@
</goals>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
- <finalName>${connection.service.dist.name}</finalName>
+ <finalName>${agent.service.dist.name}</finalName>
<descriptors>
- <descriptor>src/main/assembly/connection-service-bin-assembly.xml</descriptor>
+ <descriptor>src/main/assembly/agent-service-bin-assembly.xml</descriptor>
</descriptors>
<attach>false</attach>
</configuration>
diff --git a/modules/agent-framework/connection-service/src/main/assembly/connection-service-bin-assembly.xml b/modules/agent-framework/agent-service/src/main/assembly/agent-service-bin-assembly.xml
similarity index 97%
rename from modules/agent-framework/connection-service/src/main/assembly/connection-service-bin-assembly.xml
rename to modules/agent-framework/agent-service/src/main/assembly/agent-service-bin-assembly.xml
index 38d8f1c565..0d47334a4b 100644
--- a/modules/agent-framework/connection-service/src/main/assembly/connection-service-bin-assembly.xml
+++ b/modules/agent-framework/agent-service/src/main/assembly/agent-service-bin-assembly.xml
@@ -38,7 +38,7 @@
<assembly>
<id>bin</id>
<includeBaseDirectory>true</includeBaseDirectory>
- <baseDirectory>${connection.service.dist.name}</baseDirectory>
+ <baseDirectory>${agent.service.dist.name}</baseDirectory>
<formats>
<format>tar.gz</format>
<format>zip</format>
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/ConnectionServiceApplication.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/AgentServiceApplication.java
similarity index 54%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/ConnectionServiceApplication.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/AgentServiceApplication.java
index b76217a554..a001f961a5 100644
--- a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/ConnectionServiceApplication.java
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/AgentServiceApplication.java
@@ -2,10 +2,12 @@ package org.apache.airavata.agent.connection.service;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@SpringBootApplication
-public class ConnectionServiceApplication {
+@EnableJpaRepositories()
+public class AgentServiceApplication {
public static void main(String[] args) {
- SpringApplication.run(ConnectionServiceApplication.class, args);
+ SpringApplication.run(AgentServiceApplication.class, args);
}
}
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/UserContext.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/UserContext.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/UserContext.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/UserContext.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/config/AuthzTokenFilter.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/config/AuthzTokenFilter.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/config/AuthzTokenFilter.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/config/AuthzTokenFilter.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/config/ClusterApplicationConfig.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/config/ClusterApplicationConfig.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/config/ClusterApplicationConfig.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/config/ClusterApplicationConfig.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/AgentController.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/AgentController.java
similarity index 69%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/AgentController.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/AgentController.java
index 19a35fe0e6..aaa0f30894 100644
--- a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/AgentController.java
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/AgentController.java
@@ -1,6 +1,6 @@
package org.apache.airavata.agent.connection.service.controllers;
-import org.apache.airavata.agent.connection.service.handlers.AgentHandler;
+import org.apache.airavata.agent.connection.service.handlers.AgentConnectionHandler;
import org.apache.airavata.agent.connection.service.models.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -16,27 +16,27 @@ public class AgentController {
private final static Logger logger = LoggerFactory.getLogger(AgentController.class);
- private AgentHandler agentHandler;
+ private AgentConnectionHandler agentConnectionHandler;
- public AgentController(AgentHandler agentHandler) {
- this.agentHandler = agentHandler;
+ public AgentController(AgentConnectionHandler agentConnectionHandler) {
+ this.agentConnectionHandler = agentConnectionHandler;
}
@GetMapping("/{agentId}")
public ResponseEntity<AgentInfoResponse> getAgentInfo(@PathVariable("agentId") String agentId) {
- return ResponseEntity.accepted().body(agentHandler.isAgentUp(agentId));
+ return ResponseEntity.accepted().body(agentConnectionHandler.isAgentUp(agentId));
}
@PostMapping("/tunnel")
public ResponseEntity<AgentTunnelAck> runTunnelCreationOnAgent(@Valid @RequestBody AgentTunnelCreationRequest tunnelRequest) {
- return ResponseEntity.accepted().body(agentHandler.runTunnelOnAgent(tunnelRequest));
+ return ResponseEntity.accepted().body(agentConnectionHandler.runTunnelOnAgent(tunnelRequest));
}
@PostMapping("/executecommandrequest")
public ResponseEntity<AgentCommandAck> runCommandOnAgent(@Valid @RequestBody AgentCommandRequest commandRequest) {
logger.info("Received command request to run on agent {}", commandRequest.getAgentId());
- if (agentHandler.isAgentUp(commandRequest.getAgentId()).isAgentUp()) {
- return ResponseEntity.accepted().body(agentHandler.runCommandOnAgent(commandRequest));
+ if (agentConnectionHandler.isAgentUp(commandRequest.getAgentId()).isAgentUp()) {
+ return ResponseEntity.accepted().body(agentConnectionHandler.runCommandOnAgent(commandRequest));
} else {
logger.warn("No agent is available to run on agent {}", commandRequest.getAgentId());
AgentCommandAck ack = new AgentCommandAck();
@@ -47,14 +47,14 @@ public class AgentController {
@GetMapping("/executecommandresponse/{executionId}")
public ResponseEntity<AgentCommandResponse> getExecutionResponse(@PathVariable("executionId") String executionId) {
- return ResponseEntity.accepted().body(agentHandler.getAgentCommandResponse(executionId));
+ return ResponseEntity.accepted().body(agentConnectionHandler.getAgentCommandResponse(executionId));
}
@PostMapping("/executejupyterrequest")
public ResponseEntity<JupyterExecutionAck> runJupyterOnAgent(@Valid @RequestBody JupyterExecutionRequest executionRequest) {
logger.info("Received jupyter execution request to run on agent {}", executionRequest.getAgentId());
- if (agentHandler.isAgentUp(executionRequest.getAgentId()).isAgentUp()) {
- return ResponseEntity.accepted().body(agentHandler.runJupyterOnAgent(executionRequest));
+ if (agentConnectionHandler.isAgentUp(executionRequest.getAgentId()).isAgentUp()) {
+ return ResponseEntity.accepted().body(agentConnectionHandler.runJupyterOnAgent(executionRequest));
} else {
logger.warn("No agent is available to run on agent {}", executionRequest.getAgentId());
JupyterExecutionAck ack = new JupyterExecutionAck();
@@ -65,7 +65,7 @@ public class AgentController {
@GetMapping("/executejupyterresponse/{executionId}")
public ResponseEntity<JupyterExecutionResponse> getJupyterResponse(@PathVariable("executionId") String executionId) {
- return ResponseEntity.accepted().body(agentHandler.getJupyterExecutionResponse(executionId));
+ return ResponseEntity.accepted().body(agentConnectionHandler.getJupyterExecutionResponse(executionId));
}
}
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/ExperimentController.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/ExperimentController.java
similarity index 67%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/ExperimentController.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/ExperimentController.java
index 00ea9481db..2e59fac479 100644
--- a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/ExperimentController.java
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/controllers/ExperimentController.java
@@ -1,6 +1,6 @@
package org.apache.airavata.agent.connection.service.controllers;
-import org.apache.airavata.agent.connection.service.handlers.ExperimentHandler;
+import org.apache.airavata.agent.connection.service.handlers.AgentManagementHandler;
import org.apache.airavata.agent.connection.service.models.LaunchAgentRequest;
import org.apache.airavata.agent.connection.service.models.LaunchAgentResponse;
import org.apache.airavata.agent.connection.service.models.TerminateAgentResponse;
@@ -8,34 +8,32 @@ import org.apache.airavata.model.experiment.ExperimentModel;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import javax.validation.Valid;
-import java.net.URI;
@RestController
@RequestMapping("/api/v1/exp")
public class ExperimentController {
- private final ExperimentHandler experimentHandler;
+ private final AgentManagementHandler agentManagementHandler;
- public ExperimentController(ExperimentHandler experimentHandler) {
- this.experimentHandler = experimentHandler;
+ public ExperimentController(AgentManagementHandler agentManagementHandler) {
+ this.agentManagementHandler = agentManagementHandler;
}
@GetMapping(value = "/{expId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ExperimentModel> getExperiment(@PathVariable("expId") String expId) {
- return ResponseEntity.ok(experimentHandler.getExperiment(expId));
+ return ResponseEntity.ok(agentManagementHandler.getExperiment(expId));
}
@PostMapping(value = "/launch", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<LaunchAgentResponse> createAndLaunchExperiment(@Valid @RequestBody LaunchAgentRequest request) {
- LaunchAgentResponse agentResponse = experimentHandler.createAndLaunchExperiment(request);
+ LaunchAgentResponse agentResponse = agentManagementHandler.createAndLaunchExperiment(request);
return ResponseEntity.ok(agentResponse);
}
@GetMapping(value = "/terminate/{expId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TerminateAgentResponse> terminateExperiment(@PathVariable("expId") String expId) {
- return ResponseEntity.ok(experimentHandler.terminateExperiment(expId));
+ return ResponseEntity.ok(agentManagementHandler.terminateExperiment(expId));
}
}
diff --git a/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentDeploymentInfo.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentDeploymentInfo.java
new file mode 100644
index 0000000000..13e4c98e3c
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentDeploymentInfo.java
@@ -0,0 +1,59 @@
+package org.apache.airavata.agent.connection.service.db.entity;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
+import org.hibernate.annotations.GenericGenerator;
+
+
+@Entity(name = "AGENT_DEPLOYMENT_INFO")
+public class AgentDeploymentInfo {
+
+ @Id
+ @Column(name = "AGENT_DEPLOYMENT_INFO_ID")
+ @GeneratedValue(generator = "uuid")
+ @GenericGenerator(name = "uuid", strategy = "uuid2")
+ private String id;
+
+ @Column(unique = true, name = "USER_FRINEDLY_NAME")
+ private String userFriendlyName;
+
+ @Column(name= "COMPUTE_RESOURCE_ID")
+ private String computeResourceId;
+
+ @Column(name ="AGENT_APPLICATION_ID")
+ private String agentApplicationId;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getUserFriendlyName() {
+ return userFriendlyName;
+ }
+
+ public void setUserFriendlyName(String userFriendlyName) {
+ this.userFriendlyName = userFriendlyName;
+ }
+
+ public String getComputeResourceId() {
+ return computeResourceId;
+ }
+
+ public void setComputeResourceId(String computeResourceId) {
+ this.computeResourceId = computeResourceId;
+ }
+
+ public String getAgentApplicationId() {
+ return agentApplicationId;
+ }
+
+ public void setAgentApplicationId(String agentApplicationId) {
+ this.agentApplicationId = agentApplicationId;
+ }
+}
diff --git a/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentExecution.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentExecution.java
new file mode 100644
index 0000000000..c80865d9f3
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentExecution.java
@@ -0,0 +1,48 @@
+package org.apache.airavata.agent.connection.service.db.entity;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
+
+
+@Entity(name = "AGENT_EXECUTION")
+public class AgentExecution {
+ @Id
+ @GeneratedValue(generator = "uuid")
+ @GenericGenerator(name = "uuid", strategy = "uuid2")
+ @Column(name = "AGENT_EXECUTION_ID")
+ private String id;
+
+ @Column(name = "AGENT_ID")
+ private String agentId;
+
+ @Column(name = "AIRAVATA_EXPERIMENT_ID")
+ private String airavataExperimentId;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getAgentId() {
+ return agentId;
+ }
+
+ public void setAgentId(String agentId) {
+ this.agentId = agentId;
+ }
+
+ public String getAiravataExperimentId() {
+ return airavataExperimentId;
+ }
+
+ public void setAiravataExperimentId(String airavataExperimentId) {
+ this.airavataExperimentId = airavataExperimentId;
+ }
+}
diff --git a/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentExecutionStatus.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentExecutionStatus.java
new file mode 100644
index 0000000000..e69c028874
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/entity/AgentExecutionStatus.java
@@ -0,0 +1,76 @@
+package org.apache.airavata.agent.connection.service.db.entity;
+
+import jakarta.persistence.*;
+import org.hibernate.annotations.GenericGenerator;
+
+
+@Entity(name = "AGENT_EXECUTION_STATUS")
+public class AgentExecutionStatus {
+
+ public static enum ExecutionStatus {
+ SUBMITTED_TO_CLUSTER,
+ FAILED,
+ CONNECTED,
+ CONNECTION_BROKEN,
+ TERMINATING,
+ TERMINATED,
+ }
+
+ @Id
+ @GeneratedValue(generator = "uuid")
+ @GenericGenerator(name = "uuid", strategy = "uuid2")
+ @Column(name = "AGENT_EXECUTION_STATUS_ID")
+ private String id;
+
+ @ManyToOne(targetEntity = AgentExecution.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+ private AgentExecution agentExecution;
+
+ @Column(name = "UPDATED_TIME")
+ private long updateTime;
+
+ @Column(name = "STATUS")
+ private ExecutionStatus status;
+
+ @Column(name = "ADDITIONAL_INFO", length = 2000)
+ private String additionalInfo;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public AgentExecution getAgentExecution() {
+ return agentExecution;
+ }
+
+ public void setAgentExecution(AgentExecution agentExecution) {
+ this.agentExecution = agentExecution;
+ }
+
+ public long getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(long updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public ExecutionStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(ExecutionStatus status) {
+ this.status = status;
+ }
+
+ public String getAdditionalInfo() {
+ return additionalInfo;
+ }
+
+ public void setAdditionalInfo(String additionalInfo) {
+ this.additionalInfo = additionalInfo;
+ }
+}
diff --git a/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentDeploymentInfoRepo.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentDeploymentInfoRepo.java
new file mode 100644
index 0000000000..4dd7cfd551
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentDeploymentInfoRepo.java
@@ -0,0 +1,9 @@
+package org.apache.airavata.agent.connection.service.db.repo;
+
+import org.apache.airavata.agent.connection.service.db.entity.AgentDeploymentInfo;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface AgentDeploymentInfoRepo extends CrudRepository<AgentDeploymentInfo, String> {
+}
diff --git a/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentExecutionRepo.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentExecutionRepo.java
new file mode 100644
index 0000000000..99cee93c2a
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentExecutionRepo.java
@@ -0,0 +1,9 @@
+package org.apache.airavata.agent.connection.service.db.repo;
+
+import org.apache.airavata.agent.connection.service.db.entity.AgentExecution;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface AgentExecutionRepo extends CrudRepository<AgentExecution, String> {
+}
diff --git a/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentExecutionStatusRepo.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentExecutionStatusRepo.java
new file mode 100644
index 0000000000..c7e605f46f
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/db/repo/AgentExecutionStatusRepo.java
@@ -0,0 +1,9 @@
+package org.apache.airavata.agent.connection.service.db.repo;
+
+import org.apache.airavata.agent.connection.service.db.entity.AgentExecutionStatus;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface AgentExecutionStatusRepo extends CrudRepository<AgentExecutionStatus, String> {
+}
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentHandler.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentConnectionHandler.java
similarity index 98%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentHandler.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentConnectionHandler.java
index fc9138c840..199cff852a 100644
--- a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentHandler.java
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentConnectionHandler.java
@@ -18,9 +18,9 @@ import java.util.concurrent.ConcurrentHashMap;
@GrpcService
-public class AgentHandler extends AgentCommunicationServiceGrpc.AgentCommunicationServiceImplBase {
+public class AgentConnectionHandler extends AgentCommunicationServiceGrpc.AgentCommunicationServiceImplBase {
- private final static Logger logger = LoggerFactory.getLogger(AgentHandler.class);
+ private final static Logger logger = LoggerFactory.getLogger(AgentConnectionHandler.class);
// <streamId, StreamObserver>
private final Map<String, StreamObserver<ServerMessage>> ACTIVE_STREAMS = new ConcurrentHashMap<>();
@@ -33,7 +33,7 @@ public class AgentHandler extends AgentCommunicationServiceGrpc.AgentCommunicati
private final AiravataFileService airavataFileService;
- public AgentHandler(AiravataFileService airavataFileService) {
+ public AgentConnectionHandler(AiravataFileService airavataFileService) {
this.airavataFileService = airavataFileService;
}
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/ExperimentHandler.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentManagementHandler.java
similarity index 97%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/ExperimentHandler.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentManagementHandler.java
index c4f2a37d94..f50fb4f9d8 100644
--- a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/ExperimentHandler.java
+++ b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/AgentManagementHandler.java
@@ -25,16 +25,16 @@ import java.util.UUID;
import java.util.stream.Collectors;
@Service
-public class ExperimentHandler {
+public class AgentManagementHandler {
- private final static Logger LOGGER = LoggerFactory.getLogger(ExperimentHandler.class);
+ private final static Logger LOGGER = LoggerFactory.getLogger(AgentManagementHandler.class);
private final AiravataService airavataService;
private final ClusterApplicationConfig clusterApplicationConfig;
@Value("${airavata.storageResourceId}")
private String storageResourceId;
- public ExperimentHandler(AiravataService airavataService, ClusterApplicationConfig clusterApplicationConfig) {
+ public AgentManagementHandler(AiravataService airavataService, ClusterApplicationConfig clusterApplicationConfig) {
this.airavataService = airavataService;
this.clusterApplicationConfig = clusterApplicationConfig;
}
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/FuseFSHandler.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/FuseFSHandler.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/FuseFSHandler.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/handlers/FuseFSHandler.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandAck.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandAck.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandAck.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandAck.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandRequest.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandRequest.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandRequest.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandRequest.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandResponse.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandResponse.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandResponse.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentCommandResponse.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentInfoResponse.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentInfoResponse.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentInfoResponse.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentInfoResponse.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelAck.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelAck.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelAck.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelAck.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelCreationRequest.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelCreationRequest.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelCreationRequest.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/AgentTunnelCreationRequest.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/DirectoryInfo.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/DirectoryInfo.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/DirectoryInfo.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/DirectoryInfo.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/ExperimentStorageResponse.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/ExperimentStorageResponse.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/ExperimentStorageResponse.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/ExperimentStorageResponse.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/FileInfo.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/FileInfo.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/FileInfo.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/FileInfo.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionAck.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionAck.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionAck.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionAck.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionRequest.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionRequest.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionRequest.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionRequest.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionResponse.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionResponse.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionResponse.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/JupyterExecutionResponse.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentRequest.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentRequest.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentRequest.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentRequest.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentResponse.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentResponse.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentResponse.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/LaunchAgentResponse.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/TerminateAgentResponse.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/TerminateAgentResponse.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/models/TerminateAgentResponse.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/models/TerminateAgentResponse.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataFileService.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataFileService.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataFileService.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataFileService.java
diff --git a/modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataService.java b/modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataService.java
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataService.java
rename to modules/agent-framework/agent-service/src/main/java/org/apache/airavata/agent/connection/service/services/AiravataService.java
diff --git a/modules/agent-framework/connection-service/src/main/proto/agent-communication.proto b/modules/agent-framework/agent-service/src/main/proto/agent-communication.proto
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/proto/agent-communication.proto
rename to modules/agent-framework/agent-service/src/main/proto/agent-communication.proto
diff --git a/modules/agent-framework/connection-service/src/main/proto/airavata-fuse.proto b/modules/agent-framework/agent-service/src/main/proto/airavata-fuse.proto
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/proto/airavata-fuse.proto
rename to modules/agent-framework/agent-service/src/main/proto/airavata-fuse.proto
diff --git a/modules/agent-framework/agent-service/src/main/resources/application.yml b/modules/agent-framework/agent-service/src/main/resources/application.yml
new file mode 100644
index 0000000000..6f810f668b
--- /dev/null
+++ b/modules/agent-framework/agent-service/src/main/resources/application.yml
@@ -0,0 +1,37 @@
+grpc:
+ server:
+ port: 19900
+
+server:
+ port: 18880
+ address: 0.0.0.0
+
+spring:
+ servlet:
+ multipart:
+ max-file-size: 200MB
+ max-request-size: 200MB
+ datasource:
+ url: "jdbc:mariadb://localhost:13306/app_catalog"
+ username: "root"
+ password: "123456"
+ driver-class-name: org.mariadb.jdbc.Driver
+ hikari:
+ pool-name: AppCatalogPool
+ leak-detection-threshold: 20000
+ jpa:
+ hibernate:
+ ddl-auto: create
+ open-in-view: false
+
+airavata:
+ server:
+ url: scigap02.sciencegateways.iu.edu
+ port: 9930
+ truststore:
+ path: CHANGE_ME
+ storageResourceId: gf4.ucs.indiana.edu_61552681-96f0-462a-a36c-a62a010bffc6
+ cluster:
+ applicationInterfaceId:
+ expanse: AiravataAgent_f4313e4d-20c2-4bf6-bff1-8aa0f0b0c1d6
+ jetstream: UPDATE
diff --git a/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service-daemon.sh b/modules/agent-framework/agent-service/src/main/resources/distribution/bin/connection-service-daemon.sh
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service-daemon.sh
rename to modules/agent-framework/agent-service/src/main/resources/distribution/bin/connection-service-daemon.sh
diff --git a/modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service.sh b/modules/agent-framework/agent-service/src/main/resources/distribution/bin/connection-service.sh
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/resources/distribution/bin/connection-service.sh
rename to modules/agent-framework/agent-service/src/main/resources/distribution/bin/connection-service.sh
diff --git a/modules/agent-framework/connection-service/src/main/resources/distribution/bin/setenv.sh b/modules/agent-framework/agent-service/src/main/resources/distribution/bin/setenv.sh
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/resources/distribution/bin/setenv.sh
rename to modules/agent-framework/agent-service/src/main/resources/distribution/bin/setenv.sh
diff --git a/modules/agent-framework/connection-service/src/main/resources/distribution/conf/application.yml b/modules/agent-framework/agent-service/src/main/resources/distribution/conf/application.yml
similarity index 88%
rename from modules/agent-framework/connection-service/src/main/resources/distribution/conf/application.yml
rename to modules/agent-framework/agent-service/src/main/resources/distribution/conf/application.yml
index b7f87714ed..35e899b31e 100644
--- a/modules/agent-framework/connection-service/src/main/resources/distribution/conf/application.yml
+++ b/modules/agent-framework/agent-service/src/main/resources/distribution/conf/application.yml
@@ -11,7 +11,7 @@ airavata:
url: scigap02.sciencegateways.iu.edu
port: 9930
truststore:
- path: /Users/lahiruj/Projects/airavata/lahiruj/modules/agent-framework/connection-service/src/main/resources/trustore.jks
+ path: /Users/lahiruj/Projects/airavata/lahiruj/modules/agent-framework/agent-service/src/main/resources/trustore.jks
storageResourceId: gf4.ucs.indiana.edu_61552681-96f0-462a-a36c-a62a010bffc6
cluster:
applicationInterfaceId:
diff --git a/modules/agent-framework/connection-service/src/main/resources/distribution/conf/truststore.jks b/modules/agent-framework/agent-service/src/main/resources/distribution/conf/truststore.jks
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/resources/distribution/conf/truststore.jks
rename to modules/agent-framework/agent-service/src/main/resources/distribution/conf/truststore.jks
diff --git a/modules/agent-framework/connection-service/src/main/resources/truststore.jks b/modules/agent-framework/agent-service/src/main/resources/truststore.jks
similarity index 100%
rename from modules/agent-framework/connection-service/src/main/resources/truststore.jks
rename to modules/agent-framework/agent-service/src/main/resources/truststore.jks
diff --git a/modules/agent-framework/connection-service/src/main/resources/application.yml b/modules/agent-framework/connection-service/src/main/resources/application.yml
deleted file mode 100644
index f995f7045f..0000000000
--- a/modules/agent-framework/connection-service/src/main/resources/application.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-grpc:
- server:
- port: 19900
-
-server:
- port: 18880
- address: 0.0.0.0
-
-airavata:
- server:
- url: scigap02.sciencegateways.iu.edu
- port: 9930
- truststore:
- path: CHANGE_ME
- storageResourceId: gf4.ucs.indiana.edu_61552681-96f0-462a-a36c-a62a010bffc6
- cluster:
- applicationInterfaceId:
- expanse: AiravataAgent_f4313e4d-20c2-4bf6-bff1-8aa0f0b0c1d6
- jetstream: UPDATE
diff --git a/modules/agent-framework/pom.xml b/modules/agent-framework/pom.xml
index d07570f03b..0d19265b9c 100644
--- a/modules/agent-framework/pom.xml
+++ b/modules/agent-framework/pom.xml
@@ -13,7 +13,7 @@
<artifactId>agent-framework</artifactId>
<packaging>pom</packaging>
<modules>
- <module>connection-service</module>
+ <module>agent-service</module>
</modules>
<properties>