mengw15 commented on code in PR #4274:
URL: https://github.com/apache/texera/pull/4274#discussion_r3120828661


##########
bin/single-node/docker-compose.yml:
##########
@@ -75,6 +105,153 @@ services:
       timeout: 5s
       retries: 10
 
+  # Lakekeeper migration init container
+  # This runs once to migrate the database before the lakekeeper server starts
+  lakekeeper-migrate:
+    image: vakamo/lakekeeper:v0.11.0
+    container_name: texera-lakekeeper-migrate
+    depends_on:
+      postgres:
+        condition: service_healthy
+    env_file:
+      - .env
+    restart: "no"
+    entrypoint: ["/home/nonroot/lakekeeper"]
+    command: ["migrate"]
+
+  # Lakekeeper is the Iceberg REST catalog service
+  lakekeeper:
+    image: vakamo/lakekeeper:v0.11.0
+    container_name: texera-lakekeeper
+    restart: always
+    depends_on:
+      postgres:
+        condition: service_healthy
+      minio:
+        condition: service_started
+      lakekeeper-migrate:
+        condition: service_completed_successfully
+    env_file:
+      - .env
+    entrypoint: ["/home/nonroot/lakekeeper"]
+    command: ["serve"]
+    healthcheck:
+      test: ["CMD", "/home/nonroot/lakekeeper", "healthcheck"]
+      interval: 10s
+      timeout: 5s
+      retries: 10
+      start_period: 10s
+
+  # One-shot init container that creates the Lakekeeper default project and
+  # the Iceberg warehouse pointing at the MinIO bucket prepared by minio-init.
+  lakekeeper-init:
+    image: alpine:3.19
+    container_name: texera-lakekeeper-init
+    depends_on:
+      lakekeeper:
+        condition: service_healthy
+      minio-init:
+        condition: service_completed_successfully
+    env_file:
+      - .env
+    restart: "no"
+    entrypoint: [ "/bin/sh", "-c" ]
+    command:
+      - |
+        set -e
+
+        # curl is used to call Lakekeeper's management API over the internal
+        # Docker network; jq parses list responses so we can detect existing
+        # resources before deciding to create them (keeps init idempotent).
+        echo "Installing curl (to call Lakekeeper's management API) and jq (to 
parse its list responses)..."
+        apk add --no-cache curl jq
+
+        check_status() {
+          if [ "$$1" -ge 200 ] && [ "$$1" -lt 300 ]; then
+            echo "Created $$2 successfully (HTTP $$1)."
+          elif [ "$$1" -eq 409 ]; then
+            echo "$$2 already exists (HTTP 409). Treating as success."

Review Comment:
   Thanks for catching this! 409 was still used for project creation, now I 
added pre check for project creating as well, and removed check_status()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to