From 4a05934666d2bcc42a34db86dbb747f2d46ae0cd Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Wed, 18 Nov 2026 23:43:58 +0530 Subject: [PATCH 1/9] Updated Docker configuration to support OpenTelemetry integration --- .../docker-compose-monitoring-integration.yml | 5 +++++ pipeline/Dockerfile | 17 ++++++++++++++--- pipeline/entrypoint.sh | 6 ++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 pipeline/entrypoint.sh diff --git a/monitoring/docker-compose-monitoring-integration.yml b/monitoring/docker-compose-monitoring-integration.yml index be25dd17..335b7cb3 100644 --- a/monitoring/docker-compose-monitoring-integration.yml +++ b/monitoring/docker-compose-monitoring-integration.yml @@ -15,6 +15,11 @@ services: condition: service_started pipeline-app: + build: + context: . + dockerfile: pipeline/Dockerfile + args: + ENABLE_OTEL: "true" environment: OTEL_EXPORTER_OTLP_ENDPOINT: http://alloy:4317 OTEL_EXPORTER_OTLP_PROTOCOL: grpc diff --git a/pipeline/Dockerfile b/pipeline/Dockerfile index d53c01f7..dac4337a 100644 --- a/pipeline/Dockerfile +++ b/pipeline/Dockerfile @@ -2,18 +2,29 @@ # Build stage # FROM maven:3.9.6-eclipse-temurin-17 AS build +ARG ENABLE_OTEL=false WORKDIR /home/app COPY pipeline/pom.xml . COPY pipeline/src ./src COPY apis/protobuf /home/apis/protobuf -RUN mvn clean package -DskipTests -Pmonitoring +RUN if [ "$ENABLE_OTEL" = "true" ]; then \ + mvn clean package -DskipTests -Pmonitoring; \ + else \ + mvn clean package -DskipTests; \ + fi # # Runtime stage # FROM eclipse-temurin:17-jdk-jammy +ARG ENABLE_OTEL=false WORKDIR /app COPY --from=build /home/app/target/pipeline*.jar app.jar -COPY --from=build /home/app/target/agents/opentelemetry-javaagent.jar otel-agent.jar +RUN --mount=type=bind,from=build,source=/home/app/target,target=/build-output \ + if [ "$ENABLE_OTEL" = "true" ] && [ -f /build-output/agents/opentelemetry-javaagent.jar ]; then \ + cp /build-output/agents/opentelemetry-javaagent.jar /app/otel-agent.jar; \ + fi +COPY pipeline/entrypoint.sh /app/entrypoint.sh +RUN chmod +x /app/entrypoint.sh EXPOSE 8080 -ENTRYPOINT ["java", "-javaagent:otel-agent.jar", "-jar", "app.jar"] +ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/pipeline/entrypoint.sh b/pipeline/entrypoint.sh new file mode 100644 index 00000000..0bbd51f6 --- /dev/null +++ b/pipeline/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh +if [ -f /app/otel-agent.jar ]; then + exec java -javaagent:/app/otel-agent.jar -jar /app/app.jar "$@" +else + exec java -jar /app/app.jar "$@" +fi From 38cb99c531412410fbad47c2e2bfc5c143342e8e Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Thu, 19 Nov 2026 13:07:50 +0530 Subject: [PATCH 2/9] Refactored Docker setup for development and monitoring stages --- docker-compose.yml | 1 + .../docker-compose-monitoring-integration.yml | 3 +- pipeline/Dockerfile | 42 +++++++++++-------- pipeline/entrypoint.sh | 6 --- 4 files changed, 27 insertions(+), 25 deletions(-) delete mode 100644 pipeline/entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index 88c44c10..7b00e52d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -77,6 +77,7 @@ services: build: context: . dockerfile: pipeline/Dockerfile + target: dev image: pipeline-app container_name: pipeline-app environment: diff --git a/monitoring/docker-compose-monitoring-integration.yml b/monitoring/docker-compose-monitoring-integration.yml index 335b7cb3..6b56289d 100644 --- a/monitoring/docker-compose-monitoring-integration.yml +++ b/monitoring/docker-compose-monitoring-integration.yml @@ -18,8 +18,7 @@ services: build: context: . dockerfile: pipeline/Dockerfile - args: - ENABLE_OTEL: "true" + target: monitoring environment: OTEL_EXPORTER_OTLP_ENDPOINT: http://alloy:4317 OTEL_EXPORTER_OTLP_PROTOCOL: grpc diff --git a/pipeline/Dockerfile b/pipeline/Dockerfile index dac4337a..980840f2 100644 --- a/pipeline/Dockerfile +++ b/pipeline/Dockerfile @@ -1,30 +1,38 @@ # -# Build stage +# Dev build stage # FROM maven:3.9.6-eclipse-temurin-17 AS build -ARG ENABLE_OTEL=false WORKDIR /home/app COPY pipeline/pom.xml . COPY pipeline/src ./src COPY apis/protobuf /home/apis/protobuf -RUN if [ "$ENABLE_OTEL" = "true" ]; then \ - mvn clean package -DskipTests -Pmonitoring; \ - else \ - mvn clean package -DskipTests; \ - fi +RUN mvn clean package -DskipTests # -# Runtime stage +# Monitoring build stage # -FROM eclipse-temurin:17-jdk-jammy -ARG ENABLE_OTEL=false +FROM maven:3.9.6-eclipse-temurin-17 AS build-monitoring +WORKDIR /home/app +COPY pipeline/pom.xml . +COPY pipeline/src ./src +COPY apis/protobuf /home/apis/protobuf +RUN mvn clean package -DskipTests -Pmonitoring + +# +# Dev runtime target +# +FROM eclipse-temurin:17-jdk-jammy AS dev WORKDIR /app COPY --from=build /home/app/target/pipeline*.jar app.jar -RUN --mount=type=bind,from=build,source=/home/app/target,target=/build-output \ - if [ "$ENABLE_OTEL" = "true" ] && [ -f /build-output/agents/opentelemetry-javaagent.jar ]; then \ - cp /build-output/agents/opentelemetry-javaagent.jar /app/otel-agent.jar; \ - fi -COPY pipeline/entrypoint.sh /app/entrypoint.sh -RUN chmod +x /app/entrypoint.sh EXPOSE 8080 -ENTRYPOINT ["/app/entrypoint.sh"] +ENTRYPOINT ["java", "-jar", "app.jar"] + +# +# Monitoring runtime target +# +FROM eclipse-temurin:17-jdk-jammy AS monitoring +WORKDIR /app +COPY --from=build-monitoring /home/app/target/pipeline*.jar app.jar +COPY --from=build-monitoring /home/app/target/agents/opentelemetry-javaagent.jar otel-agent.jar +EXPOSE 8080 +ENTRYPOINT ["java", "-javaagent:otel-agent.jar", "-jar", "app.jar"] diff --git a/pipeline/entrypoint.sh b/pipeline/entrypoint.sh deleted file mode 100644 index 0bbd51f6..00000000 --- a/pipeline/entrypoint.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -if [ -f /app/otel-agent.jar ]; then - exec java -javaagent:/app/otel-agent.jar -jar /app/app.jar "$@" -else - exec java -jar /app/app.jar "$@" -fi From 4f930695bbba5909422570161ce9fabfc606aad7 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Wed, 2 Dec 2026 17:03:51 +0530 Subject: [PATCH 3/9] Updated backend container setup instructions --- .../backend/running-backend-containers.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/autobuild-docs/setup/backend/running-backend-containers.md b/autobuild-docs/setup/backend/running-backend-containers.md index 1e529dc9..fc5c8610 100644 --- a/autobuild-docs/setup/backend/running-backend-containers.md +++ b/autobuild-docs/setup/backend/running-backend-containers.md @@ -1,23 +1,28 @@ # Run backend containers -## App stack only +## App stack (backend + UI) -From project root, build and start the application and database: +From project root, build and start all services — backend, database, Keycloak, feature flags, and the UI: ```bash -docker build -t pipeline-app . -docker compose --env-file .env.local up -d +docker compose --env-file .env.local up --build -d ``` +Services available at: +- Pipeline UI: http://localhost:3000 +- Pipeline API: http://localhost:8080 +- Keycloak: http://localhost:8180 + +This build uses the `dev` target — a lighter image without the OpenTelemetry agent. + ## App stack + monitoring -Starts the app stack together with the full monitoring stack (Grafana, Loki, Prometheus, Alloy). All services start in dependency order automatically: +Runs all backend services and adds the monitoring stack (Grafana, Loki, Prometheus, Alloy). The pipeline app is rebuilt with the `monitoring` target, which includes the OpenTelemetry Java agent: ```bash -docker build -t pipeline-app . docker compose --env-file .env.local \ -f docker-compose.yml \ -f monitoring/docker-compose-monitoring.yml \ -f monitoring/docker-compose-monitoring-integration.yml \ - up -d + up --build -d ``` Monitoring UIs available at: From 79c64bedbfbf7f37778c85d7e2204e2561383cf1 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Fri, 4 Dec 2026 17:52:06 +0530 Subject: [PATCH 4/9] docs: rename running-backend-containers.md to running-containers.md, fix profile and UI port --- ...{running-backend-containers.md => running-containers.md} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename autobuild-docs/setup/backend/{running-backend-containers.md => running-containers.md} (92%) diff --git a/autobuild-docs/setup/backend/running-backend-containers.md b/autobuild-docs/setup/backend/running-containers.md similarity index 92% rename from autobuild-docs/setup/backend/running-backend-containers.md rename to autobuild-docs/setup/backend/running-containers.md index fc5c8610..8e4dc9c7 100644 --- a/autobuild-docs/setup/backend/running-backend-containers.md +++ b/autobuild-docs/setup/backend/running-containers.md @@ -1,14 +1,14 @@ -# Run backend containers +# Run containers ## App stack (backend + UI) From project root, build and start all services — backend, database, Keycloak, feature flags, and the UI: ```bash -docker compose --env-file .env.local up --build -d +docker compose --env-file .env.local --profile full up --build -d ``` Services available at: -- Pipeline UI: http://localhost:3000 +- Pipeline UI: http://localhost:3001 - Pipeline API: http://localhost:8080 - Keycloak: http://localhost:8180 From 1f12d4c8b65a786ef8ce695a8dec2ff572868fe3 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Fri, 4 Dec 2026 17:56:37 +0530 Subject: [PATCH 5/9] fix: flagd healthcheck - disable CMD-SHELL on distroless image, use service_started --- docker-compose.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7b00e52d..5fc5542b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -68,11 +68,7 @@ services: networks: - app healthcheck: - test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/8014 && echo -e 'GET /readyz HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && grep -q 'HTTP/1.1 200' <&3"] - interval: 10s - timeout: 5s - retries: 3 - start_period: 10s + disable: true pipeline-app: build: context: . @@ -102,7 +98,7 @@ services: auth-service: condition: service_healthy flagd: - condition: service_healthy + condition: service_started pipeline-ui: build: context: ./pipeline-ui From 15d935a688c86e7bdae12a507f9593102473b458 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Sat, 5 Dec 2026 01:24:07 +0530 Subject: [PATCH 6/9] updated docker compose command to remove profile flag and add new documentation for running containers --- .github/workflows/main_ci.yaml | 2 +- .../running-containers.md => running-fullstack-containers.md} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename autobuild-docs/setup/{backend/running-containers.md => running-fullstack-containers.md} (97%) diff --git a/.github/workflows/main_ci.yaml b/.github/workflows/main_ci.yaml index afd8395f..4d4dfd64 100644 --- a/.github/workflows/main_ci.yaml +++ b/.github/workflows/main_ci.yaml @@ -63,7 +63,7 @@ jobs: - name: Start containers run: | - docker compose --env-file .env.local --profile full up -d --build --wait + docker compose --env-file .env.local up -d --build --wait # TODO: include the happy trivial paths from e2e specs here - name: Check pipeline service's health diff --git a/autobuild-docs/setup/backend/running-containers.md b/autobuild-docs/setup/running-fullstack-containers.md similarity index 97% rename from autobuild-docs/setup/backend/running-containers.md rename to autobuild-docs/setup/running-fullstack-containers.md index 8e4dc9c7..c3b5fe18 100644 --- a/autobuild-docs/setup/backend/running-containers.md +++ b/autobuild-docs/setup/running-fullstack-containers.md @@ -8,7 +8,7 @@ docker compose --env-file .env.local --profile full up --build -d ``` Services available at: -- Pipeline UI: http://localhost:3001 +- Pipeline UI: http://localhost:3000 - Pipeline API: http://localhost:8080 - Keycloak: http://localhost:8180 From f3ad1600f3b30907f90ab96664b6ddf2e90e78b2 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Sat, 5 Dec 2026 01:30:08 +0530 Subject: [PATCH 7/9] updated docker compose commands to remove profile flag and ensure proper service startup --- autobuild-docs/setup/running-fullstack-containers.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/autobuild-docs/setup/running-fullstack-containers.md b/autobuild-docs/setup/running-fullstack-containers.md index c3b5fe18..934b4b44 100644 --- a/autobuild-docs/setup/running-fullstack-containers.md +++ b/autobuild-docs/setup/running-fullstack-containers.md @@ -4,7 +4,7 @@ From project root, build and start all services — backend, database, Keycloak, feature flags, and the UI: ```bash -docker compose --env-file .env.local --profile full up --build -d +docker compose --env-file .env.local up -d --build --wait ``` Services available at: @@ -18,11 +18,12 @@ This build uses the `dev` target — a lighter image without the OpenTelemetry a Runs all backend services and adds the monitoring stack (Grafana, Loki, Prometheus, Alloy). The pipeline app is rebuilt with the `monitoring` target, which includes the OpenTelemetry Java agent: ```bash +MONITORING_STACK_DIR=./monitoring \ docker compose --env-file .env.local \ -f docker-compose.yml \ -f monitoring/docker-compose-monitoring.yml \ -f monitoring/docker-compose-monitoring-integration.yml \ - up --build -d + up -d --build --wait ``` Monitoring UIs available at: @@ -45,11 +46,6 @@ docker compose \ down ``` -An easier command to do the same would be, -```bash -docker compose -p autobuild down -``` - ## Fresh instance ```bash From e99b30cecd26659a082bfec086b2dab46c6465a4 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Sat, 5 Dec 2026 01:37:00 +0530 Subject: [PATCH 8/9] reorganized Dockerfile to improve structure and maintainability --- pipeline/Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pipeline/Dockerfile b/pipeline/Dockerfile index 980840f2..fb31083e 100644 --- a/pipeline/Dockerfile +++ b/pipeline/Dockerfile @@ -18,15 +18,6 @@ COPY pipeline/src ./src COPY apis/protobuf /home/apis/protobuf RUN mvn clean package -DskipTests -Pmonitoring -# -# Dev runtime target -# -FROM eclipse-temurin:17-jdk-jammy AS dev -WORKDIR /app -COPY --from=build /home/app/target/pipeline*.jar app.jar -EXPOSE 8080 -ENTRYPOINT ["java", "-jar", "app.jar"] - # # Monitoring runtime target # @@ -36,3 +27,12 @@ COPY --from=build-monitoring /home/app/target/pipeline*.jar app.jar COPY --from=build-monitoring /home/app/target/agents/opentelemetry-javaagent.jar otel-agent.jar EXPOSE 8080 ENTRYPOINT ["java", "-javaagent:otel-agent.jar", "-jar", "app.jar"] + +# +# Dev runtime target +# +FROM eclipse-temurin:17-jdk-jammy AS dev +WORKDIR /app +COPY --from=build /home/app/target/pipeline*.jar app.jar +EXPOSE 8080 +ENTRYPOINT ["java", "-jar", "app.jar"] From 2206ebfb1941b30cf8c2333385e611700774a7f0 Mon Sep 17 00:00:00 2001 From: Baibhab23 Date: Sat, 5 Dec 2026 01:39:57 +0530 Subject: [PATCH 9/9] updated Grafana port to 3001 in documentation and docker-compose --- autobuild-docs/setup/running-fullstack-containers.md | 2 +- monitoring/docker-compose-monitoring.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autobuild-docs/setup/running-fullstack-containers.md b/autobuild-docs/setup/running-fullstack-containers.md index 934b4b44..2a130436 100644 --- a/autobuild-docs/setup/running-fullstack-containers.md +++ b/autobuild-docs/setup/running-fullstack-containers.md @@ -27,7 +27,7 @@ docker compose --env-file .env.local \ ``` Monitoring UIs available at: -- Grafana: http://localhost:3000 +- Grafana: http://localhost:3001 - Alloy: http://localhost:12345 - Prometheus: http://localhost:9090 diff --git a/monitoring/docker-compose-monitoring.yml b/monitoring/docker-compose-monitoring.yml index 073a1e73..74108e55 100644 --- a/monitoring/docker-compose-monitoring.yml +++ b/monitoring/docker-compose-monitoring.yml @@ -65,7 +65,7 @@ services: - GF_AUTH_BASIC_ENABLED=false - GF_INSTALL_PLUGINS=grafana-lokiexplore-app ports: - - 3000:3000/tcp + - 3001:3000/tcp volumes: - ${MONITORING_STACK_DIR:-.}/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasources.yml - grafana_data:/var/lib/grafana