Skip to content

Commit

Permalink
Remove spring-boot from the feast serving application (#2127)
Browse files Browse the repository at this point in the history
* Remove spring-boot from the feast serving application

Signed-off-by: Achal Shah <achals@gmail.com>

* Remove unused spring-based classes

Signed-off-by: Achal Shah <achals@gmail.com>

* Fix grpc implementation

Signed-off-by: Achal Shah <achals@gmail.com>

* Remove verbose logging

Signed-off-by: Achal Shah <achals@gmail.com>

* Add back integration test and test gcs and s3 for real

Signed-off-by: Achal Shah <achals@gmail.com>

* Read from port

Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals authored Dec 29, 2021
1 parent c9ff695 commit 068389d
Show file tree
Hide file tree
Showing 22 changed files with 649 additions and 575 deletions.
4 changes: 4 additions & 0 deletions java/datatypes/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
their interchanges. These are generated from Protocol Buffers and gRPC
definitions included in the package.
</description>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<artifactId>datatypes-java</artifactId>

<parent>
Expand Down
12 changes: 12 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@
<version>${commons.lang3.version}</version>
</dependency>

<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.0.1</version>
</dependency>

<!-- Google Cloud -->
<dependency>
<groupId>com.google.cloud</groupId>
Expand Down Expand Up @@ -450,6 +456,12 @@
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4jVersion}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>


<!--
Import Spring Boot's dependency management.
Expand Down
93 changes: 33 additions & 60 deletions java/serving/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,39 @@
</plugin>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<skip>false</skip>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>feast.serving.ServingGuiceApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>build-info</id>
<phase>package</phase>
<goals>
<goal>build-info</goal>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>feast.serving.ServingGuiceApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

</plugins>
Expand All @@ -84,53 +104,28 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.0.1</version>
</dependency>

<!-- TODO: SLF4J is being used via Lombok, but also jog4j - pick one -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>

<!--compile "org.springframework.boot:spring-boot-starter-web:${spring.boot.version}"-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--compile 'org.springframework.boot:spring-boot-starter-log4j2'-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>

<!--compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>2.3.1.RELEASE</version>
<scope>test</scope>
</dependency>

<!--compile "io.grpc:grpc-services:${grpc.version}"-->
<dependency>
<groupId>io.grpc</groupId>
Expand Down Expand Up @@ -199,11 +194,6 @@
<artifactId>simpleclient_servlet</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>0.8.0</version>
</dependency>

<dependency>
<groupId>com.google.auto.value</groupId>
Expand Down Expand Up @@ -242,18 +232,6 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
</dependency>
<!--testCompile 'org.springframework.boot:spring-boot-starter-test'-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
Expand Down Expand Up @@ -315,11 +293,6 @@
<artifactId>jakarta.validation-api</artifactId>
<version>${jakarta.validation.api.version}</version>
</dependency>
<dependency>
<groupId>net.devh</groupId>
<artifactId>grpc-server-spring-boot-starter</artifactId>
<version>${grpc.spring.boot.starter.version}</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand Down
38 changes: 0 additions & 38 deletions java/serving/src/main/java/feast/serving/ServingApplication.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright 2018-2021 The Feast Authors
*
* Licensed 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
*
* https://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 feast.serving;

import com.google.inject.Guice;
import com.google.inject.Injector;
import feast.serving.config.*;
import io.grpc.Server;
import java.io.IOException;

public class ServingGuiceApplication {

public static void main(String[] args) throws InterruptedException, IOException {
if (args.length == 0) {
throw new RuntimeException(
"Path to application configuration file needs to be specifed via CLI");
}

final Injector i =
Guice.createInjector(
new ServingServiceConfigV2(),
new RegistryConfig(),
new InstrumentationConfig(),
new ServerModule(),
new ApplicationPropertiesModule(args));

Server server = i.getInstance(Server.class);

server.start();
server.awaitTermination();
}
}
Loading

0 comments on commit 068389d

Please sign in to comment.