Skip to content

Commit 068389d

Browse files
authored
Remove spring-boot from the feast serving application (feast-dev#2127)
* 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>
1 parent c9ff695 commit 068389d

22 files changed

+649
-575
lines changed

java/datatypes/java/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
their interchanges. These are generated from Protocol Buffers and gRPC
2727
definitions included in the package.
2828
</description>
29+
<properties>
30+
<maven.compiler.source>11</maven.compiler.source>
31+
<maven.compiler.target>11</maven.compiler.target>
32+
</properties>
2933
<artifactId>datatypes-java</artifactId>
3034

3135
<parent>

java/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@
156156
<version>${commons.lang3.version}</version>
157157
</dependency>
158158

159+
<dependency>
160+
<groupId>com.google.inject</groupId>
161+
<artifactId>guice</artifactId>
162+
<version>5.0.1</version>
163+
</dependency>
164+
159165
<!-- Google Cloud -->
160166
<dependency>
161167
<groupId>com.google.cloud</groupId>
@@ -450,6 +456,12 @@
450456
<artifactId>log4j-slf4j-impl</artifactId>
451457
<version>${log4jVersion}</version>
452458
</dependency>
459+
<dependency>
460+
<groupId>org.slf4j</groupId>
461+
<artifactId>slf4j-api</artifactId>
462+
<version>1.7.30</version>
463+
</dependency>
464+
453465

454466
<!--
455467
Import Spring Boot's dependency management.

java/serving/pom.xml

Lines changed: 33 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,39 @@
4646
</plugin>
4747

4848
<plugin>
49-
<groupId>org.springframework.boot</groupId>
50-
<artifactId>spring-boot-maven-plugin</artifactId>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-jar-plugin</artifactId>
5151
<configuration>
52-
<skip>false</skip>
52+
<archive>
53+
<manifest>
54+
<addClasspath>true</addClasspath>
55+
<mainClass>feast.serving.ServingGuiceApplication</mainClass>
56+
</manifest>
57+
</archive>
5358
</configuration>
59+
</plugin>
60+
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-assembly-plugin</artifactId>
5464
<executions>
5565
<execution>
56-
<id>build-info</id>
66+
<phase>package</phase>
5767
<goals>
58-
<goal>build-info</goal>
68+
<goal>single</goal>
5969
</goals>
6070
</execution>
6171
</executions>
72+
<configuration>
73+
<descriptorRefs>
74+
<descriptorRef>jar-with-dependencies</descriptorRef>
75+
</descriptorRefs>
76+
<archive>
77+
<manifest>
78+
<mainClass>feast.serving.ServingGuiceApplication</mainClass>
79+
</manifest>
80+
</archive>
81+
</configuration>
6282
</plugin>
6383

6484
</plugins>
@@ -84,53 +104,28 @@
84104
<version>${project.version}</version>
85105
</dependency>
86106

107+
<dependency>
108+
<groupId>com.google.inject</groupId>
109+
<artifactId>guice</artifactId>
110+
<version>5.0.1</version>
111+
</dependency>
112+
87113
<!-- TODO: SLF4J is being used via Lombok, but also jog4j - pick one -->
88114
<dependency>
89115
<groupId>org.slf4j</groupId>
90116
<artifactId>slf4j-api</artifactId>
91117
</dependency>
92118

93119
<dependency>
94-
<groupId>org.springframework.boot</groupId>
95-
<artifactId>spring-boot-configuration-processor</artifactId>
96-
<optional>true</optional>
120+
<groupId>org.slf4j</groupId>
121+
<artifactId>slf4j-simple</artifactId>
97122
</dependency>
98123

99-
<!--compile "org.springframework.boot:spring-boot-starter-web:${spring.boot.version}"-->
100-
<dependency>
101-
<groupId>org.springframework.boot</groupId>
102-
<artifactId>spring-boot-starter-web</artifactId>
103-
</dependency>
104-
<!--compile 'org.springframework.boot:spring-boot-starter-log4j2'-->
105-
<dependency>
106-
<groupId>org.springframework.boot</groupId>
107-
<artifactId>spring-boot-starter-log4j2</artifactId>
108-
</dependency>
109124
<dependency>
110125
<groupId>org.apache.logging.log4j</groupId>
111126
<artifactId>log4j-web</artifactId>
112127
</dependency>
113128

114-
<dependency>
115-
<groupId>org.springframework.boot</groupId>
116-
<artifactId>spring-boot-devtools</artifactId>
117-
<optional>true</optional>
118-
</dependency>
119-
120-
<!--compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"-->
121-
<dependency>
122-
<groupId>org.springframework.boot</groupId>
123-
<artifactId>spring-boot-starter-actuator</artifactId>
124-
</dependency>
125-
126-
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
127-
<dependency>
128-
<groupId>org.springframework.boot</groupId>
129-
<artifactId>spring-boot-test</artifactId>
130-
<version>2.3.1.RELEASE</version>
131-
<scope>test</scope>
132-
</dependency>
133-
134129
<!--compile "io.grpc:grpc-services:${grpc.version}"-->
135130
<dependency>
136131
<groupId>io.grpc</groupId>
@@ -199,11 +194,6 @@
199194
<artifactId>simpleclient_servlet</artifactId>
200195
<version>0.8.0</version>
201196
</dependency>
202-
<dependency>
203-
<groupId>io.prometheus</groupId>
204-
<artifactId>simpleclient_spring_boot</artifactId>
205-
<version>0.8.0</version>
206-
</dependency>
207197

208198
<dependency>
209199
<groupId>com.google.auto.value</groupId>
@@ -242,18 +232,6 @@
242232
<groupId>io.grpc</groupId>
243233
<artifactId>grpc-testing</artifactId>
244234
</dependency>
245-
<!--testCompile 'org.springframework.boot:spring-boot-starter-test'-->
246-
<dependency>
247-
<groupId>org.springframework.boot</groupId>
248-
<artifactId>spring-boot-starter-test</artifactId>
249-
<scope>test</scope>
250-
<exclusions>
251-
<exclusion>
252-
<groupId>org.junit.vintage</groupId>
253-
<artifactId>junit-vintage-engine</artifactId>
254-
</exclusion>
255-
</exclusions>
256-
</dependency>
257235

258236
<dependency>
259237
<groupId>org.mockito</groupId>
@@ -315,11 +293,6 @@
315293
<artifactId>jakarta.validation-api</artifactId>
316294
<version>${jakarta.validation.api.version}</version>
317295
</dependency>
318-
<dependency>
319-
<groupId>net.devh</groupId>
320-
<artifactId>grpc-server-spring-boot-starter</artifactId>
321-
<version>${grpc.spring.boot.starter.version}</version>
322-
</dependency>
323296
<dependency>
324297
<groupId>org.testcontainers</groupId>
325298
<artifactId>testcontainers</artifactId>

java/serving/src/main/java/feast/serving/ServingApplication.java

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright 2018-2021 The Feast Authors
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package feast.serving;
18+
19+
import com.google.inject.Guice;
20+
import com.google.inject.Injector;
21+
import feast.serving.config.*;
22+
import io.grpc.Server;
23+
import java.io.IOException;
24+
25+
public class ServingGuiceApplication {
26+
27+
public static void main(String[] args) throws InterruptedException, IOException {
28+
if (args.length == 0) {
29+
throw new RuntimeException(
30+
"Path to application configuration file needs to be specifed via CLI");
31+
}
32+
33+
final Injector i =
34+
Guice.createInjector(
35+
new ServingServiceConfigV2(),
36+
new RegistryConfig(),
37+
new InstrumentationConfig(),
38+
new ServerModule(),
39+
new ApplicationPropertiesModule(args));
40+
41+
Server server = i.getInstance(Server.class);
42+
43+
server.start();
44+
server.awaitTermination();
45+
}
46+
}

0 commit comments

Comments
 (0)