This is an automated email from the ASF dual-hosted git repository. yasith pushed a commit to branch feat/spring-module-reorg in repository https://gitbox.apache.org/repos/asf/airavata.git
commit 5029d3b0bb8a48f878705b55b23be858a52cb964 Author: yasithdev <[email protected]> AuthorDate: Fri Mar 27 22:34:51 2026 -0500 feat: create unified airavata-server launcher with distribution assembly --- airavata-server/pom.xml | 98 ++++++++++++++++++++++ .../src/main/assembly/server-bin-assembly.xml | 61 ++++++++++++++ airavata-server/src/main/bin/airavata.sh | 8 ++ .../apache/airavata/server/AiravataServerMain.java | 41 +++++++++ .../src/main/resources/application-grpc.yml | 4 + .../src/main/resources/application-rest.yml | 14 ++++ .../src/main/resources/application-thrift.yml | 4 + airavata-server/src/main/resources/application.yml | 67 +++++++++++++++ pom.xml | 1 + 9 files changed, 298 insertions(+) diff --git a/airavata-server/pom.xml b/airavata-server/pom.xml new file mode 100644 index 0000000000..3c3c88ada8 --- /dev/null +++ b/airavata-server/pom.xml @@ -0,0 +1,98 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata</artifactId> + <version>0.21-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>airavata-server</artifactId> + <name>Airavata Server</name> + <description>Unified launcher for all Airavata server modules</description> + + <dependencies> + <!-- Server modules --> + <dependency> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata-rest-server</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata-grpc-server</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.airavata</groupId> + <artifactId>airavata-thrift-server</artifactId> + <version>${project.version}</version> + </dependency> + + <!-- Spring Boot --> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <exclusions> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-log4j2</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <descriptors> + <descriptor>src/main/assembly/server-bin-assembly.xml</descriptor> + </descriptors> + <finalName>airavata-server-${project.version}</finalName> + <appendAssemblyId>false</appendAssemblyId> + </configuration> + <executions> + <execution> + <id>create-distribution</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/airavata-server/src/main/assembly/server-bin-assembly.xml b/airavata-server/src/main/assembly/server-bin-assembly.xml new file mode 100644 index 0000000000..d976d54a89 --- /dev/null +++ b/airavata-server/src/main/assembly/server-bin-assembly.xml @@ -0,0 +1,61 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 + http://maven.apache.org/xsd/assembly-1.1.3.xsd"> + <id>bin</id> + <formats> + <format>tar.gz</format> + </formats> + <includeBaseDirectory>true</includeBaseDirectory> + + <fileSets> + <!-- launcher script --> + <fileSet> + <directory>src/main/bin</directory> + <outputDirectory>bin</outputDirectory> + <fileMode>0755</fileMode> + </fileSet> + <!-- configuration files --> + <fileSet> + <directory>src/main/resources</directory> + <outputDirectory>conf</outputDirectory> + <includes> + <include>application*.yml</include> + </includes> + </fileSet> + <!-- empty logs directory --> + <fileSet> + <directory>.</directory> + <outputDirectory>logs</outputDirectory> + <excludes> + <exclude>**/*</exclude> + </excludes> + </fileSet> + </fileSets> + + <!-- executable jar --> + <files> + <file> + <source>target/${project.artifactId}-${project.version}.jar</source> + <outputDirectory>lib</outputDirectory> + </file> + </files> +</assembly> diff --git a/airavata-server/src/main/bin/airavata.sh b/airavata-server/src/main/bin/airavata.sh new file mode 100755 index 0000000000..4a12fa1e18 --- /dev/null +++ b/airavata-server/src/main/bin/airavata.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +BASE_DIR="$(dirname "$SCRIPT_DIR")" +CONF_DIR="$BASE_DIR/conf" +LIB_DIR="$BASE_DIR/lib" +JAVA_OPTS="${JAVA_OPTS:--Xms512m -Xmx2g}" +exec java $JAVA_OPTS -jar "$LIB_DIR"/airavata-server-*.jar --spring.config.location="$CONF_DIR/" "$@" diff --git a/airavata-server/src/main/java/org/apache/airavata/server/AiravataServerMain.java b/airavata-server/src/main/java/org/apache/airavata/server/AiravataServerMain.java new file mode 100644 index 0000000000..620730e29f --- /dev/null +++ b/airavata-server/src/main/java/org/apache/airavata/server/AiravataServerMain.java @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.airavata.server; + +import org.apache.airavata.common.config.AiravataServerProperties; +import org.apache.airavata.grpc.server.AiravataGrpcServerConfig; +import org.apache.airavata.rest.server.AiravataRestServerConfig; +import org.apache.airavata.thrift.server.AiravataThriftServerConfig; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Import; + +@SpringBootApplication +@EnableConfigurationProperties(AiravataServerProperties.class) +@Import({ + AiravataRestServerConfig.class, + AiravataGrpcServerConfig.class, + AiravataThriftServerConfig.class +}) +public class AiravataServerMain { + public static void main(String[] args) { + SpringApplication.run(AiravataServerMain.class, args); + } +} diff --git a/airavata-server/src/main/resources/application-grpc.yml b/airavata-server/src/main/resources/application-grpc.yml new file mode 100644 index 0000000000..3fb6e2171b --- /dev/null +++ b/airavata-server/src/main/resources/application-grpc.yml @@ -0,0 +1,4 @@ +grpc: + server: + port: 19900 + max-inbound-message-size: 20971520 diff --git a/airavata-server/src/main/resources/application-rest.yml b/airavata-server/src/main/resources/application-rest.yml new file mode 100644 index 0000000000..8ece0266ff --- /dev/null +++ b/airavata-server/src/main/resources/application-rest.yml @@ -0,0 +1,14 @@ +server: + port: 18889 + +springdoc: + api-docs: + enabled: true + swagger-ui: + path: /swagger-ui.html + operationsSorter: alpha + tagsSorter: alpha + doc-expansion: none + oauth: + use-pkce-with-authorization-code-grant: true + client-id: data-catalog-portal diff --git a/airavata-server/src/main/resources/application-thrift.yml b/airavata-server/src/main/resources/application-thrift.yml new file mode 100644 index 0000000000..da6bd56712 --- /dev/null +++ b/airavata-server/src/main/resources/application-thrift.yml @@ -0,0 +1,4 @@ +airavata: + thrift: + port: 8930 + min-threads: 50 diff --git a/airavata-server/src/main/resources/application.yml b/airavata-server/src/main/resources/application.yml new file mode 100644 index 0000000000..e6e3ca7c98 --- /dev/null +++ b/airavata-server/src/main/resources/application.yml @@ -0,0 +1,67 @@ +airavata: + servers: + - thrift + - rest + - grpc + +spring: + datasource: + url: jdbc:mariadb://localhost:13306/airavata + username: airavata + password: ${AIRAVATA_DB_PASSWORD:123456} + driver-class-name: org.mariadb.jdbc.Driver + hikari: + pool-name: AiravataPool + leak-detection-threshold: 20000 + jpa: + hibernate: + ddl-auto: update + open-in-view: false + servlet: + multipart: + max-file-size: 200MB + max-request-size: 200MB + +management: + endpoints: + web: + exposure: + include: health,info + +airavata.security: + openid-url: http://localhost:18080/realms/default + +airavata.cors: + allowed-origins: http://localhost:5173 + +airavata.kafka: + broker-url: localhost:9092 + +airavata.thrift: + host: localhost + port: 8930 + min-threads: 50 + +airavata.agent: + storage-resource-id: localhost_77116e91-f042-4d3a-ab9c-3e7b4ebcd5bd + storage-path: /tmp + cluster: + application-interface-id: AiravataAgent_f4313e4d-20c2-4bf6-bff1-8aa0f0b0c1d6 + tunnel: + server-host: localhost + server-port: 17000 + server-token: airavata + server-api-url: http://localhost:8000 + +airavata.research: + hub-url: http://localhost:20000 + portal-url: http://localhost:5173 + dev-url: http://localhost:5173 + dev-user: "[email protected]" + admin-api-key: "JUPYTER_ADMIN_API_KEY" + limit: 10 + +airavata.user-profile: + server: + url: localhost + port: 8930 diff --git a/pom.xml b/pom.xml index ffee99715e..95789968d7 100644 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,7 @@ under the License. <module>modules/research-framework/research-service</module> <module>airavata-rest-server</module> <module>airavata-grpc-server</module> + <module>airavata-server</module> </modules> <properties>
