From d9225cc3f70a0936ed7459672539d441036ae4ce Mon Sep 17 00:00:00 2001 From: Yong Date: Sun, 16 Feb 2025 23:47:16 -0600 Subject: [PATCH 1/2] fix inconsistent image build issue --- README.md | 2 +- helm/polaris/README.md | 5 +++-- helm/polaris/README.md.gotmpl | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e1155c3728..89db1463aa 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ select * from db1.table1; #### Running in Docker -- `./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true` - To +- `./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache` - To build the image locally. - `docker run -p 8181:8181 -p 8182:8182 apache/polaris:latest` - To run the image. diff --git a/helm/polaris/README.md b/helm/polaris/README.md index 06927d636c..b75c3dbf32 100644 --- a/helm/polaris/README.md +++ b/helm/polaris/README.md @@ -89,9 +89,10 @@ If necessary, build and load the Docker images with support for Postgres into Mi ```bash eval $(minikube -p minikube docker-env) -./gradlew :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ +./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ + --no-build-cache ``` ### Installing the chart locally diff --git a/helm/polaris/README.md.gotmpl b/helm/polaris/README.md.gotmpl index 973d0b2efd..9b10ae146b 100644 --- a/helm/polaris/README.md.gotmpl +++ b/helm/polaris/README.md.gotmpl @@ -90,9 +90,10 @@ If necessary, build and load the Docker images with support for Postgres into Mi ```bash eval $(minikube -p minikube docker-env) -./gradlew :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ +./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ + --no-build-cache ``` ### Installing the chart locally From 3df1c1ea779299a69bb68564039a92970d15b5c3 Mon Sep 17 00:00:00 2001 From: Yong Date: Mon, 17 Feb 2025 12:09:47 -0600 Subject: [PATCH 2/2] Add clean and no-build-cache for image build commands --- getting-started/eclipselink/README.md | 5 +++-- getting-started/spark/README.md | 2 +- getting-started/telemetry/README.md | 2 +- getting-started/trino/README.md | 2 +- quarkus/admin/README.md | 2 +- quarkus/server/README.md | 7 ++++--- regtests/README.md | 2 +- run.sh | 5 +++-- site/content/in-dev/unreleased/admin-tool.md | 3 ++- site/content/in-dev/unreleased/quickstart.md | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index 793b7e9623..53618b415a 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -25,10 +25,11 @@ This example requires `jq` to be installed on your machine. the Postgres JDBC driver: ```shell - ./gradlew :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ + ./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ -Dquarkus.container-image.tag=postgres-latest \ - -Dquarkus.container-image.build=true + -Dquarkus.container-image.build=true \ + --no-build-cache ``` 2. Start the docker compose group by running the following command from the root of the repository: diff --git a/getting-started/spark/README.md b/getting-started/spark/README.md index 793fbf0528..b523956125 100644 --- a/getting-started/spark/README.md +++ b/getting-started/spark/README.md @@ -27,7 +27,7 @@ A Jupyter notebook is used to run PySpark. If a Polaris image is not already present locally, build one with the following command: ```shell -./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true +./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache ``` ## Run the `docker-compose` file diff --git a/getting-started/telemetry/README.md b/getting-started/telemetry/README.md index a956d60664..9e07f0ca64 100644 --- a/getting-started/telemetry/README.md +++ b/getting-started/telemetry/README.md @@ -24,7 +24,7 @@ This example requires `jq` to be installed on your machine. 1. Build the Polaris image if it's not already present locally: ```shell - ./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true + ./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache ``` 2. Start the docker compose group by running the following command from the root of the repository: diff --git a/getting-started/trino/README.md b/getting-started/trino/README.md index 957604b369..ec1f4ecd11 100644 --- a/getting-started/trino/README.md +++ b/getting-started/trino/README.md @@ -24,7 +24,7 @@ This getting started guide provides a `docker-compose` file to set up [Trino](ht ## Build Polaris Image Build Polaris Image while Docker is running ``` -./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true +./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache ``` ## Run the `docker-compose` file diff --git a/quarkus/admin/README.md b/quarkus/admin/README.md index 1499dc95c5..2ae9c7886b 100644 --- a/quarkus/admin/README.md +++ b/quarkus/admin/README.md @@ -28,7 +28,7 @@ java -jar polaris-quarkus-admin--runner.jar To also build the Docker image, you can use the following command: ```shell -./gradlew :polaris-quarkus-admin:assemble -Dquarkus.container-image.build=true +./gradlew clean :polaris-quarkus-admin:assemble -Dquarkus.container-image.build=true --no-build-cache ``` ## Running the Admin Tool diff --git a/quarkus/server/README.md b/quarkus/server/README.md index aade36e830..ef66d3616d 100644 --- a/quarkus/server/README.md +++ b/quarkus/server/README.md @@ -27,15 +27,16 @@ To also build the Docker image, you can use the following command (a running Doc required): ```shell -./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true +./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache ``` If you need to customize the Docker image, for example to push to a local registry, you can use the following command: ```shell -./gradlew :polaris-quarkus-server:build -Dquarkus.container-image.build=true \ +./gradlew clean :polaris-quarkus-server:build -Dquarkus.container-image.build=true \ -Dquarkus.container-image.registry=localhost:5001 \ -Dquarkus.container-image.group=apache \ - -Dquarkus.container-image.name=polaris-local + -Dquarkus.container-image.name=polaris-local \ + --no-build-cache ``` \ No newline at end of file diff --git a/regtests/README.md b/regtests/README.md index 648255d4d6..4c2d5c55fa 100644 --- a/regtests/README.md +++ b/regtests/README.md @@ -39,7 +39,7 @@ Tests can be run with docker-compose using the provided `./regtests/docker-compo follows: ```shell -./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true +./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache docker compose -f ./regtests/docker-compose.yml up --build --exit-code-from regtest ``` diff --git a/run.sh b/run.sh index 088cfd7bac..0ddd649e52 100755 --- a/run.sh +++ b/run.sh @@ -52,9 +52,10 @@ sh ./kind-registry.sh # Build and deploy the server image echo "Building polaris image..." -./gradlew :polaris-quarkus-server:build $ECLIPSE_LINK_DEPS \ +./gradlew clean :polaris-quarkus-server:build $ECLIPSE_LINK_DEPS \ -Dquarkus.container-image.build=true \ - -Dquarkus.container-image.registry=localhost:5001 + -Dquarkus.container-image.registry=localhost:5001 \ + --no-build-cache echo "Pushing polaris image..." docker push localhost:5001/apache/polaris diff --git a/site/content/in-dev/unreleased/admin-tool.md b/site/content/in-dev/unreleased/admin-tool.md index 52223afc5b..54d2c7155d 100644 --- a/site/content/in-dev/unreleased/admin-tool.md +++ b/site/content/in-dev/unreleased/admin-tool.md @@ -30,7 +30,8 @@ example, to build the tool with support for Postgres, run the following: ```shell ./gradlew clean :polaris-quarkus-admin:build \ -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ + --no-build-cache ``` The above command will generate: diff --git a/site/content/in-dev/unreleased/quickstart.md b/site/content/in-dev/unreleased/quickstart.md index 26c695031f..d9a97a3de3 100644 --- a/site/content/in-dev/unreleased/quickstart.md +++ b/site/content/in-dev/unreleased/quickstart.md @@ -105,7 +105,7 @@ To start using Polaris in Docker, launch Polaris while Docker is running: ```shell cd ~/polaris -./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true +./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true --no-build-cache docker run -p 8181:8181 -p 8182:8182 apache/polaris:latest ```