From 8cbbba28fcf80b210e184060d075774aa9483ed8 Mon Sep 17 00:00:00 2001 From: tokoko Date: Mon, 5 Aug 2024 22:34:48 +0400 Subject: [PATCH 1/2] fix: revert java testcontainers to use docker-based compose Signed-off-by: tokoko --- .../src/test/java/feast/serving/it/ServingEnvironment.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java b/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java index 356524399a4..94f7166fc22 100644 --- a/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java +++ b/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java @@ -62,8 +62,7 @@ static void globalSetup() { .withExposedService("redis", 6379) .withExposedService( "feast", 8080, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(180))) - .withTailChildContainers(true) - .withLocalCompose(true); + .withTailChildContainers(true); environment.start(); } From 1e9cdaf9bfcc4fc0a2e3fa1cbd00ae8d8bdc2526 Mon Sep 17 00:00:00 2001 From: tokoko Date: Tue, 6 Aug 2024 00:19:44 +0000 Subject: [PATCH 2/2] fix: update testcontainers-java to Compose v2 Signed-off-by: tokoko --- .devcontainer/Dockerfile | 13 ++++++ .devcontainer/devcontainer.json | 42 ++++++++++++++----- java/serving/pom.xml | 10 ++++- .../feast/serving/it/ServingEnvironment.java | 9 ++-- 4 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..84c3537fa21 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,13 @@ +FROM mcr.microsoft.com/vscode/devcontainers/python:3.9-buster + +USER vscode +RUN curl -LsSf https://astral.sh/uv/install.sh | sh +RUN curl -fsSL https://pixi.sh/install.sh | bash +ENV PATH=$PATH:/home/vscode/.cargo/bin +ENV PYTHON=3.9 +RUN uv venv ~/.local +ENV VIRTUAL_ENV=~/.local +ENV PATH=$VIRTUAL_ENV/bin:$PATH +USER root + + \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e82fd04db4a..04fcbb00aab 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,13 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile { - "name": "feast-devcontainer", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": { - "version": "latest" - }, - "ghcr.io/devcontainers/features/python:1": { - "version": "3.9" - } - }, - "postCreateCommand": "pip install -e '.[dev]' && make compile-protos-python" + "name": "feast-devcontainer", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "Dockerfile" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "latest" + }, + "ghcr.io/devcontainers-contrib/features/maven-sdkman:2": { + "jdkVersion": "11.0.24-amzn" + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line to run commands after the container is created. + "postCreateCommand": "make install-python-ci-dependencies-uv-venv" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } diff --git a/java/serving/pom.xml b/java/serving/pom.xml index 93e4f81efef..cc3be9d1668 100644 --- a/java/serving/pom.xml +++ b/java/serving/pom.xml @@ -348,15 +348,21 @@ org.testcontainers testcontainers - 1.16.2 + 1.20.1 test org.testcontainers junit-jupiter - 1.16.2 + 1.20.1 test + + org.junit.jupiter + junit-jupiter-api + 5.10.3 + test + org.awaitility awaitility diff --git a/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java b/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java index 94f7166fc22..c1f0c448a73 100644 --- a/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java +++ b/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java @@ -39,13 +39,13 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.testcontainers.containers.DockerComposeContainer; +import org.testcontainers.containers.ComposeContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.junit.jupiter.Testcontainers; @Testcontainers abstract class ServingEnvironment { - static DockerComposeContainer environment; + static ComposeContainer environment; static int serverPort = getFreePort(); ServingServiceGrpc.ServingServiceBlockingStub servingStub; Injector injector; @@ -57,12 +57,13 @@ abstract class ServingEnvironment { @BeforeAll static void globalSetup() { environment = - new DockerComposeContainer( + new ComposeContainer( new File("src/test/resources/docker-compose/docker-compose-redis-it.yml")) .withExposedService("redis", 6379) .withExposedService( "feast", 8080, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(180))) - .withTailChildContainers(true); + .withTailChildContainers(true) + .withLocalCompose(true); environment.start(); }