Skip to content

Commit

Permalink
Online serving optimizations (#1286)
Browse files Browse the repository at this point in the history
* optimize online serving

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* format

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* distinct feature references

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* refactor spec cache

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* format

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* fix tests

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* feature not found in spec

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* add java options to feast-serving helm chart

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>

* delete duplicating java options

Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
  • Loading branch information
pyalex authored Jan 28, 2021
1 parent 2cc2f3d commit 3fabae0
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 201 deletions.
13 changes: 13 additions & 0 deletions common-test/src/main/java/feast/common/it/DataGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ public static FeatureTableSpec createFeatureTableSpec(
.build())
.collect(Collectors.toList()))
.setMaxAge(Duration.newBuilder().setSeconds(3600).build())
.setBatchSource(
DataSource.newBuilder()
.setEventTimestampColumn("ts")
.setType(DataSource.SourceType.BATCH_FILE)
.setFileOptions(
FileOptions.newBuilder()
.setFileFormat(
FileFormat.newBuilder()
.setParquetFormat(ParquetFormat.newBuilder().build())
.build())
.setFileUrl("/dev/null")
.build())
.build())
.putAllLabels(labels)
.build();
}
Expand Down
1 change: 1 addition & 0 deletions core/src/test/java/feast/core/service/SpecServiceIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ public void shouldErrorOnMissingBatchSource() {
3600,
Map.of())
.toBuilder()
.clearBatchSource()
.build();

StatusRuntimeException exc =
Expand Down
12 changes: 10 additions & 2 deletions infra/charts/feast/charts/feast-serving/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ spec:
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
exec:
command: ["grpc-health-probe", "-addr=:{{ .Values.service.grpc.targetPort }}"]
command:
- "grpc-health-probe"
- "-addr=:{{ .Values.service.grpc.targetPort }}"
- "-connect-timeout={{ .Values.livenessProbe.timeoutSeconds }}s"
- "-rpc-timeout={{ .Values.livenessProbe.timeoutSeconds }}s"
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
Expand All @@ -128,7 +132,11 @@ spec:
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
exec:
command: ["grpc-health-probe", "-addr=:{{ .Values.service.grpc.targetPort }}"]
command:
- "grpc-health-probe"
- "-addr=:{{ .Values.service.grpc.targetPort }}"
- "-connect-timeout={{ .Values.readinessProbe.timeoutSeconds }}s"
- "-rpc-timeout={{ .Values.readinessProbe.timeoutSeconds }}s"
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
Expand Down
6 changes: 3 additions & 3 deletions infra/docker/serving/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ RUN wget -q https://github.com/grpc-ecosystem/grpc-health-probe/releases/downloa
# Build stage 2: Production
# ============================================================

FROM openjdk:11-jre-slim as production
FROM amazoncorretto:11 as production
ARG VERSION=dev
COPY --from=builder /build/serving/target/feast-serving-$VERSION-exec.jar /opt/feast/feast-serving.jar
COPY --from=builder /usr/bin/grpc-health-probe /usr/bin/grpc-health-probe
CMD ["java",\
"-Xms1024m",\
"-Xmx1024m",\
"-Xms1g",\
"-Xmx4g",\
"-jar",\
"/opt/feast/feast-serving.jar"]
4 changes: 2 additions & 2 deletions serving/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.14.3</version>
<version>1.15.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.14.3</version>
<version>1.15.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 3fabae0

Please sign in to comment.