Skip to content

Commit 3b1e606

Browse files
authored
Add job-controller to test containers (#1006)
1 parent 4809a96 commit 3b1e606

6 files changed

Lines changed: 52 additions & 16 deletions

File tree

‎serving/src/test/java/feast/serving/it/BaseAuthIT.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class BaseAuthIT {
3030
static final String FEATURE_NAME = "feature_1";
3131
static final String ENTITY_ID = "entity_id";
3232
static final String PROJECT_NAME = "project_1";
33-
static final int CORE_START_MAX_WAIT_TIME_IN_MINUTES = 3;
33+
static final int SERVICE_START_MAX_WAIT_TIME_IN_MINUTES = 3;
3434
static final String CLIENT_ID = "client_id";
3535
static final String CLIENT_SECRET = "client_secret";
3636
static final String TOKEN_URL = "http://localhost:4444/oauth2/token";
@@ -42,6 +42,8 @@ public class BaseAuthIT {
4242

4343
static final String CORE = "core_1";
4444

45+
static final String JOB_CONTROLLER = "jobcontroller_1";
46+
4547
static final String HYDRA = "hydra_1";
4648
static final int HYDRA_PORT = 4445;
4749

@@ -51,6 +53,8 @@ public class BaseAuthIT {
5153

5254
static final int FEAST_CORE_PORT = 6565;
5355

56+
static final int FEAST_JOB_CONTROLLER_PORT = 6570;
57+
5458
@DynamicPropertySource
5559
static void properties(DynamicPropertyRegistry registry) {
5660
registry.add("feast.stores[0].name", () -> "online");

‎serving/src/test/java/feast/serving/it/ServingServiceOauthAuthenticationIT.java‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,18 @@ public class ServingServiceOauthAuthenticationIT extends BaseAuthIT {
6767
public static DockerComposeContainer environment =
6868
new DockerComposeContainer(
6969
new File("src/test/resources/docker-compose/docker-compose-it-hydra.yml"),
70-
new File("src/test/resources/docker-compose/docker-compose-it-core.yml"))
70+
new File("src/test/resources/docker-compose/docker-compose-it.yml"))
7171
.withExposedService(HYDRA, HYDRA_PORT, forHttp("/health/alive").forStatusCode(200))
7272
.withExposedService(
7373
CORE,
74-
6565,
74+
FEAST_CORE_PORT,
7575
Wait.forLogMessage(".*gRPC Server started.*\\n", 1)
76-
.withStartupTimeout(Duration.ofMinutes(CORE_START_MAX_WAIT_TIME_IN_MINUTES)));
76+
.withStartupTimeout(Duration.ofMinutes(SERVICE_START_MAX_WAIT_TIME_IN_MINUTES)))
77+
.withExposedService(
78+
JOB_CONTROLLER,
79+
FEAST_JOB_CONTROLLER_PORT,
80+
Wait.forLogMessage(".*gRPC Server started.*\\n", 1)
81+
.withStartupTimeout(Duration.ofMinutes(SERVICE_START_MAX_WAIT_TIME_IN_MINUTES)));
7782

7883
@BeforeAll
7984
static void globalSetup() throws IOException, InitializationError, InterruptedException {

‎serving/src/test/java/feast/serving/it/ServingServiceOauthAuthorizationIT.java‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,21 @@ public class ServingServiceOauthAuthorizationIT extends BaseAuthIT {
7272
public static DockerComposeContainer environment =
7373
new DockerComposeContainer(
7474
new File("src/test/resources/docker-compose/docker-compose-it-hydra.yml"),
75-
new File("src/test/resources/docker-compose/docker-compose-it-core.yml"),
75+
new File("src/test/resources/docker-compose/docker-compose-it.yml"),
7676
new File("src/test/resources/docker-compose/docker-compose-it-keto.yml"))
7777
.withExposedService(HYDRA, HYDRA_PORT, forHttp("/health/alive").forStatusCode(200))
7878
.withExposedService(
7979
CORE,
80-
6565,
80+
FEAST_CORE_PORT,
8181
Wait.forLogMessage(".*gRPC Server started.*\\n", 1)
82-
.withStartupTimeout(Duration.ofMinutes(CORE_START_MAX_WAIT_TIME_IN_MINUTES)))
82+
.withStartupTimeout(Duration.ofMinutes(SERVICE_START_MAX_WAIT_TIME_IN_MINUTES)))
83+
.withExposedService(
84+
JOB_CONTROLLER,
85+
FEAST_JOB_CONTROLLER_PORT,
86+
Wait.forLogMessage(".*gRPC Server started.*\\n", 1)
87+
.withStartupTimeout(Duration.ofMinutes(SERVICE_START_MAX_WAIT_TIME_IN_MINUTES)))
8388
.withExposedService("adaptor_1", KETO_ADAPTOR_PORT)
84-
.withExposedService("keto_1", KETO_PORT, forHttp("/health/ready").forStatusCode(200));;
89+
.withExposedService("keto_1", KETO_PORT, forHttp("/health/ready").forStatusCode(200));
8590

8691
@DynamicPropertySource
8792
static void initialize(DynamicPropertyRegistry registry) {

‎serving/src/test/resources/docker-compose/core/application-it.yml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
feast:
2-
jobs:
3-
polling_interval_milliseconds: 30000
4-
job_update_timeout_seconds: 240
5-
active_runner: direct
6-
runners:
7-
- name: direct
8-
type: DirectRunner
9-
options: {}
102
stream:
113
type: kafka
124
options:

serving/src/test/resources/docker-compose/docker-compose-it-core.yml renamed to serving/src/test/resources/docker-compose/docker-compose-it.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ services:
1818
- -jar
1919
- /opt/feast/feast-core.jar
2020
- --spring.config.location=classpath:/application.yml,file:/etc/feast/application.yml
21+
22+
jobcontroller:
23+
image: gcr.io/kf-feast/feast-jobcontroller:latest
24+
volumes:
25+
- ./job-controller/application-it.yml:/etc/feast/application.yml
26+
depends_on:
27+
- kafka
28+
ports:
29+
- 6570:6570
30+
command:
31+
- java
32+
- -jar
33+
- /opt/feast/feast-job-controller.jar
34+
- --spring.config.location=classpath:/application.yml,file:/etc/feast/application.yml
2135

2236
kafka:
2337
image: confluentinc/cp-kafka:5.2.1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
feast:
2+
core-host: core
3+
jobs:
4+
enabled: true
5+
polling_interval_milliseconds: 30000
6+
job_update_timeout_seconds: 240
7+
active_runner: direct
8+
runners:
9+
- name: direct
10+
type: DirectRunner
11+
options: {}
12+
stream:
13+
type: kafka
14+
options:
15+
topic: feast-features
16+
bootstrapServers: "kafka:9092,localhost:9094"

0 commit comments

Comments
 (0)