diff --git a/.prow/scripts/test-serving.sh b/.prow/scripts/test-serving.sh index d105f733827..b56001619b3 100755 --- a/.prow/scripts/test-serving.sh +++ b/.prow/scripts/test-serving.sh @@ -4,14 +4,11 @@ --archive-uri gs://feast-templocation-kf-feast/.m2.2019-10-24.tar \ --output-dir /root/ -# Skip Maven enforcer: https://stackoverflow.com/questions/50647223/maven-enforcer-issue-when-running-from-reactor-level -mvn --projects serving --batch-mode --define skipTests=true \ - --define enforcer.skip=true clean install -mvn --projects serving --define enforcer.skip=true test +mvn --batch-mode --also-make --projects serving test TEST_EXIT_CODE=$? # Default artifact location setting in Prow jobs LOGS_ARTIFACT_PATH=/logs/artifacts cp -r serving/target/surefire-reports ${LOGS_ARTIFACT_PATH}/surefire-reports -exit ${TEST_EXIT_CODE} \ No newline at end of file +exit ${TEST_EXIT_CODE} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7bc1f194fd0..35d4ff32570 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -223,7 +223,55 @@ entity_dataset { ' ``` -#### Tips for quickly running Postgres, Redis and Kafka locally with Docker +## Development + +Notes: + + - Use of Lombok is being phased out, prefer to use [Google Auto] in new code. + +[Google Auto]: https://github.com/google/auto + +### Running Unit Tests + + $ mvn test + +### Running Integration Tests + +_Note: integration suite isn't yet separated from unit._ + + $ mvn verify + +### Running Components Locally + +The `core` and `serving` modules are Spring Boot applications. These may be run as usual for [the Spring Boot Maven plugin][boot-maven]: + + $ mvn --also-make --projects core sprint-boot:run + + # Or for short: + $ mvn -am -pl core spring-boot:run + +Note the use of `--also-make` since some components depend on library modules from within the project. + +[boot-maven]: https://docs.spring.io/spring-boot/docs/current/maven-plugin/index.html + +#### Running From IntelliJ + +IntelliJ IDEA Ultimate has built-in support for Spring Boot projects, so everything may work out of the box. The Community Edition needs help with two matters: + +1. The IDE is [not clever enough][idea-also-make] to apply `--also-make` for Maven when it should. +1. The Spring Boot Maven plugin automatically puts dependencies with `provided` scope on the runtime classpath when using `spring-boot:run`, such as its embedded Tomcat server. The "Play" buttons in the gutter or right-click menu of a `main()` method [do not do this][idea-boot-main]. + +Fortunately there is one simple way to address both: + +1. Open `View > Tool Windows > Maven` +1. Drill down to e.g. `Feast Core > Plugins > spring-boot:run`, right-click and `Create 'feast-core [spring-boot'…` +1. In the dialog that pops up, check the `Resolve Workspace artifacts` box +1. Click `OK`. You should now be able to select this run configuration for the Play button in the main toolbar, keyboard shortcuts, etc. + +[idea-also-make]: https://stackoverflow.com/questions/15073877/using-mavens-also-make-option-in-intellij +[idea-boot-main]: https://stackoverflow.com/questions/30237768/run-spring-boots-main-using-ide + +#### Tips for Running Postgres, Redis and Kafka with Docker This guide assumes you are running Docker service on a bridge network (which is usually the case if you're running Linux). Otherwise, you may need to diff --git a/core/pom.xml b/core/pom.xml index 0dbbeb82b62..e9dfee33114 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -33,45 +33,11 @@ - org.apache.maven.plugins - maven-shade-plugin - 2.4.3 + org.springframework.boot + spring-boot-maven-plugin - - - META-INF/spring.handlers - - - META-INF/spring.factories - - - META-INF/spring.schemas - - - META-INF/spring.components - - - feast.core.CoreApplication - - - - + false - - - package - - shade - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${springBootVersion} - - org.xolstice.maven.plugins @@ -87,6 +53,14 @@ ${project.version} + + + org.springframework.boot + spring-boot-devtools + true + + javax.inject javax.inject @@ -111,7 +85,6 @@ org.springframework.boot spring-boot-starter-data-jpa - ${springBootVersion} @@ -125,7 +98,6 @@ spring-boot-configuration-processor - io.grpc @@ -175,8 +147,8 @@ org.postgresql postgresql - 42.2.5 - runtime + provided + true @@ -190,10 +162,9 @@ lombok - org.hamcrest - hamcrest-all + hamcrest-library @@ -213,10 +184,12 @@ org.springframework.boot spring-boot-test + test org.springframework.boot spring-boot-test-autoconfigure + test diff --git a/core/src/test/java/feast/core/job/dataflow/DataflowJobMonitorTest.java b/core/src/test/java/feast/core/job/dataflow/DataflowJobMonitorTest.java index 83dfec46428..32cd663ae4b 100644 --- a/core/src/test/java/feast/core/job/dataflow/DataflowJobMonitorTest.java +++ b/core/src/test/java/feast/core/job/dataflow/DataflowJobMonitorTest.java @@ -35,7 +35,6 @@ import feast.types.FieldProto.Field; import feast.types.ValueProto.BoolList; import feast.types.ValueProto.Value; -import feast.types.ValueProto.ValueType; import java.io.IOException; import org.junit.Before; import org.junit.Test; diff --git a/ingestion/pom.xml b/ingestion/pom.xml index 8811613ede3..03477f7a23d 100644 --- a/ingestion/pom.xml +++ b/ingestion/pom.xml @@ -248,7 +248,6 @@ org.apache.kafka kafka_2.12 - 2.3.0 test diff --git a/pom.xml b/pom.xml index c88606df6f5..78514288640 100644 --- a/pom.xml +++ b/pom.xml @@ -47,8 +47,11 @@ 2.0.9.RELEASE 2.16.0 1.91.0 + + 1.9.10 1.3 - 1.0.7 + 2.3.0 + 2.28.2 0.21.0 @@ -160,114 +163,14 @@ test - - - com.fasterxml.jackson.core - jackson-annotations - 2.9.9 - - - com.fasterxml.jackson.core - jackson-core - 2.9.9 - - - com.fasterxml.jackson.core - jackson-databind - 2.9.9.1 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-csv - 2.9.6 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - 2.9.9 - - - com.fasterxml.jackson.module - jackson-module-jsonSchema - 2.9.9 - - - - - org.springframework.boot - spring-boot-configuration-processor - ${springBootVersion} - - - org.springframework.boot - spring-boot-devtools - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-actuator - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-log4j2 - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-test - ${springBootVersion} - test - - - org.springframework.boot - spring-boot-starter-web - ${springBootVersion} - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-test - ${springBootVersion} - test - - - org.springframework.boot - spring-boot-test-autoconfigure - ${springBootVersion} - test - - - org.springframework - spring-test - 5.0.8.RELEASE - test - - + io.github.lognet grpc-spring-boot-starter 3.0.2 - - - org.slf4j - slf4j-api - 1.7.25 - - - - commons-codec - commons-codec - 1.10 - com.datadoghq java-dogstatsd-client @@ -288,37 +191,12 @@ protobuf-java-util ${protobufVersion} - - io.micrometer - micrometer-core - ${micrometer.version} - - - io.micrometer - micrometer-registry-statsd - ${micrometer.version} - - - joda-time - joda-time - 2.9.9 - - - org.apache.kafka - kafka-clients - 2.3.0 - org.projectlombok lombok 1.18.2 provided - - redis.clients - jedis - 3.1.0 - @@ -327,30 +205,55 @@ 0.6 test + + - org.hamcrest - hamcrest-all - ${hamcrest.version} - test + org.apache.kafka + kafka_2.12 + ${kafka.version} - org.hamcrest - hamcrest-core - ${hamcrest.version} - test + org.apache.kafka + kafka-clients + ${kafka.version} - org.hamcrest - hamcrest-library - ${hamcrest.version} - test + net.bytebuddy + byte-buddy + ${byte-buddy.version} org.mockito mockito-core - 2.28.2 + ${mockito.version} test + + org.springframework.boot + spring-boot-starter-web + ${springBootVersion} + + + org.springframework.boot + spring-boot-starter-logging + + + + + + + org.springframework.boot + spring-boot-dependencies + ${springBootVersion} + pom + import + @@ -438,6 +341,14 @@ + + org.springframework.boot + spring-boot-maven-plugin + + + true + + diff --git a/serving/pom.xml b/serving/pom.xml index 248f453d36c..a5d4ae4f493 100644 --- a/serving/pom.xml +++ b/serving/pom.xml @@ -43,6 +43,9 @@ org.springframework.boot spring-boot-maven-plugin + + false + org.xolstice.maven.plugins @@ -191,7 +194,10 @@ org.springframework.boot spring-boot-starter-test + test + + org.mockito mockito-core