From e1a084498f7bccb2786084ad52bbefb6d8d2ca5b Mon Sep 17 00:00:00 2001 From: Manan Bhatt Date: Wed, 2 Mar 2022 11:21:40 +0530 Subject: [PATCH 01/28] Wait and check only for current iteration task to get completed. Wait and check only for current iteration task to get completed. --- .../netflix/conductor/core/execution/tasks/DoWhile.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java index acd54aa08a..953a72ecfd 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java @@ -70,7 +70,8 @@ public boolean execute( for (TaskModel t : workflow.getTasks()) { if (task.getWorkflowTask() .has(TaskUtils.removeIterationFromTaskRefName(t.getReferenceTaskName())) - && !task.getReferenceTaskName().equals(t.getReferenceTaskName())) { + && !task.getReferenceTaskName().equals(t.getReferenceTaskName()) + && task.getIteration() == t.getIteration()) { relevantTask = relevantTasks.get(t.getReferenceTaskName()); if (relevantTask == null || t.getRetryCount() > relevantTask.getRetryCount()) { relevantTasks.put(t.getReferenceTaskName(), t); @@ -78,7 +79,10 @@ public boolean execute( } } Collection loopOver = relevantTasks.values(); - + LOGGER.debug( + "Workflow {} waiting for tasks {} to complete iteration {}", + workflow.getWorkflowId(), loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), + task.getIteration()); for (TaskModel loopOverTask : loopOver) { TaskModel.Status taskStatus = loopOverTask.getStatus(); hasFailures = !taskStatus.isSuccessful(); From 9322716e93e8141a4d0785bfe4f376e6826a5ca4 Mon Sep 17 00:00:00 2001 From: Manan Bhatt Date: Wed, 2 Mar 2022 11:32:29 +0530 Subject: [PATCH 02/28] format plugin --- .../com/netflix/conductor/core/execution/tasks/DoWhile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java index 953a72ecfd..58366fdcf7 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java @@ -81,7 +81,8 @@ public boolean execute( Collection loopOver = relevantTasks.values(); LOGGER.debug( "Workflow {} waiting for tasks {} to complete iteration {}", - workflow.getWorkflowId(), loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), + workflow.getWorkflowId(), + loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), task.getIteration()); for (TaskModel loopOverTask : loopOver) { TaskModel.Status taskStatus = loopOverTask.getStatus(); From ad28adc02f399359db20caf0fc7326e876ff6922 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Mon, 28 Aug 2023 12:47:21 +0530 Subject: [PATCH 03/28] docker build changes. --- docker/docker-compose-dynomite.yaml | 31 ------- docker/docker-compose-postgres.yaml | 2 +- docker/docker-compose.yaml | 2 +- docker/grpc/Makefile | 18 ---- docker/grpc/docker-compose.yaml | 87 ------------------- docker/server/Dockerfile | 43 ++++++--- .../{serverAndUI => server}/nginx/nginx.conf | 0 docker/serverAndUI/Dockerfile | 63 -------------- docker/serverAndUI/README.md | 10 --- docker/serverAndUI/bin/startup.sh | 36 -------- .../config/config-local.properties | 33 ------- docker/serverAndUI/config/config.properties | 35 -------- 12 files changed, 35 insertions(+), 325 deletions(-) delete mode 100644 docker/docker-compose-dynomite.yaml delete mode 100644 docker/grpc/Makefile delete mode 100644 docker/grpc/docker-compose.yaml rename docker/{serverAndUI => server}/nginx/nginx.conf (100%) delete mode 100644 docker/serverAndUI/Dockerfile delete mode 100644 docker/serverAndUI/README.md delete mode 100755 docker/serverAndUI/bin/startup.sh delete mode 100755 docker/serverAndUI/config/config-local.properties delete mode 100755 docker/serverAndUI/config/config.properties diff --git a/docker/docker-compose-dynomite.yaml b/docker/docker-compose-dynomite.yaml deleted file mode 100644 index 99e15af930..0000000000 --- a/docker/docker-compose-dynomite.yaml +++ /dev/null @@ -1,31 +0,0 @@ -version: '2.3' - -services: - conductor-server: - environment: - - CONFIG_PROP=config.properties - links: - - dynomite:dyno1 - depends_on: - dynomite: - condition: service_healthy - - dynomite: - image: v1r3n/dynomite - networks: - - internal - ports: - - 8102:8102 - healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/8102' - interval: 5s - timeout: 5s - retries: 12 - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - -networks: - internal: diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml index 568eed95c7..1a0787be11 100644 --- a/docker/docker-compose-postgres.yaml +++ b/docker/docker-compose-postgres.yaml @@ -69,7 +69,7 @@ services: test: [ "CMD", "redis-cli","ping" ] elasticsearch: - image: elasticsearch:6.8.15 + image: v1r3n/elasticsearch:6.8.12 container_name: elasticsearch environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 91cb3d4610..87619cd4f0 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -60,7 +60,7 @@ services: test: [ "CMD", "redis-cli","ping" ] elasticsearch: - image: elasticsearch:6.8.15 + image: v1r3n/elasticsearch:6.8.12 container_name: elasticsearch environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" diff --git a/docker/grpc/Makefile b/docker/grpc/Makefile deleted file mode 100644 index e111f0c63c..0000000000 --- a/docker/grpc/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - -clean-db: - docker volume rm grpc_conductor_mysql - -compose-build: - docker-compose build - -dependencies-up: - docker-compose up -d mysql elasticsearch - -dependencies-down: - docker-compose down - -stack-up: - docker-compose up - -stack-down: - docker-compose down diff --git a/docker/grpc/docker-compose.yaml b/docker/grpc/docker-compose.yaml deleted file mode 100644 index a212bc8899..0000000000 --- a/docker/grpc/docker-compose.yaml +++ /dev/null @@ -1,87 +0,0 @@ -version: '2.3' - -services: - - conductor-server: - environment: - - CONFIG_PROP=config-mysql-grpc.properties - image: conductor:server - build: - context: ../../ - dockerfile: docker/server/Dockerfile - networks: - - internal - ports: - - 8080:8080 - - 8090:8090 - links: - - elasticsearch:es - depends_on: - elasticsearch: - condition: service_healthy - mysql: - condition: service_healthy - - conductor-ui: - environment: - - WF_SERVER=http://conductor-server:8080 - image: conductor:ui - build: - context: ../../ - dockerfile: docker/ui/Dockerfile - networks: - - internal - ports: - - 5000:5000 - depends_on: - - conductor-server - - mysql: - image: mysql:5.7 - environment: - MYSQL_ROOT_PASSWORD: 12345 - MYSQL_DATABASE: conductor - MYSQL_USER: conductor - MYSQL_PASSWORD: conductor - volumes: - - type: volume - source: conductor_mysql - target: /var/lib/mysql - networks: - - internal - ports: - - 3306:3306 - healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/3306' - interval: 5s - timeout: 5s - retries: 12 - - elasticsearch: - image: elasticsearch:6.8.15 - environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - - xpack.security.enabled=false - networks: - - internal - ports: - - 9200:9200 - - 9300:9300 - healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/9300' - interval: 5s - timeout: 5s - retries: 12 - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - -volumes: - conductor_mysql: - -networks: - internal: diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 80017603ac..1722e07269 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,25 +1,42 @@ # -# conductor:server - Netflix conductor server +# conductor:serverAndUI - Combined Netflix conductor server & UI # - # =========================================================================================================== # 0. Builder stage # =========================================================================================================== -FROM eclipse-temurin:11-jdk-jammy AS builder - +FROM openjdk:11-jdk AS builder LABEL maintainer="Netflix OSS " -# Copy the project directly onto the image +# Install Node +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update -qq \ + && apt-get install -qq --no-install-recommends \ + build-essential \ + nodejs \ + yarn \ + && apt-get upgrade -qq \ + && rm -rf /var/lib/apt/lists/* + +# Copy the project onto the builder image COPY . /conductor + +# Build the server WORKDIR /conductor +RUN ./gradlew build -x test -# Build the server on run -RUN ./gradlew build -x test --stacktrace +# Build the client +WORKDIR /conductor/ui +RUN yarn install && yarn build # =========================================================================================================== # 1. Bin stage # =========================================================================================================== -FROM eclipse-temurin:11-jre-jammy + +FROM nginx:alpine +RUN apk add openjdk11-jre LABEL maintainer="Netflix OSS " @@ -27,10 +44,16 @@ LABEL maintainer="Netflix OSS " RUN mkdir -p /app/config /app/logs /app/libs # Copy the compiled output to new image -COPY --from=builder /conductor/docker/server/bin /app -COPY --from=builder /conductor/docker/server/config /app/config +COPY --from=builder /conductor/docker/serverAndUI/bin /app +COPY --from=builder /conductor/docker/serverAndUI/config /app/config COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs +# Copy compiled UI assets to nginx www directory +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=builder /conductor/ui/build . +COPY --from=builder /conductor/docker/serverAndUI/nginx/nginx.conf /etc/nginx/conf.d/default.conf + # Copy the files for the server into the app folders RUN chmod +x /app/startup.sh diff --git a/docker/serverAndUI/nginx/nginx.conf b/docker/server/nginx/nginx.conf similarity index 100% rename from docker/serverAndUI/nginx/nginx.conf rename to docker/server/nginx/nginx.conf diff --git a/docker/serverAndUI/Dockerfile b/docker/serverAndUI/Dockerfile deleted file mode 100644 index 1722e07269..0000000000 --- a/docker/serverAndUI/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -# -# conductor:serverAndUI - Combined Netflix conductor server & UI -# -# =========================================================================================================== -# 0. Builder stage -# =========================================================================================================== -FROM openjdk:11-jdk AS builder -LABEL maintainer="Netflix OSS " - -# Install Node -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && apt-get update -qq \ - && apt-get install -qq --no-install-recommends \ - build-essential \ - nodejs \ - yarn \ - && apt-get upgrade -qq \ - && rm -rf /var/lib/apt/lists/* - -# Copy the project onto the builder image -COPY . /conductor - -# Build the server -WORKDIR /conductor -RUN ./gradlew build -x test - -# Build the client -WORKDIR /conductor/ui -RUN yarn install && yarn build - -# =========================================================================================================== -# 1. Bin stage -# =========================================================================================================== - -FROM nginx:alpine -RUN apk add openjdk11-jre - -LABEL maintainer="Netflix OSS " - -# Make app folders -RUN mkdir -p /app/config /app/logs /app/libs - -# Copy the compiled output to new image -COPY --from=builder /conductor/docker/serverAndUI/bin /app -COPY --from=builder /conductor/docker/serverAndUI/config /app/config -COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs - -# Copy compiled UI assets to nginx www directory -WORKDIR /usr/share/nginx/html -RUN rm -rf ./* -COPY --from=builder /conductor/ui/build . -COPY --from=builder /conductor/docker/serverAndUI/nginx/nginx.conf /etc/nginx/conf.d/default.conf - -# Copy the files for the server into the app folders -RUN chmod +x /app/startup.sh - -HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1 - -CMD [ "/app/startup.sh" ] -ENTRYPOINT [ "/bin/sh"] diff --git a/docker/serverAndUI/README.md b/docker/serverAndUI/README.md deleted file mode 100644 index 275d74add6..0000000000 --- a/docker/serverAndUI/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Docker -## Conductor server and UI -This Dockerfile create the conductor:serverAndUI image - -## Building the image -`docker build -t conductor:serverAndUI .` - -## Running the conductor server - - Standalone server (interal DB): `docker run -p 8080:8080 -p 80:5000 -d -t conductor:serverAndUI` - - Server (external DB required): `docker run -p 8080:8080 -p 80:5000 -d -t -e "CONFIG_PROP=config.properties" conductor:serverAndUI` diff --git a/docker/serverAndUI/bin/startup.sh b/docker/serverAndUI/bin/startup.sh deleted file mode 100755 index 0070cd0b9d..0000000000 --- a/docker/serverAndUI/bin/startup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# -# Copyright 2021 Netflix, Inc. -#

-# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -#

-# http://www.apache.org/licenses/LICENSE-2.0 -#

-# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -echo "Starting Conductor Server and UI" -echo "Running Nginx in background" -# Start nginx as daemon -nginx - -# Start the server -cd /app/libs -echo "Property file: $CONFIG_PROP" -echo $CONFIG_PROP -export config_file= - -if [ -z "$CONFIG_PROP" ]; - then - echo "Using an in-memory instance of conductor"; - export config_file=/app/config/config-local.properties - else - echo "Using '$CONFIG_PROP'"; - export config_file=/app/config/$CONFIG_PROP -fi - -nohup java -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server-*-boot.jar 1>&2 > /app/logs/server.log diff --git a/docker/serverAndUI/config/config-local.properties b/docker/serverAndUI/config/config-local.properties deleted file mode 100755 index d725130e89..0000000000 --- a/docker/serverAndUI/config/config-local.properties +++ /dev/null @@ -1,33 +0,0 @@ -# Database persistence type. -conductor.db.type=memory - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Transport address to elasticsearch -conductor.elasticsearch.url=localhost:9300 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/serverAndUI/config/config.properties b/docker/serverAndUI/config/config.properties deleted file mode 100755 index c596c6f10f..0000000000 --- a/docker/serverAndUI/config/config.properties +++ /dev/null @@ -1,35 +0,0 @@ -# Database persistence model. -conductor.db.type=dynomite - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Dynomite cluster name -conductor.redis.clusterName=dyno1 - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Transport address to elasticsearch -conductor.elasticsearch.url=es:9300 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true From efe072a3d773a276a395db83d9a8303f87f466d3 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue, 29 Aug 2023 14:37:31 +0530 Subject: [PATCH 04/28] changes --- docker/server/Dockerfile | 8 ++-- docker/server/README.md | 5 ++- .../config/config-mysql-grpc.properties | 38 ------------------- .../src/main/resources/application.properties | 5 +-- 4 files changed, 9 insertions(+), 47 deletions(-) delete mode 100755 docker/server/config/config-mysql-grpc.properties diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 1722e07269..957578082a 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,5 +1,5 @@ # -# conductor:serverAndUI - Combined Netflix conductor server & UI +# conductor:server - Combined Netflix conductor server & UI # # =========================================================================================================== # 0. Builder stage @@ -44,15 +44,15 @@ LABEL maintainer="Netflix OSS " RUN mkdir -p /app/config /app/logs /app/libs # Copy the compiled output to new image -COPY --from=builder /conductor/docker/serverAndUI/bin /app -COPY --from=builder /conductor/docker/serverAndUI/config /app/config +COPY --from=builder /conductor/docker/server/bin /app +COPY --from=builder /conductor/docker/server/config /app/config COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs # Copy compiled UI assets to nginx www directory WORKDIR /usr/share/nginx/html RUN rm -rf ./* COPY --from=builder /conductor/ui/build . -COPY --from=builder /conductor/docker/serverAndUI/nginx/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/conf.d/default.conf # Copy the files for the server into the app folders RUN chmod +x /app/startup.sh diff --git a/docker/server/README.md b/docker/server/README.md index 8baafbfc05..2e4694c4ad 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -9,5 +9,6 @@ Run the following commands from the project root. `docker build -f docker/server/Dockerfile -t conductor:server .` ## Running the conductor server - - Standalone server (interal DB): `docker run -p 8080:8080 -d -t conductor:server` - - Server (external DB required): `docker run -p 8080:8080 -d -t -e "CONFIG_PROP=config.properties" conductor:server` +Conductor server requires redis, postgres and elastic search. +In order to build using Redis and Elastic Search `docker-compose -f docker-compose.yaml build` and to run the docker image `docker-compose -f docker-compose.yaml up` +Postgres and Elastic Search check [community](community-link) diff --git a/docker/server/config/config-mysql-grpc.properties b/docker/server/config/config-mysql-grpc.properties deleted file mode 100755 index 2582b4d89f..0000000000 --- a/docker/server/config/config-mysql-grpc.properties +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright 2021 Netflix, Inc. -#

-# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -#

-# http://www.apache.org/licenses/LICENSE-2.0 -#

-# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -# Servers. -conductor.grpc-server.enabled=true - -# Database persistence model. -conductor.db.type=mysql - -spring.datasource.url=jdbc:mysql://mysql:3306/conductor -spring.datasource.username=conductor -spring.datasource.password=conductor - -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 - -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true - -# Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index 09b8f22b46..3e4d169cd2 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -13,9 +13,9 @@ spring.application.name=conductor springdoc.api-docs.path=/api-docs -loadSample=true +loadSample=false -conductor.db.type=memory +conductor.db.type=redis_standalone conductor.queue.type=redis_standalone conductor.indexing.enabled=false @@ -23,7 +23,6 @@ conductor.indexing.enabled=false #Redis configuration details. #format is host:port:rack separated by semicolon #Auth is supported. Password is taken from host[0]. format: host:port:rack:password -#conductor.redis.hosts=host1:port:rack;host2:port:rack:host3:port:rack conductor.redis.hosts=localhost:6379:us-east-1c #namespace for the keys stored in Dynomite/Redis From 0cbec910c5be6fdfb34ccd7e201849eea0c0cee7 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:51:46 +0530 Subject: [PATCH 05/28] update doc --- docker/server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/server/README.md b/docker/server/README.md index 2e4694c4ad..b35ef33633 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -10,5 +10,5 @@ Run the following commands from the project root. ## Running the conductor server Conductor server requires redis, postgres and elastic search. -In order to build using Redis and Elastic Search `docker-compose -f docker-compose.yaml build` and to run the docker image `docker-compose -f docker-compose.yaml up` +In order to build and run using Redis and Elastic Search `docker-compose -f docker-compose.yaml up` Postgres and Elastic Search check [community](community-link) From 99f6b7c756f51b5423a501cd01feb2aede96fc7e Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue, 29 Aug 2023 21:03:52 +0530 Subject: [PATCH 06/28] docker builds --- docker/docker-compose-postgres.yaml | 100 ------------------ docker/docker-compose-prometheus.yaml | 20 ---- docker/docker-compose.yaml | 2 +- docker/server/README.md | 4 +- docker/server/config/config-mysql.properties | 25 ----- .../server/config/config-postgres.properties | 25 ----- 6 files changed, 3 insertions(+), 173 deletions(-) delete mode 100644 docker/docker-compose-postgres.yaml delete mode 100644 docker/docker-compose-prometheus.yaml delete mode 100755 docker/server/config/config-mysql.properties delete mode 100755 docker/server/config/config-postgres.properties diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml deleted file mode 100644 index 1a0787be11..0000000000 --- a/docker/docker-compose-postgres.yaml +++ /dev/null @@ -1,100 +0,0 @@ -version: '2.3' - -services: - conductor-server: - environment: - - CONFIG_PROP=config-postgres.properties - image: conductor:server - container_name: conductor-server - build: - context: ../ - dockerfile: docker/server/Dockerfile - networks: - - internal - ports: - - 8080:8080 - healthcheck: - test: [ "CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health" ] - interval: 60s - timeout: 30s - retries: 12 - links: - - elasticsearch:es - - redis:rs - - postgres:postgresdb - depends_on: - elasticsearch: - condition: service_healthy - redis: - condition: service_healthy - postgres: - condition: service_healthy - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - - postgres: - image: postgres - environment: - - POSTGRES_USER=conductor - - POSTGRES_PASSWORD=conductor - volumes: - - pgdata-conductor:/var/lib/postgresql/data - networks: - - internal - ports: - - 5432:5432 - healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432' - interval: 5s - timeout: 5s - retries: 12 - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - - redis: - image: redis:6.2.3-alpine - volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf - networks: - - internal - ports: - - 6379:6379 - healthcheck: - test: [ "CMD", "redis-cli","ping" ] - - elasticsearch: - image: v1r3n/elasticsearch:6.8.12 - container_name: elasticsearch - environment: - - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - - xpack.security.enabled=false - networks: - - internal - ports: - - 9200:9200 - - 9300:9300 - healthcheck: - test: wget http://localhost:9200/ -O /dev/null - interval: 5s - timeout: 5s - retries: 12 - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - -volumes: - pgdata-conductor: - driver: local - -networks: - internal: diff --git a/docker/docker-compose-prometheus.yaml b/docker/docker-compose-prometheus.yaml deleted file mode 100644 index 10f8d80e40..0000000000 --- a/docker/docker-compose-prometheus.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: '3' - -services: - - prometheus: - image: prom/prometheus - volumes: - - ./prometheus/:/etc/prometheus/ - command: - - '--config.file=/etc/prometheus/prometheus.yml' - ports: - - 9090:9090 - external_links: - - conductor-server:conductor-server - networks: - - internal - restart: always - -networks: - internal: \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 87619cd4f0..91cb3d4610 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -60,7 +60,7 @@ services: test: [ "CMD", "redis-cli","ping" ] elasticsearch: - image: v1r3n/elasticsearch:6.8.12 + image: elasticsearch:6.8.15 container_name: elasticsearch environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" diff --git a/docker/server/README.md b/docker/server/README.md index b35ef33633..1389f6b0f8 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -10,5 +10,5 @@ Run the following commands from the project root. ## Running the conductor server Conductor server requires redis, postgres and elastic search. -In order to build and run using Redis and Elastic Search `docker-compose -f docker-compose.yaml up` -Postgres and Elastic Search check [community](community-link) +In order to build and run using Redis and Elastic Search 6 run from the docker directory, `docker-compose -f docker-compose.yaml up` +Postgres and Elastic Search 7 check [community](community-link) diff --git a/docker/server/config/config-mysql.properties b/docker/server/config/config-mysql.properties deleted file mode 100755 index 7600398307..0000000000 --- a/docker/server/config/config-mysql.properties +++ /dev/null @@ -1,25 +0,0 @@ -# Servers. -conductor.grpc-server.enabled=false - -# Database persistence type. -conductor.db.type=mysql - -spring.datasource.url=jdbc:mysql://mysql:3306/conductor -spring.datasource.username=conductor -spring.datasource.password=conductor - -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 - -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true - -# Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/server/config/config-postgres.properties b/docker/server/config/config-postgres.properties deleted file mode 100755 index 2a27a5cac3..0000000000 --- a/docker/server/config/config-postgres.properties +++ /dev/null @@ -1,25 +0,0 @@ -# Servers. -conductor.grpc-server.enabled=false - -# Database persistence type. -conductor.db.type=postgres - -spring.datasource.url=jdbc:postgresql://postgres:5432/conductor -spring.datasource.username=conductor -spring.datasource.password=conductor - -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 - -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true - -# Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true From 1c07b5fb00ea6480e5aca47ad23c6ad7bc5c13a6 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue, 29 Aug 2023 21:37:40 +0530 Subject: [PATCH 07/28] revert --- .../core/execution/tasks/DoWhile.java | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java index 42e9411195..3dbc72eb9e 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java @@ -68,21 +68,35 @@ public boolean execute( if (doWhileTaskModel .getWorkflowTask() .has(TaskUtils.removeIterationFromTaskRefName(t.getReferenceTaskName())) - && !task.getReferenceTaskName().equals(t.getReferenceTaskName()) - && task.getIteration() == t.getIteration()) { + && !doWhileTaskModel.getReferenceTaskName().equals(t.getReferenceTaskName()) + && doWhileTaskModel.getIteration() == t.getIteration()) { relevantTask = relevantTasks.get(t.getReferenceTaskName()); if (relevantTask == null || t.getRetryCount() > relevantTask.getRetryCount()) { relevantTasks.put(t.getReferenceTaskName(), t); } } } - Collection loopOver = relevantTasks.values(); - LOGGER.debug( - "Workflow {} waiting for tasks {} to complete iteration {}", - workflow.getWorkflowId(), - loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), - task.getIteration()); - for (TaskModel loopOverTask : loopOver) { + Collection loopOverTasks = relevantTasks.values(); + + if (LOGGER.isDebugEnabled()) { + LOGGER.debug( + "Workflow {} waiting for tasks {} to complete iteration {}", + workflow.getWorkflowId(), + loopOverTasks.stream() + .map(TaskModel::getReferenceTaskName) + .collect(Collectors.toList()), + doWhileTaskModel.getIteration()); + } + + // if the loopOverTasks collection is empty, no tasks inside the loop have been scheduled. + // so schedule it and exit the method. + if (loopOverTasks.isEmpty()) { + doWhileTaskModel.setIteration(1); + doWhileTaskModel.addOutput("iteration", doWhileTaskModel.getIteration()); + return scheduleNextIteration(doWhileTaskModel, workflow, workflowExecutor); + } + + for (TaskModel loopOverTask : loopOverTasks) { TaskModel.Status taskStatus = loopOverTask.getStatus(); hasFailures = !taskStatus.isSuccessful(); if (hasFailures) { From 271425341097b87b4f05ac395ba7360ec378d6b4 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue, 29 Aug 2023 21:39:15 +0530 Subject: [PATCH 08/28] revert property changes --- server/src/main/resources/application.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index 3e4d169cd2..09b8f22b46 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -13,9 +13,9 @@ spring.application.name=conductor springdoc.api-docs.path=/api-docs -loadSample=false +loadSample=true -conductor.db.type=redis_standalone +conductor.db.type=memory conductor.queue.type=redis_standalone conductor.indexing.enabled=false @@ -23,6 +23,7 @@ conductor.indexing.enabled=false #Redis configuration details. #format is host:port:rack separated by semicolon #Auth is supported. Password is taken from host[0]. format: host:port:rack:password +#conductor.redis.hosts=host1:port:rack;host2:port:rack:host3:port:rack conductor.redis.hosts=localhost:6379:us-east-1c #namespace for the keys stored in Dynomite/Redis From 4a95a56f159537091a7e5287d62e86bfd7264367 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Wed, 30 Aug 2023 00:08:45 +0530 Subject: [PATCH 09/28] changes. --- docker/server/README.md | 15 +++++--- docker/server/bin/startup.sh | 5 ++- .../config/config-docker-internal.properties | 36 +++++++++++++++++++ docker/server/config/config-local.properties | 4 +-- 4 files changed, 53 insertions(+), 7 deletions(-) create mode 100755 docker/server/config/config-docker-internal.properties diff --git a/docker/server/README.md b/docker/server/README.md index 1389f6b0f8..13f7b8268c 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -4,11 +4,18 @@ This Dockerfile create the conductor:server image ## Building the image -Run the following commands from the project root. +In order to build the conductor:server image run the following command from the project root, `docker build -f docker/server/Dockerfile -t conductor:server .` +The above image requires redis and elastic search to be running externally. + +In order to build the standalone image which contains server, ui, redis and elasticsearch run the following commands from the project root. + +`docker-compose -f docker/docker-compose.yaml build` + ## Running the conductor server -Conductor server requires redis, postgres and elastic search. -In order to build and run using Redis and Elastic Search 6 run from the docker directory, `docker-compose -f docker-compose.yaml up` -Postgres and Elastic Search 7 check [community](community-link) +Run the following commands from the project root. +`docker-compose -f docker-compose.yaml up` + +For Postgres and Elastic Search 7 setup check [community](https://github.com/Netflix/conductor-community/tree/main/docker) diff --git a/docker/server/bin/startup.sh b/docker/server/bin/startup.sh index 9d1b98cba8..efd7137411 100755 --- a/docker/server/bin/startup.sh +++ b/docker/server/bin/startup.sh @@ -14,7 +14,10 @@ # startup.sh - startup script for the server docker image -echo "Starting Conductor server" +echo "Starting Conductor Server and UI" +echo "Running Nginx in background" +# Start nginx as daemon +nginx # Start the server cd /app/libs diff --git a/docker/server/config/config-docker-internal.properties b/docker/server/config/config-docker-internal.properties new file mode 100755 index 0000000000..85d94eebbb --- /dev/null +++ b/docker/server/config/config-docker-internal.properties @@ -0,0 +1,36 @@ +# Servers. +conductor.grpc-server.enabled=false + +# Database persistence model. +conductor.db.type=redis_standalone +conductor.queue.type=redis_standalone +# Dynomite Cluster details. +# format is host:port:rack separated by semicolon +conductor.redis.hosts=kubernetes.docker.internal:6379:us-east-1c + +# Namespace for the keys stored in Dynomite/Redis +conductor.redis.workflowNamespacePrefix=conductor + +# Namespace prefix for the dyno queues +conductor.redis.queueNamespacePrefix=conductor_queues + +# No. of threads allocated to dyno-queues (optional) +queues.dynomite.threads=10 + +# By default with dynomite, we want the repairservice enabled +conductor.app.workflowRepairServiceEnabled=true + +# Non-quorum port used to connect to local redis. Used by dyno-queues. +# When using redis directly, set this to the same port as redis server +# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. +conductor.redis.queuesNonQuorumPort=22122 + +# Elastic search instance indexing is disabled. +conductor.indexing.enabled=true +conductor.elasticsearch.url=http://kubernetes.docker.internal:9200 +conductor.elasticsearch.indexReplicasCount=0 + +# Load sample kitchen sink workflow +loadSample=true + +conductor.elasticsearch.clusterHealthColor=yellow diff --git a/docker/server/config/config-local.properties b/docker/server/config/config-local.properties index fa2cd25957..98f93fcd06 100755 --- a/docker/server/config/config-local.properties +++ b/docker/server/config/config-local.properties @@ -6,7 +6,7 @@ conductor.db.type=redis_standalone conductor.queue.type=redis_standalone # Dynomite Cluster details. # format is host:port:rack separated by semicolon -conductor.redis.hosts=rs:6379:us-east-1c +conductor.redis.hosts=127.0.0.1:6379:us-east-1c # Namespace for the keys stored in Dynomite/Redis conductor.redis.workflowNamespacePrefix=conductor @@ -27,7 +27,7 @@ conductor.redis.queuesNonQuorumPort=22122 # Elastic search instance indexing is disabled. conductor.indexing.enabled=true -conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.url=http://127.0.0.1:9200 conductor.elasticsearch.indexReplicasCount=0 # Load sample kitchen sink workflow From c56b56a1be18604eff28a857a72dc91c1a2d3b03 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Thu, 31 Aug 2023 21:54:26 +0530 Subject: [PATCH 10/28] changes --- docker/README.md | 14 +++++++++++++- docker/server/README.md | 21 +-------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/docker/README.md b/docker/README.md index 538ebae353..960340e22f 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1 +1,13 @@ -[Docker Instructions](/docs/docs/gettingstarted/docker.md) \ No newline at end of file +# Docker +## Conductor UI +This Dockerfile create the conductor:ui image + +## Building the image + +Run the following commands from the project root. + +`docker build -f docker/ui/Dockerfile -t conductor:ui .` + +## Running the conductor server + - With localhost conductor server: `docker run -p 5000:5000 -d -t conductor:ui` + - With external conductor server: `docker run -p 5000:5000 -d -t -e "WF_SERVER=http://conductor-server:8080" conductor:ui` diff --git a/docker/server/README.md b/docker/server/README.md index 13f7b8268c..c5c87b8e74 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -1,21 +1,2 @@ # Docker -## Conductor server -This Dockerfile create the conductor:server image - -## Building the image - -In order to build the conductor:server image run the following command from the project root, - -`docker build -f docker/server/Dockerfile -t conductor:server .` - -The above image requires redis and elastic search to be running externally. - -In order to build the standalone image which contains server, ui, redis and elasticsearch run the following commands from the project root. - -`docker-compose -f docker/docker-compose.yaml build` - -## Running the conductor server -Run the following commands from the project root. -`docker-compose -f docker-compose.yaml up` - -For Postgres and Elastic Search 7 setup check [community](https://github.com/Netflix/conductor-community/tree/main/docker) +Please check [community](https://github.com/Netflix/conductor-community/tree/main/docker) for asetup regarding docker images. From 96ca95123bcacef3b7fe61fc8c5c674beb0e19fd Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 5 Sep 2023 22:28:37 -0700 Subject: [PATCH 11/28] docker build with community server --- docker/README.md | 52 ++++++++++++++- docker/server/Dockerfile | 51 ++++++++++++--- docker/server/bin/startup.sh | 7 ++- docker/server/config/config.properties | 27 ++------ docker/server/nginx/nginx.conf | 50 +++++++++++++++ docker/serverAndUI/Dockerfile | 63 ------------------- docker/serverAndUI/README.md | 10 --- docker/serverAndUI/bin/startup.sh | 36 ----------- .../config/config-local.properties | 33 ---------- docker/serverAndUI/config/config.properties | 35 ----------- docker/serverAndUI/nginx/nginx.conf | 20 ------ 11 files changed, 154 insertions(+), 230 deletions(-) create mode 100644 docker/server/nginx/nginx.conf delete mode 100644 docker/serverAndUI/Dockerfile delete mode 100644 docker/serverAndUI/README.md delete mode 100755 docker/serverAndUI/bin/startup.sh delete mode 100755 docker/serverAndUI/config/config-local.properties delete mode 100755 docker/serverAndUI/config/config.properties delete mode 100644 docker/serverAndUI/nginx/nginx.conf diff --git a/docker/README.md b/docker/README.md index 538ebae353..9dba9ae5e8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1 +1,51 @@ -[Docker Instructions](/docs/docs/gettingstarted/docker.md) \ No newline at end of file +# Conductor Docker Builds + +## Pre-built docker images + +Conductor server with support for the following backend: +1. Redis +2. Postgres +3. Mysql +4. Cassandra + +```shell +docker pull docker.orkes.io/conductor:latest +``` + +### Docker File for Server and UI + +[Docker Image Source for Server with UI](serverAndUI/Dockerfile) + +#### Pre-requisites for building +1. [Docker](https://www.docker.com/) +2. [Node](https://nodejs.org/en) +3. [JDK](https://openjdk.org/) + +### Configuration Guide for Conductor Server +Conductor uses a persistent store for managing state. +The choice of backend is quite flexible and can be configured at runtime using `conductor.db.type` property. + +Refer to the table below for various supported backend and required configurations to enable each of them. + +| Backend | Property | Required Configuration | +|------------|------------------------------------|------------------------| +| postgres | conductor.db.type=postgres | | +| redis | conductor.db.type=redis_standalone | | +| mysql | conductor.db.type=mysql | | +| cassandra | conductor.db.type=cassandra | | + +Conductor using Elasticsearch for indexing the workflow data. +Currently, Elasticsearch 6 and 7 are supported. +We welcome community contributions for other indexing backends. + +**Note:** Docker images use Elasticsearch 7. + +### Recommended Configuration for the server +```properties + +``` + +## Helm Charts +TODO: Link to the helm charts + +## Run Docker Compose Locally diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 80017603ac..0b9e4a8911 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -5,31 +5,66 @@ # =========================================================================================================== # 0. Builder stage # =========================================================================================================== -FROM eclipse-temurin:11-jdk-jammy AS builder +FROM alpine:3.18 AS builder LABEL maintainer="Netflix OSS " -# Copy the project directly onto the image +# =========================================================================================================== +# 0. Build Conductor Server +# =========================================================================================================== + + +# Install dependencies +RUN apk add openjdk11 +RUN apk add git +RUN apk add --update nodejs npm yarn + COPY . /conductor -WORKDIR /conductor +WORKDIR /conductor/ui +RUN yarn install && yarn build +RUN ls -ltr +RUN echo "Done building UI" + +# Checkout the community project +WORKDIR / +RUN mkdir server-build +WORKDIR server-build +RUN ls -ltr + +RUN git clone https://github.com/Netflix/conductor-community.git + +# Copy the project directly onto the image +WORKDIR conductor-community +RUN ls -ltr # Build the server on run RUN ./gradlew build -x test --stacktrace +WORKDIR /server-build +RUN ls -ltr +RUN pwd # =========================================================================================================== # 1. Bin stage # =========================================================================================================== -FROM eclipse-temurin:11-jre-jammy - +FROM alpine:3.18 LABEL maintainer="Netflix OSS " +RUN apk add openjdk11 +RUN apk add nginx + # Make app folders RUN mkdir -p /app/config /app/logs /app/libs # Copy the compiled output to new image -COPY --from=builder /conductor/docker/server/bin /app -COPY --from=builder /conductor/docker/server/config /app/config -COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs +COPY docker/server/bin /app +COPY docker/server/config /app/config +COPY --from=builder /server-build/conductor-community/community-server/build/libs/*boot*.jar /app/libs/conductor-server.jar + +# Copy compiled UI assets to nginx www directory +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=builder /conductor/ui/build . +COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf # Copy the files for the server into the app folders RUN chmod +x /app/startup.sh diff --git a/docker/server/bin/startup.sh b/docker/server/bin/startup.sh index 9d1b98cba8..8870aa5d39 100755 --- a/docker/server/bin/startup.sh +++ b/docker/server/bin/startup.sh @@ -15,6 +15,9 @@ # startup.sh - startup script for the server docker image echo "Starting Conductor server" +echo "Running Nginx in background" +# Start nginx as daemon +nginx # Start the server cd /app/libs @@ -25,7 +28,7 @@ export config_file= if [ -z "$CONFIG_PROP" ]; then echo "Using an in-memory instance of conductor"; - export config_file=/app/config/config-local.properties + export config_file=/app/config/config.properties else echo "Using '$CONFIG_PROP'"; export config_file=/app/config/$CONFIG_PROP @@ -33,4 +36,4 @@ fi echo "Using java options config: $JAVA_OPTS" -java ${JAVA_OPTS} -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server-*-boot.jar 2>&1 | tee -a /app/logs/server.log +java ${JAVA_OPTS} -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server.jar 2>&1 | tee -a /app/logs/server.log diff --git a/docker/server/config/config.properties b/docker/server/config/config.properties index 55124c78c0..b1463a6e5e 100755 --- a/docker/server/config/config.properties +++ b/docker/server/config/config.properties @@ -1,38 +1,21 @@ -# Servers. -conductor.grpc-server.enabled=false - # Database persistence type. -conductor.db.type=dynomite - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Dynomite cluster name -conductor.redis.clusterName=dyno1 - -# Namespace for the keys stored in Dynomite/Redis +conductor.db.type=redis_standalone +conductor.redis.hosts=localhost:6379:us-east-1c +conductor.redis-lock.serverAddress=redis://localhost:6379 +conductor.redis.taskDefCacheRefreshInterval=1 conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues conductor.redis.queueNamespacePrefix=conductor_queues -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 # By default with dynomite, we want the repairservice enabled conductor.app.workflowRepairServiceEnabled=true -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 # Elastic search instance indexing is enabled. conductor.indexing.enabled=true # Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.url=http://localhost:9200 # Name of the elasticsearch cluster conductor.elasticsearch.indexName=conductor diff --git a/docker/server/nginx/nginx.conf b/docker/server/nginx/nginx.conf new file mode 100644 index 0000000000..3af603b55c --- /dev/null +++ b/docker/server/nginx/nginx.conf @@ -0,0 +1,50 @@ +server { + listen 5000; + server_name conductor; + server_tokens off; + + location / { + add_header Referrer-Policy "strict-origin"; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-Content-Type-Options "nosniff"; + add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' assets.orkes.io *.googletagmanager.com *.pendo.io https://cdn.jsdelivr.net; worker-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:;"; + add_header Permissions-Policy "accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), xr-spatial-tracking=(), clipboard-read=(self), clipboard-write=(self), gamepad=(), hid=(), idle-detection=(), serial=(), window-placement=(self)"; + # This would be the directory where your React app's static files are stored at + root /usr/share/nginx/html; + try_files $uri /index.html; + } + + location /api { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:8080/api; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } + + location /actuator { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:8080/actuator; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } + + location /swagger-ui { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:8080/swagger-ui; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } + +} \ No newline at end of file diff --git a/docker/serverAndUI/Dockerfile b/docker/serverAndUI/Dockerfile deleted file mode 100644 index 1722e07269..0000000000 --- a/docker/serverAndUI/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -# -# conductor:serverAndUI - Combined Netflix conductor server & UI -# -# =========================================================================================================== -# 0. Builder stage -# =========================================================================================================== -FROM openjdk:11-jdk AS builder -LABEL maintainer="Netflix OSS " - -# Install Node -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && apt-get update -qq \ - && apt-get install -qq --no-install-recommends \ - build-essential \ - nodejs \ - yarn \ - && apt-get upgrade -qq \ - && rm -rf /var/lib/apt/lists/* - -# Copy the project onto the builder image -COPY . /conductor - -# Build the server -WORKDIR /conductor -RUN ./gradlew build -x test - -# Build the client -WORKDIR /conductor/ui -RUN yarn install && yarn build - -# =========================================================================================================== -# 1. Bin stage -# =========================================================================================================== - -FROM nginx:alpine -RUN apk add openjdk11-jre - -LABEL maintainer="Netflix OSS " - -# Make app folders -RUN mkdir -p /app/config /app/logs /app/libs - -# Copy the compiled output to new image -COPY --from=builder /conductor/docker/serverAndUI/bin /app -COPY --from=builder /conductor/docker/serverAndUI/config /app/config -COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs - -# Copy compiled UI assets to nginx www directory -WORKDIR /usr/share/nginx/html -RUN rm -rf ./* -COPY --from=builder /conductor/ui/build . -COPY --from=builder /conductor/docker/serverAndUI/nginx/nginx.conf /etc/nginx/conf.d/default.conf - -# Copy the files for the server into the app folders -RUN chmod +x /app/startup.sh - -HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1 - -CMD [ "/app/startup.sh" ] -ENTRYPOINT [ "/bin/sh"] diff --git a/docker/serverAndUI/README.md b/docker/serverAndUI/README.md deleted file mode 100644 index 275d74add6..0000000000 --- a/docker/serverAndUI/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Docker -## Conductor server and UI -This Dockerfile create the conductor:serverAndUI image - -## Building the image -`docker build -t conductor:serverAndUI .` - -## Running the conductor server - - Standalone server (interal DB): `docker run -p 8080:8080 -p 80:5000 -d -t conductor:serverAndUI` - - Server (external DB required): `docker run -p 8080:8080 -p 80:5000 -d -t -e "CONFIG_PROP=config.properties" conductor:serverAndUI` diff --git a/docker/serverAndUI/bin/startup.sh b/docker/serverAndUI/bin/startup.sh deleted file mode 100755 index 0070cd0b9d..0000000000 --- a/docker/serverAndUI/bin/startup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# -# Copyright 2021 Netflix, Inc. -#

-# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -#

-# http://www.apache.org/licenses/LICENSE-2.0 -#

-# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -echo "Starting Conductor Server and UI" -echo "Running Nginx in background" -# Start nginx as daemon -nginx - -# Start the server -cd /app/libs -echo "Property file: $CONFIG_PROP" -echo $CONFIG_PROP -export config_file= - -if [ -z "$CONFIG_PROP" ]; - then - echo "Using an in-memory instance of conductor"; - export config_file=/app/config/config-local.properties - else - echo "Using '$CONFIG_PROP'"; - export config_file=/app/config/$CONFIG_PROP -fi - -nohup java -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server-*-boot.jar 1>&2 > /app/logs/server.log diff --git a/docker/serverAndUI/config/config-local.properties b/docker/serverAndUI/config/config-local.properties deleted file mode 100755 index d725130e89..0000000000 --- a/docker/serverAndUI/config/config-local.properties +++ /dev/null @@ -1,33 +0,0 @@ -# Database persistence type. -conductor.db.type=memory - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Transport address to elasticsearch -conductor.elasticsearch.url=localhost:9300 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/serverAndUI/config/config.properties b/docker/serverAndUI/config/config.properties deleted file mode 100755 index c596c6f10f..0000000000 --- a/docker/serverAndUI/config/config.properties +++ /dev/null @@ -1,35 +0,0 @@ -# Database persistence model. -conductor.db.type=dynomite - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Dynomite cluster name -conductor.redis.clusterName=dyno1 - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Transport address to elasticsearch -conductor.elasticsearch.url=es:9300 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/serverAndUI/nginx/nginx.conf b/docker/serverAndUI/nginx/nginx.conf deleted file mode 100644 index 74e0ec2e61..0000000000 --- a/docker/serverAndUI/nginx/nginx.conf +++ /dev/null @@ -1,20 +0,0 @@ -server { - listen 5000; - server_name conductor; - location / { - # This would be the directory where your React app's static files are stored at - root /usr/share/nginx/html; - try_files $uri /index.html; - } - - location /api { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:8080/api; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; - proxy_redirect off; - } -} \ No newline at end of file From 3bf2cfe9efceed4d218abfe5af99e02a17d7381b Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 5 Sep 2023 22:40:58 -0700 Subject: [PATCH 12/28] readme --- docker/README.md | 12 ++++++++++++ ...-compose.yaml => docker-compose-mysql.yaml} | 8 ++++---- docker/grpc/Makefile | 18 ------------------ docker/server/config/config-local.properties | 4 ++-- 4 files changed, 18 insertions(+), 24 deletions(-) rename docker/{grpc/docker-compose.yaml => docker-compose-mysql.yaml} (93%) delete mode 100644 docker/grpc/Makefile diff --git a/docker/README.md b/docker/README.md index 9dba9ae5e8..3d060b07fd 100644 --- a/docker/README.md +++ b/docker/README.md @@ -49,3 +49,15 @@ We welcome community contributions for other indexing backends. TODO: Link to the helm charts ## Run Docker Compose Locally +### Use the docker-compose to bring up the local conductor server. + +| Docker Compose | Description | +|--------------------------------------------------------------|----------------------------| +| [docker-compose.yaml](docker-compose.yaml) | Redis + Elasticsearch 7 | +| [docker-compose-postgres.yaml](docker-compose-postgres.yaml) | Postgres + Elasticsearch 7 | + +### Other Docker compose files +#### Run prometheus and grafana +[docker-compose-prometheus.yaml](docker-compose-prometheus.yaml) +#### Dynomite Server (deprecated) +[docker-compose-dynomite.yaml](docker-compose-dynomite.yaml) diff --git a/docker/grpc/docker-compose.yaml b/docker/docker-compose-mysql.yaml similarity index 93% rename from docker/grpc/docker-compose.yaml rename to docker/docker-compose-mysql.yaml index 40a75625b7..c7d05943d2 100644 --- a/docker/grpc/docker-compose.yaml +++ b/docker/docker-compose-mysql.yaml @@ -7,8 +7,8 @@ services: - CONFIG_PROP=config-mysql-grpc.properties image: conductor:server build: - context: ../../ - dockerfile: docker/server/Dockerfile + context: .. + dockerfile: server/Dockerfile networks: - internal ports: @@ -30,8 +30,8 @@ services: - WF_SERVER=http://conductor-server:8080 image: conductor:ui build: - context: ../../ - dockerfile: docker/ui/Dockerfile + context: .. + dockerfile: ui/Dockerfile networks: - internal ports: diff --git a/docker/grpc/Makefile b/docker/grpc/Makefile deleted file mode 100644 index e111f0c63c..0000000000 --- a/docker/grpc/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - -clean-db: - docker volume rm grpc_conductor_mysql - -compose-build: - docker-compose build - -dependencies-up: - docker-compose up -d mysql elasticsearch - -dependencies-down: - docker-compose down - -stack-up: - docker-compose up - -stack-down: - docker-compose down diff --git a/docker/server/config/config-local.properties b/docker/server/config/config-local.properties index fa2cd25957..a6fec17841 100755 --- a/docker/server/config/config-local.properties +++ b/docker/server/config/config-local.properties @@ -6,7 +6,7 @@ conductor.db.type=redis_standalone conductor.queue.type=redis_standalone # Dynomite Cluster details. # format is host:port:rack separated by semicolon -conductor.redis.hosts=rs:6379:us-east-1c +conductor.redis.hosts=localhost:6379:us-east-1c # Namespace for the keys stored in Dynomite/Redis conductor.redis.workflowNamespacePrefix=conductor @@ -27,7 +27,7 @@ conductor.redis.queuesNonQuorumPort=22122 # Elastic search instance indexing is disabled. conductor.indexing.enabled=true -conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.url=http://localhost:9200 conductor.elasticsearch.indexReplicasCount=0 # Load sample kitchen sink workflow From fd23d226549fd797baefa1309117bd9489430a48 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 5 Sep 2023 23:34:48 -0700 Subject: [PATCH 13/28] restore compose files --- docker/docker-compose-dynomite.yaml | 31 ++++++++ docker/docker-compose-postgres.yaml | 100 ++++++++++++++++++++++++++ docker/docker-compose-prometheus.yaml | 20 ++++++ 3 files changed, 151 insertions(+) create mode 100644 docker/docker-compose-dynomite.yaml create mode 100644 docker/docker-compose-postgres.yaml create mode 100644 docker/docker-compose-prometheus.yaml diff --git a/docker/docker-compose-dynomite.yaml b/docker/docker-compose-dynomite.yaml new file mode 100644 index 0000000000..99e15af930 --- /dev/null +++ b/docker/docker-compose-dynomite.yaml @@ -0,0 +1,31 @@ +version: '2.3' + +services: + conductor-server: + environment: + - CONFIG_PROP=config.properties + links: + - dynomite:dyno1 + depends_on: + dynomite: + condition: service_healthy + + dynomite: + image: v1r3n/dynomite + networks: + - internal + ports: + - 8102:8102 + healthcheck: + test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/8102' + interval: 5s + timeout: 5s + retries: 12 + logging: + driver: "json-file" + options: + max-size: "1k" + max-file: "3" + +networks: + internal: diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml new file mode 100644 index 0000000000..568eed95c7 --- /dev/null +++ b/docker/docker-compose-postgres.yaml @@ -0,0 +1,100 @@ +version: '2.3' + +services: + conductor-server: + environment: + - CONFIG_PROP=config-postgres.properties + image: conductor:server + container_name: conductor-server + build: + context: ../ + dockerfile: docker/server/Dockerfile + networks: + - internal + ports: + - 8080:8080 + healthcheck: + test: [ "CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health" ] + interval: 60s + timeout: 30s + retries: 12 + links: + - elasticsearch:es + - redis:rs + - postgres:postgresdb + depends_on: + elasticsearch: + condition: service_healthy + redis: + condition: service_healthy + postgres: + condition: service_healthy + logging: + driver: "json-file" + options: + max-size: "1k" + max-file: "3" + + postgres: + image: postgres + environment: + - POSTGRES_USER=conductor + - POSTGRES_PASSWORD=conductor + volumes: + - pgdata-conductor:/var/lib/postgresql/data + networks: + - internal + ports: + - 5432:5432 + healthcheck: + test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432' + interval: 5s + timeout: 5s + retries: 12 + logging: + driver: "json-file" + options: + max-size: "1k" + max-file: "3" + + redis: + image: redis:6.2.3-alpine + volumes: + - ./redis.conf:/usr/local/etc/redis/redis.conf + networks: + - internal + ports: + - 6379:6379 + healthcheck: + test: [ "CMD", "redis-cli","ping" ] + + elasticsearch: + image: elasticsearch:6.8.15 + container_name: elasticsearch + environment: + - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" + - transport.host=0.0.0.0 + - discovery.type=single-node + - xpack.security.enabled=false + networks: + - internal + ports: + - 9200:9200 + - 9300:9300 + healthcheck: + test: wget http://localhost:9200/ -O /dev/null + interval: 5s + timeout: 5s + retries: 12 + logging: + driver: "json-file" + options: + max-size: "1k" + max-file: "3" + +volumes: + pgdata-conductor: + driver: local + +networks: + internal: diff --git a/docker/docker-compose-prometheus.yaml b/docker/docker-compose-prometheus.yaml new file mode 100644 index 0000000000..10f8d80e40 --- /dev/null +++ b/docker/docker-compose-prometheus.yaml @@ -0,0 +1,20 @@ +version: '3' + +services: + + prometheus: + image: prom/prometheus + volumes: + - ./prometheus/:/etc/prometheus/ + command: + - '--config.file=/etc/prometheus/prometheus.yml' + ports: + - 9090:9090 + external_links: + - conductor-server:conductor-server + networks: + - internal + restart: always + +networks: + internal: \ No newline at end of file From b01460b80bd06f5af3006c9d0ba99fad9b3a3b74 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 5 Sep 2023 23:38:21 -0700 Subject: [PATCH 14/28] removed old compose --- docker/README.md | 4 +--- docker/docker-compose-dynomite.yaml | 31 ----------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 docker/docker-compose-dynomite.yaml diff --git a/docker/README.md b/docker/README.md index 4fdc28debd..081a3e7db2 100644 --- a/docker/README.md +++ b/docker/README.md @@ -59,6 +59,4 @@ TODO: Link to the helm charts ### Other Docker compose files #### Run prometheus and grafana -[docker-compose-prometheus.yaml](docker-compose-prometheus.yaml) -#### Dynomite Server (deprecated) -[docker-compose-dynomite.yaml](docker-compose-dynomite.yaml) +[docker-compose-prometheus.yaml](docker-compose-prometheus.yaml) \ No newline at end of file diff --git a/docker/docker-compose-dynomite.yaml b/docker/docker-compose-dynomite.yaml deleted file mode 100644 index 99e15af930..0000000000 --- a/docker/docker-compose-dynomite.yaml +++ /dev/null @@ -1,31 +0,0 @@ -version: '2.3' - -services: - conductor-server: - environment: - - CONFIG_PROP=config.properties - links: - - dynomite:dyno1 - depends_on: - dynomite: - condition: service_healthy - - dynomite: - image: v1r3n/dynomite - networks: - - internal - ports: - - 8102:8102 - healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/8102' - interval: 5s - timeout: 5s - retries: 12 - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - -networks: - internal: From 06a40767a34187259f5c41c108600e5e006828b4 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 6 Sep 2023 21:57:12 -0700 Subject: [PATCH 15/28] local container for conductor --- docker/docker-compose-postgres.yaml | 2 +- docker/server/DockerfileLocal | 84 +++++++++++++++++++ docker/server/README.md | 2 - .../config/config-local-postgres.properties | 18 ++++ docker/server/config/redis.conf | 1 + 5 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 docker/server/DockerfileLocal delete mode 100644 docker/server/README.md create mode 100755 docker/server/config/config-local-postgres.properties create mode 100644 docker/server/config/redis.conf diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml index 568eed95c7..b28ce4efd4 100644 --- a/docker/docker-compose-postgres.yaml +++ b/docker/docker-compose-postgres.yaml @@ -3,7 +3,7 @@ version: '2.3' services: conductor-server: environment: - - CONFIG_PROP=config-postgres.properties + - CONFIG_PROP=config-local-postgres.properties image: conductor:server container_name: conductor-server build: diff --git a/docker/server/DockerfileLocal b/docker/server/DockerfileLocal new file mode 100644 index 0000000000..b34ae2a86b --- /dev/null +++ b/docker/server/DockerfileLocal @@ -0,0 +1,84 @@ +# +# conductor:server - Combined Netflix conductor server & UI +# +# =========================================================================================================== +# 0. Builder stage +# =========================================================================================================== +FROM alpine:3.18 AS builder + +LABEL maintainer="Netflix OSS " + +# =========================================================================================================== +# 0. Build Conductor Server +# =========================================================================================================== + +# Install dependencies +RUN apk add openjdk11 +RUN apk add git +RUN apk add --update nodejs npm yarn + +COPY . /conductor +WORKDIR /conductor/ui +RUN yarn install && yarn build +RUN ls -ltr +RUN echo "Done building UI" + +# Checkout the community project +WORKDIR / +RUN mkdir server-build +WORKDIR server-build +RUN ls -ltr + +RUN git clone https://github.com/Netflix/conductor-community.git + +# Copy the project directly onto the image +WORKDIR conductor-community +RUN ls -ltr + +# Build the server on run +RUN ./gradlew build -x test --stacktrace +WORKDIR /server-build +RUN ls -ltr +RUN pwd + + +# =========================================================================================================== +# 1. Bin stage +# =========================================================================================================== +FROM alpine:3.18 + +LABEL maintainer="Netflix OSS " + +RUN apk add openjdk11 +RUN apk add curl +RUN apk add nginx +RUN apk add redis +RUN apk add postgresql14 + +# Make app folders +RUN mkdir -p /app/config /app/logs /app/libs +RUN mkdir -p /app/elasticsearch + +# Copy the compiled output to new image +COPY docker/server/bin /app +COPY docker/server/config /app/config +COPY docker/server/config/redis.conf /app/config/redis.conf +COPY docker/server/bin/start_all.sh /app/start_all.sh +COPY docker/server/bin/health.sh /app/health.sh +COPY --from=builder /server-build/conductor-community/community-server/build/libs/*boot*.jar /app/libs/conductor-server.jar + +# Copy compiled UI assets to nginx www directory +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=builder /conductor/ui/build . +COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf + +# Copy the files for the server into the app folders +RUN chmod +x /app/startup.sh +RUN mkdir /run/postgresql +RUN chown postgres:postgres /run/postgresql/ + +HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1 + +CMD ["/app/start_all_local.sh"] +ENTRYPOINT [ "/bin/sh"] diff --git a/docker/server/README.md b/docker/server/README.md deleted file mode 100644 index c5c87b8e74..0000000000 --- a/docker/server/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Docker -Please check [community](https://github.com/Netflix/conductor-community/tree/main/docker) for asetup regarding docker images. diff --git a/docker/server/config/config-local-postgres.properties b/docker/server/config/config-local-postgres.properties new file mode 100755 index 0000000000..76d563d742 --- /dev/null +++ b/docker/server/config/config-local-postgres.properties @@ -0,0 +1,18 @@ +# Database persistence type. +conductor.db.type=postgres + +# postgres +spring.datasource.url=jdbc:postgresql://localhost:5432/postgres +spring.datasource.username=postgres +spring.datasource.password=postgres + +# Elastic search instance indexing is enabled. +conductor.indexing.enabled=true +conductor.indexing.type=postgres + +# Additional modules for metrics collection exposed to Prometheus (optional) +conductor.metrics-prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus + +# Load sample kitchen sink workflow +loadSample=true diff --git a/docker/server/config/redis.conf b/docker/server/config/redis.conf new file mode 100644 index 0000000000..f43add6148 --- /dev/null +++ b/docker/server/config/redis.conf @@ -0,0 +1 @@ +appendonly yes \ No newline at end of file From 373f59461159dd14eabcde82fcdaf305a2ca5b6f Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 9 Sep 2023 00:57:05 -0700 Subject: [PATCH 16/28] docker changes --- docker/docker-compose-mysql.yaml | 3 +- docker/docker-compose-prometheus.yaml | 20 ------- docker/docker-compose.yaml | 2 +- docker/server/DockerfileLocal | 8 +-- docker/server/bin/startup.sh | 2 +- .../config/config-docker-internal.properties | 36 ------------ .../config/config-local-postgres.properties | 26 +++++---- docker/server/config/config-local.properties | 37 ------------ docker/server/config/config-redis.properties | 22 +++++++ docker/server/config/config.properties | 57 ++++++++++--------- 10 files changed, 73 insertions(+), 140 deletions(-) delete mode 100644 docker/docker-compose-prometheus.yaml delete mode 100755 docker/server/config/config-docker-internal.properties delete mode 100755 docker/server/config/config-local.properties create mode 100755 docker/server/config/config-redis.properties diff --git a/docker/docker-compose-mysql.yaml b/docker/docker-compose-mysql.yaml index c7d05943d2..0db7d31d65 100644 --- a/docker/docker-compose-mysql.yaml +++ b/docker/docker-compose-mysql.yaml @@ -4,7 +4,8 @@ services: conductor-server: environment: - - CONFIG_PROP=config-mysql-grpc.properties + - conductor.db.type=redis_standalone + - conductor.redis.hosts=rs:6379:us-east-1c image: conductor:server build: context: .. diff --git a/docker/docker-compose-prometheus.yaml b/docker/docker-compose-prometheus.yaml deleted file mode 100644 index 10f8d80e40..0000000000 --- a/docker/docker-compose-prometheus.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: '3' - -services: - - prometheus: - image: prom/prometheus - volumes: - - ./prometheus/:/etc/prometheus/ - command: - - '--config.file=/etc/prometheus/prometheus.yml' - ports: - - 9090:9090 - external_links: - - conductor-server:conductor-server - networks: - - internal - restart: always - -networks: - internal: \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 91cb3d4610..e68ed82102 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -3,7 +3,7 @@ version: '2.3' services: conductor-server: environment: - - CONFIG_PROP=config-local.properties + - image: conductor:server container_name: conductor-server build: diff --git a/docker/server/DockerfileLocal b/docker/server/DockerfileLocal index b34ae2a86b..8b6116bf74 100644 --- a/docker/server/DockerfileLocal +++ b/docker/server/DockerfileLocal @@ -19,7 +19,8 @@ RUN apk add --update nodejs npm yarn COPY . /conductor WORKDIR /conductor/ui -RUN yarn install && yarn build +#RUN yarn install && yarn build +RUN mkdir build RUN ls -ltr RUN echo "Done building UI" @@ -52,7 +53,6 @@ LABEL maintainer="Netflix OSS " RUN apk add openjdk11 RUN apk add curl RUN apk add nginx -RUN apk add redis RUN apk add postgresql14 # Make app folders @@ -62,9 +62,7 @@ RUN mkdir -p /app/elasticsearch # Copy the compiled output to new image COPY docker/server/bin /app COPY docker/server/config /app/config -COPY docker/server/config/redis.conf /app/config/redis.conf -COPY docker/server/bin/start_all.sh /app/start_all.sh -COPY docker/server/bin/health.sh /app/health.sh +COPY docker/server/bin/start_all_local.sh /app/start_all_local.sh COPY --from=builder /server-build/conductor-community/community-server/build/libs/*boot*.jar /app/libs/conductor-server.jar # Copy compiled UI assets to nginx www directory diff --git a/docker/server/bin/startup.sh b/docker/server/bin/startup.sh index 21289baab6..e5bd7f501d 100755 --- a/docker/server/bin/startup.sh +++ b/docker/server/bin/startup.sh @@ -28,7 +28,7 @@ export config_file= if [ -z "$CONFIG_PROP" ]; then - echo "Using an in-memory instance of conductor"; + echo "Using default configuration file"; export config_file=/app/config/config.properties else echo "Using '$CONFIG_PROP'"; diff --git a/docker/server/config/config-docker-internal.properties b/docker/server/config/config-docker-internal.properties deleted file mode 100755 index 85d94eebbb..0000000000 --- a/docker/server/config/config-docker-internal.properties +++ /dev/null @@ -1,36 +0,0 @@ -# Servers. -conductor.grpc-server.enabled=false - -# Database persistence model. -conductor.db.type=redis_standalone -conductor.queue.type=redis_standalone -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=kubernetes.docker.internal:6379:us-east-1c - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Elastic search instance indexing is disabled. -conductor.indexing.enabled=true -conductor.elasticsearch.url=http://kubernetes.docker.internal:9200 -conductor.elasticsearch.indexReplicasCount=0 - -# Load sample kitchen sink workflow -loadSample=true - -conductor.elasticsearch.clusterHealthColor=yellow diff --git a/docker/server/config/config-local-postgres.properties b/docker/server/config/config-local-postgres.properties index 76d563d742..1a8a8a4e46 100755 --- a/docker/server/config/config-local-postgres.properties +++ b/docker/server/config/config-local-postgres.properties @@ -1,18 +1,20 @@ +conductor.grpc-server.enabled=false # Database persistence type. conductor.db.type=postgres - -# postgres -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres +conductor.db.schema=conductor +conductor.postgres.schema=conductor +conductor.db.queue.type=postgres +spring.datasource.url=jdbc:postgresql://localhost:5432/postgres?schema=conductor&ApplicationName=conductor spring.datasource.username=postgres spring.datasource.password=postgres - -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true conductor.indexing.type=postgres +conductor.indexing.enabled=true -# Additional modules for metrics collection exposed to Prometheus (optional) -conductor.metrics-prometheus.enabled=true -management.endpoints.web.exposure.include=prometheus - -# Load sample kitchen sink workflow -loadSample=true +# The following is to force Elastic Search IndexDAO not to run. If it just missing it will still try to start v6 +conductor.elasticsearch.version=postgres +flyway.schema=clo-workflow +# Hikari pool sizes are -1 by default and prevent startup +spring.datasource.hikari.maximum-pool-size=10 +spring.datasource.hikari.minimum-idle=2 +# Elastic search instance indexing is enabled. +#conductor.indexing.enabled=false \ No newline at end of file diff --git a/docker/server/config/config-local.properties b/docker/server/config/config-local.properties deleted file mode 100755 index 09b5cd251a..0000000000 --- a/docker/server/config/config-local.properties +++ /dev/null @@ -1,37 +0,0 @@ -# Servers. -conductor.grpc-server.enabled=false - -# Database persistence model. -conductor.db.type=redis_standalone -conductor.queue.type=redis_standalone -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=localhost:6379:us-east-1c - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Elastic search instance indexing is disabled. -conductor.indexing.enabled=true -conductor.elasticsearch.url=http://localhost:9200 - -conductor.elasticsearch.indexReplicasCount=0 - -# Load sample kitchen sink workflow -loadSample=true - -conductor.elasticsearch.clusterHealthColor=yellow diff --git a/docker/server/config/config-redis.properties b/docker/server/config/config-redis.properties new file mode 100755 index 0000000000..12410110f5 --- /dev/null +++ b/docker/server/config/config-redis.properties @@ -0,0 +1,22 @@ +# Database persistence type. +# Below are the properties for redis +conductor.db.type=redis_standalone +conductor.redis.hosts=rs:6379:us-east-1c +conductor.redis-lock.serverAddress=redis://rs:6379 +conductor.redis.taskDefCacheRefreshInterval=1 +conductor.redis.workflowNamespacePrefix=conductor +conductor.redis.queueNamespacePrefix=conductor_queues + +# Elastic search instance indexing is enabled. +conductor.indexing.enabled=true + +# Transport address to elasticsearch +conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.indexName=conductor + +# Additional modules for metrics collection exposed to Prometheus (optional) +conductor.metrics-prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus + +# Load sample kitchen sink workflow +loadSample=true diff --git a/docker/server/config/config.properties b/docker/server/config/config.properties index b1463a6e5e..c966e873bd 100755 --- a/docker/server/config/config.properties +++ b/docker/server/config/config.properties @@ -1,37 +1,40 @@ -# Database persistence type. -conductor.db.type=redis_standalone -conductor.redis.hosts=localhost:6379:us-east-1c -conductor.redis-lock.serverAddress=redis://localhost:6379 -conductor.redis.taskDefCacheRefreshInterval=1 -conductor.redis.workflowNamespacePrefix=conductor -conductor.redis.queueNamespacePrefix=conductor_queues +# See README in the docker for configuration guide +conductor.db.type=SET_THIS -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true +# =====================================================# +# Redis Configuration Properties +# =====================================================# +#conductor.db.type=redis_standalone +# The last part MUST be us-east-1c, it is not used and is kept for backwards compatibility +# conductor.redis.hosts=rs:6379:us-east-1c +# -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true +# conductor.redis-lock.serverAddress=redis://rs:6379 +# conductor.redis.taskDefCacheRefreshInterval=1 +# conductor.redis.workflowNamespacePrefix=conductor +# conductor.redis.queueNamespacePrefix=conductor_queues -# Transport address to elasticsearch -conductor.elasticsearch.url=http://localhost:9200 -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor -#conductor.event-queues.amqp.queueType=classic -#conductor.event-queues.amqp.sequentialMsgProcessing=true +# =====================================================# +# Postgres Configuration Properties +# =====================================================# -# Additional modules for metrics collection exposed via logger (optional) -# conductor.metrics-logger.enabled=true -# conductor.metrics-logger.reportPeriodSeconds=15 +# conductor.db.type=postgres +# spring.datasource.url=jdbc:postgresql://localhost:5432/postgres +# spring.datasource.username=postgres +# spring.datasource.password=postgres +# Additionally you can use set the spring.datasource.XXX properties for connection pool size etc. -# Additional modules for metrics collection exposed to Prometheus (optional) -# conductor.metrics-prometheus.enabled=true -# management.endpoints.web.exposure.include=prometheus +# If you want to use Postgres as indexing store set the following +# conductor.indexing.enabled=true +# conductor.indexing.type=postgres -# To enable Workflow/Task Summary Input/Output JSON Serialization, use the following: -# conductor.app.summary-input-output-json-serialization.enabled=true +# When using Elasticsearch 7 for indexing, set the following + +# conductor.indexing.enabled=true +# conductor.elasticsearch.url=http://es:9200 +# conductor.elasticsearch.version=7 +# conductor.elasticsearch.indexName=conductor -# Load sample kitchen sink workflow -loadSample=true From 22967e314aad6dd00c4032cf554f4a49bb808098 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 9 Sep 2023 14:52:21 -0700 Subject: [PATCH 17/28] build fixes --- docker/server/DockerfileLocal | 3 +-- .../config/config-local-postgres.properties | 26 +++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/docker/server/DockerfileLocal b/docker/server/DockerfileLocal index 8b6116bf74..84bc0bddf9 100644 --- a/docker/server/DockerfileLocal +++ b/docker/server/DockerfileLocal @@ -19,8 +19,7 @@ RUN apk add --update nodejs npm yarn COPY . /conductor WORKDIR /conductor/ui -#RUN yarn install && yarn build -RUN mkdir build +RUN yarn install && yarn build RUN ls -ltr RUN echo "Done building UI" diff --git a/docker/server/config/config-local-postgres.properties b/docker/server/config/config-local-postgres.properties index 1a8a8a4e46..c41c344c10 100755 --- a/docker/server/config/config-local-postgres.properties +++ b/docker/server/config/config-local-postgres.properties @@ -1,20 +1,18 @@ -conductor.grpc-server.enabled=false # Database persistence type. conductor.db.type=postgres -conductor.db.schema=conductor -conductor.postgres.schema=conductor -conductor.db.queue.type=postgres -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres?schema=conductor&ApplicationName=conductor + +# postgres +spring.datasource.url=jdbc:postgresql://localhost:5432/postgres spring.datasource.username=postgres spring.datasource.password=postgres -conductor.indexing.type=postgres -conductor.indexing.enabled=true -# The following is to force Elastic Search IndexDAO not to run. If it just missing it will still try to start v6 -conductor.elasticsearch.version=postgres -flyway.schema=clo-workflow -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 # Elastic search instance indexing is enabled. -#conductor.indexing.enabled=false \ No newline at end of file +conductor.indexing.enabled=true +conductor.indexing.type=postgres + +# Additional modules for metrics collection exposed to Prometheus (optional) +conductor.metrics-prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus + +# Load sample kitchen-sink workflow +loadSample=true From abb08a79ad54bf6aa3fb5be5f42d58491be992a5 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 9 Sep 2023 20:55:06 -0700 Subject: [PATCH 18/28] docker compose changes --- docker/docker-compose-postgres.yaml | 27 ++++++----- docker/docker-compose.yaml | 46 ++++++------------- docker/server/Dockerfile | 6 --- ....properties => config-postgres.properties} | 0 docker/server/config/config-redis.properties | 6 ++- docker/ui/Dockerfile | 14 +++--- 6 files changed, 38 insertions(+), 61 deletions(-) rename docker/server/config/{config-local-postgres.properties => config-postgres.properties} (100%) diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml index b28ce4efd4..a4776c2e6b 100644 --- a/docker/docker-compose-postgres.yaml +++ b/docker/docker-compose-postgres.yaml @@ -3,7 +3,7 @@ version: '2.3' services: conductor-server: environment: - - CONFIG_PROP=config-local-postgres.properties + - CONFIG_PROP=config-postgres.properties image: conductor:server container_name: conductor-server build: @@ -19,13 +19,13 @@ services: timeout: 30s retries: 12 links: - - elasticsearch:es - - redis:rs + - conductor-elasticsearch:es + - conductor-redis:rs - postgres:postgresdb depends_on: - elasticsearch: + conductor-elasticsearch: condition: service_healthy - redis: + conductor-redis: condition: service_healthy postgres: condition: service_healthy @@ -57,7 +57,7 @@ services: max-size: "1k" max-file: "3" - redis: + conductor-redis: image: redis:6.2.3-alpine volumes: - ./redis.conf:/usr/local/etc/redis/redis.conf @@ -68,21 +68,20 @@ services: healthcheck: test: [ "CMD", "redis-cli","ping" ] - elasticsearch: - image: elasticsearch:6.8.15 - container_name: elasticsearch + conductor-elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11 environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - xpack.security.enabled=false + - discovery.type=single-node + volumes: + - esdata-conductor:/usr/share/elasticsearch/data networks: - internal ports: - - 9200:9200 - - 9300:9300 + - 9201:9200 healthcheck: - test: wget http://localhost:9200/ -O /dev/null + test: curl http://localhost:9200/_cluster/health -o /dev/null interval: 5s timeout: 5s retries: 12 diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index e68ed82102..81ab7aebd5 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -3,7 +3,7 @@ version: '2.3' services: conductor-server: environment: - - + - CONFIG_PROP=/app/config/config-redis.properties image: conductor:server container_name: conductor-server build: @@ -13,18 +13,19 @@ services: - internal ports: - 8080:8080 + - 5000:5000 healthcheck: test: ["CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health"] interval: 60s timeout: 30s retries: 12 links: - - elasticsearch:es - - redis:rs + - conductor-elasticsearch:es + - conductor-redis:rs depends_on: - elasticsearch: + conductor-elasticsearch: condition: service_healthy - redis: + conductor-redis: condition: service_healthy logging: driver: "json-file" @@ -32,50 +33,31 @@ services: max-size: "1k" max-file: "3" - conductor-ui: - environment: - - WF_SERVER=http://conductor-server:8080 - image: conductor:ui - container_name: conductor-ui - build: - context: ../ - dockerfile: docker/ui/Dockerfile - networks: - - internal - ports: - - 5000:5000 - links: - - conductor-server - stdin_open: true - - redis: + conductor-redis: image: redis:6.2.3-alpine volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf + - ../server/config/redis.conf:/usr/local/etc/redis/redis.conf networks: - internal ports: - - 6379:6379 + - 7379:6379 healthcheck: test: [ "CMD", "redis-cli","ping" ] - elasticsearch: - image: elasticsearch:6.8.15 - container_name: elasticsearch + conductor-elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11 environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - xpack.security.enabled=false + - discovery.type=single-node volumes: - esdata-conductor:/usr/share/elasticsearch/data networks: - internal ports: - - 9200:9200 - - 9300:9300 + - 9201:9200 healthcheck: - test: wget http://localhost:9200/ -O /dev/null + test: curl http://localhost:9200/_cluster/health -o /dev/null interval: 5s timeout: 5s retries: 12 diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 34cb0ef70e..a64622b2f6 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -67,12 +67,6 @@ RUN rm -rf ./* COPY --from=builder /conductor/ui/build . COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf -# Copy compiled UI assets to nginx www directory -WORKDIR /usr/share/nginx/html -RUN rm -rf ./* -COPY --from=builder /conductor/ui/build . -COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/conf.d/default.conf - # Copy the files for the server into the app folders RUN chmod +x /app/startup.sh diff --git a/docker/server/config/config-local-postgres.properties b/docker/server/config/config-postgres.properties similarity index 100% rename from docker/server/config/config-local-postgres.properties rename to docker/server/config/config-postgres.properties diff --git a/docker/server/config/config-redis.properties b/docker/server/config/config-redis.properties index 12410110f5..f2f3d20e4a 100755 --- a/docker/server/config/config-redis.properties +++ b/docker/server/config/config-redis.properties @@ -7,12 +7,14 @@ conductor.redis.taskDefCacheRefreshInterval=1 conductor.redis.workflowNamespacePrefix=conductor conductor.redis.queueNamespacePrefix=conductor_queues +#Use redis queues +conductor.queue.type=redis_standalone + # Elastic search instance indexing is enabled. conductor.indexing.enabled=true - -# Transport address to elasticsearch conductor.elasticsearch.url=http://es:9200 conductor.elasticsearch.indexName=conductor +conductor.elasticsearch.version=7 # Additional modules for metrics collection exposed to Prometheus (optional) conductor.metrics-prometheus.enabled=true diff --git a/docker/ui/Dockerfile b/docker/ui/Dockerfile index a79aef3b0b..b7967b9a00 100644 --- a/docker/ui/Dockerfile +++ b/docker/ui/Dockerfile @@ -1,25 +1,25 @@ # # conductor:ui - Netflix Conductor UI # -FROM node:16-alpine +FROM node:20-alpine LABEL maintainer="Netflix OSS " # Install the required packages for the node build # to run on alpine RUN apk update && apk add --no-cache python3 py3-pip make g++ - + # A directory within the virtualized Docker environment # Becomes more relevant when using Docker Compose later WORKDIR /usr/src/app - + # Copies package.json to Docker environment in a separate layer as a performance optimization COPY ./ui/package.json ./ - + # Installs all node packages. Cached unless package.json changes RUN yarn install - + # Copies everything else over to Docker environment -# node_modules excluded in .dockerignore. +# node_modules excluded in .dockerignore. COPY ./ui . - + CMD [ "yarn", "start" ] From aae0a92a515a042e188946bc3927e5bdf11f915f Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 23 Sep 2023 11:30:17 -0700 Subject: [PATCH 19/28] Remove local --- docker/server/DockerfileLocal | 81 ----------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 docker/server/DockerfileLocal diff --git a/docker/server/DockerfileLocal b/docker/server/DockerfileLocal deleted file mode 100644 index 84bc0bddf9..0000000000 --- a/docker/server/DockerfileLocal +++ /dev/null @@ -1,81 +0,0 @@ -# -# conductor:server - Combined Netflix conductor server & UI -# -# =========================================================================================================== -# 0. Builder stage -# =========================================================================================================== -FROM alpine:3.18 AS builder - -LABEL maintainer="Netflix OSS " - -# =========================================================================================================== -# 0. Build Conductor Server -# =========================================================================================================== - -# Install dependencies -RUN apk add openjdk11 -RUN apk add git -RUN apk add --update nodejs npm yarn - -COPY . /conductor -WORKDIR /conductor/ui -RUN yarn install && yarn build -RUN ls -ltr -RUN echo "Done building UI" - -# Checkout the community project -WORKDIR / -RUN mkdir server-build -WORKDIR server-build -RUN ls -ltr - -RUN git clone https://github.com/Netflix/conductor-community.git - -# Copy the project directly onto the image -WORKDIR conductor-community -RUN ls -ltr - -# Build the server on run -RUN ./gradlew build -x test --stacktrace -WORKDIR /server-build -RUN ls -ltr -RUN pwd - - -# =========================================================================================================== -# 1. Bin stage -# =========================================================================================================== -FROM alpine:3.18 - -LABEL maintainer="Netflix OSS " - -RUN apk add openjdk11 -RUN apk add curl -RUN apk add nginx -RUN apk add postgresql14 - -# Make app folders -RUN mkdir -p /app/config /app/logs /app/libs -RUN mkdir -p /app/elasticsearch - -# Copy the compiled output to new image -COPY docker/server/bin /app -COPY docker/server/config /app/config -COPY docker/server/bin/start_all_local.sh /app/start_all_local.sh -COPY --from=builder /server-build/conductor-community/community-server/build/libs/*boot*.jar /app/libs/conductor-server.jar - -# Copy compiled UI assets to nginx www directory -WORKDIR /usr/share/nginx/html -RUN rm -rf ./* -COPY --from=builder /conductor/ui/build . -COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf - -# Copy the files for the server into the app folders -RUN chmod +x /app/startup.sh -RUN mkdir /run/postgresql -RUN chown postgres:postgres /run/postgresql/ - -HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1 - -CMD ["/app/start_all_local.sh"] -ENTRYPOINT [ "/bin/sh"] From 67279e98af7970c775a73e03ab7d41202cf9c3e6 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 23 Sep 2023 11:56:22 -0700 Subject: [PATCH 20/28] update comments --- docker/server/config/config.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/server/config/config.properties b/docker/server/config/config.properties index c966e873bd..74d414520f 100755 --- a/docker/server/config/config.properties +++ b/docker/server/config/config.properties @@ -1,5 +1,7 @@ # See README in the docker for configuration guide +# db.type determines the type of database used +# See various configurations below for the values conductor.db.type=SET_THIS # =====================================================# From 5739ea4e45fa4563549db196d6fa71a2b3bedce0 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 23 Sep 2023 12:02:58 -0700 Subject: [PATCH 21/28] fixes and readme update --- docker/README.md | 21 ++++++++++++--------- docker/docker-compose-postgres.yaml | 6 ++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/docker/README.md b/docker/README.md index 081a3e7db2..2f72652402 100644 --- a/docker/README.md +++ b/docker/README.md @@ -18,9 +18,7 @@ docker pull docker.orkes.io/conductor:latest [Docker Image Source for Server with UI](serverAndUI/Dockerfile) #### Pre-requisites for building -1. [Docker](https://www.docker.com/) -2. [Node](https://nodejs.org/en) -3. [JDK](https://openjdk.org/) +[Docker](https://www.docker.com/) ### Configuration Guide for Conductor Server Conductor uses a persistent store for managing state. @@ -28,12 +26,17 @@ The choice of backend is quite flexible and can be configured at runtime using ` Refer to the table below for various supported backend and required configurations to enable each of them. -| Backend | Property | Required Configuration | -|------------|------------------------------------|------------------------| -| postgres | conductor.db.type=postgres | | -| redis | conductor.db.type=redis_standalone | | -| mysql | conductor.db.type=mysql | | -| cassandra | conductor.db.type=cassandra | | +> [!IMPORTANT] +> +> See [config.properties](server/config/config.properties) for the required properties for each of the backends. +> + +| Backend | Property | +|------------|------------------------------------| +| postgres | conductor.db.type=postgres | +| redis | conductor.db.type=redis_standalone | +| mysql | conductor.db.type=mysql | +| cassandra | conductor.db.type=cassandra | Conductor using Elasticsearch for indexing the workflow data. Currently, Elasticsearch 6 and 7 are supported. diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml index a4776c2e6b..b13c72cf35 100644 --- a/docker/docker-compose-postgres.yaml +++ b/docker/docker-compose-postgres.yaml @@ -27,7 +27,7 @@ services: condition: service_healthy conductor-redis: condition: service_healthy - postgres: + conductor-postgres: condition: service_healthy logging: driver: "json-file" @@ -35,7 +35,7 @@ services: max-size: "1k" max-file: "3" - postgres: + conductor-postgres: image: postgres environment: - POSTGRES_USER=conductor @@ -94,6 +94,8 @@ services: volumes: pgdata-conductor: driver: local + esdata-conductor: + driver: local networks: internal: From cc21acdffb9512adfe07390868da693a91b42982 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 23 Sep 2023 12:05:40 -0700 Subject: [PATCH 22/28] Update README.md --- docker/README.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docker/README.md b/docker/README.md index 2f72652402..d6eee6ab78 100644 --- a/docker/README.md +++ b/docker/README.md @@ -28,7 +28,7 @@ Refer to the table below for various supported backend and required configuratio > [!IMPORTANT] > -> See [config.properties](server/config/config.properties) for the required properties for each of the backends. +> See [config.properties](docker/server/config/config.properties) for the required properties for each of the backends. > | Backend | Property | @@ -44,11 +44,6 @@ We welcome community contributions for other indexing backends. **Note:** Docker images use Elasticsearch 7. -### Recommended Configuration for the server -```properties - -``` - ## Helm Charts TODO: Link to the helm charts @@ -59,7 +54,4 @@ TODO: Link to the helm charts |--------------------------------------------------------------|----------------------------| | [docker-compose.yaml](docker-compose.yaml) | Redis + Elasticsearch 7 | | [docker-compose-postgres.yaml](docker-compose-postgres.yaml) | Postgres + Elasticsearch 7 | - -### Other Docker compose files -#### Run prometheus and grafana -[docker-compose-prometheus.yaml](docker-compose-prometheus.yaml) \ No newline at end of file +| [docker-compose-postgres.yaml](docker-compose-mysql.yaml) | Mysql + Elasticsearch 7 | From 39caae3d46903d458b44cb93ec02277c0a99fdd9 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 23 Sep 2023 12:06:29 -0700 Subject: [PATCH 23/28] Update README.md --- docker/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/README.md b/docker/README.md index d6eee6ab78..5bbd5887a4 100644 --- a/docker/README.md +++ b/docker/README.md @@ -29,14 +29,14 @@ Refer to the table below for various supported backend and required configuratio > [!IMPORTANT] > > See [config.properties](docker/server/config/config.properties) for the required properties for each of the backends. -> - -| Backend | Property | -|------------|------------------------------------| -| postgres | conductor.db.type=postgres | -| redis | conductor.db.type=redis_standalone | -| mysql | conductor.db.type=mysql | -| cassandra | conductor.db.type=cassandra | +> +> | Backend | Property | +> |------------|------------------------------------| +> | postgres | conductor.db.type=postgres | +> | redis | conductor.db.type=redis_standalone | +> | mysql | conductor.db.type=mysql | +> | cassandra | conductor.db.type=cassandra | +> Conductor using Elasticsearch for indexing the workflow data. Currently, Elasticsearch 6 and 7 are supported. From f127ac00d0c9b01432a383b0042ddeaac8c5c70e Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sat, 23 Sep 2023 15:26:03 -0700 Subject: [PATCH 24/28] fixes --- docker/docker-compose-postgres.yaml | 19 +++---------------- .../server/config/config-postgres.properties | 11 +++++++---- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml index b13c72cf35..12a6b70465 100644 --- a/docker/docker-compose-postgres.yaml +++ b/docker/docker-compose-postgres.yaml @@ -13,6 +13,7 @@ services: - internal ports: - 8080:8080 + - 5000:5000 healthcheck: test: [ "CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health" ] interval: 60s @@ -20,13 +21,10 @@ services: retries: 12 links: - conductor-elasticsearch:es - - conductor-redis:rs - - postgres:postgresdb + - conductor-postgres:postgresdb depends_on: conductor-elasticsearch: condition: service_healthy - conductor-redis: - condition: service_healthy conductor-postgres: condition: service_healthy logging: @@ -45,7 +43,7 @@ services: networks: - internal ports: - - 5432:5432 + - 6432:5432 healthcheck: test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432' interval: 5s @@ -57,17 +55,6 @@ services: max-size: "1k" max-file: "3" - conductor-redis: - image: redis:6.2.3-alpine - volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf - networks: - - internal - ports: - - 6379:6379 - healthcheck: - test: [ "CMD", "redis-cli","ping" ] - conductor-elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11 environment: diff --git a/docker/server/config/config-postgres.properties b/docker/server/config/config-postgres.properties index c41c344c10..43aa64a0fb 100755 --- a/docker/server/config/config-postgres.properties +++ b/docker/server/config/config-postgres.properties @@ -2,13 +2,16 @@ conductor.db.type=postgres # postgres -spring.datasource.url=jdbc:postgresql://localhost:5432/postgres -spring.datasource.username=postgres -spring.datasource.password=postgres +spring.datasource.url=jdbc:postgresql://postgresdb:5432/postgres +spring.datasource.username=conductor +spring.datasource.password=conductor # Elastic search instance indexing is enabled. conductor.indexing.enabled=true -conductor.indexing.type=postgres +conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.indexName=conductor +conductor.elasticsearch.version=7 +conductor.elasticsearch.clusterHealthColor=yellow # Additional modules for metrics collection exposed to Prometheus (optional) conductor.metrics-prometheus.enabled=true From 7809a8af6357d6f238f88c61a619f6a4626668bc Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Sun, 24 Sep 2023 20:10:37 -0700 Subject: [PATCH 25/28] update readme --- docker/README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docker/README.md b/docker/README.md index 5bbd5887a4..b45b2d9bc6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -9,16 +9,9 @@ Conductor server with support for the following backend: 3. Mysql 4. Cassandra -```shell -docker pull docker.orkes.io/conductor:latest -``` - ### Docker File for Server and UI -[Docker Image Source for Server with UI](serverAndUI/Dockerfile) - -#### Pre-requisites for building -[Docker](https://www.docker.com/) +[Docker Image Source for Server with UI](docker/server/DockerFile) ### Configuration Guide for Conductor Server Conductor uses a persistent store for managing state. @@ -40,6 +33,7 @@ Refer to the table below for various supported backend and required configuratio Conductor using Elasticsearch for indexing the workflow data. Currently, Elasticsearch 6 and 7 are supported. + We welcome community contributions for other indexing backends. **Note:** Docker images use Elasticsearch 7. From dde972cbc94568319c39d59c06ef31c008a0ce8f Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 27 Sep 2023 16:10:23 -0700 Subject: [PATCH 26/28] Squashed commit of the following: commit 7809a8af6357d6f238f88c61a619f6a4626668bc Author: Viren Baraiya Date: Sun Sep 24 20:10:37 2023 -0700 update readme commit f127ac00d0c9b01432a383b0042ddeaac8c5c70e Author: Viren Baraiya Date: Sat Sep 23 15:26:03 2023 -0700 fixes commit 39caae3d46903d458b44cb93ec02277c0a99fdd9 Author: Viren Baraiya Date: Sat Sep 23 12:06:29 2023 -0700 Update README.md commit cc21acdffb9512adfe07390868da693a91b42982 Author: Viren Baraiya Date: Sat Sep 23 12:05:40 2023 -0700 Update README.md commit 5739ea4e45fa4563549db196d6fa71a2b3bedce0 Author: Viren Baraiya Date: Sat Sep 23 12:02:58 2023 -0700 fixes and readme update commit 67279e98af7970c775a73e03ab7d41202cf9c3e6 Author: Viren Baraiya Date: Sat Sep 23 11:56:22 2023 -0700 update comments commit aae0a92a515a042e188946bc3927e5bdf11f915f Author: Viren Baraiya Date: Sat Sep 23 11:30:17 2023 -0700 Remove local commit abb08a79ad54bf6aa3fb5be5f42d58491be992a5 Author: Viren Baraiya Date: Sat Sep 9 20:55:06 2023 -0700 docker compose changes commit 22967e314aad6dd00c4032cf554f4a49bb808098 Author: Viren Baraiya Date: Sat Sep 9 14:52:21 2023 -0700 build fixes commit 373f59461159dd14eabcde82fcdaf305a2ca5b6f Author: Viren Baraiya Date: Sat Sep 9 00:57:05 2023 -0700 docker changes commit 06a40767a34187259f5c41c108600e5e006828b4 Author: Viren Baraiya Date: Wed Sep 6 21:57:12 2023 -0700 local container for conductor commit b01460b80bd06f5af3006c9d0ba99fad9b3a3b74 Author: Viren Baraiya Date: Tue Sep 5 23:38:21 2023 -0700 removed old compose commit fd23d226549fd797baefa1309117bd9489430a48 Author: Viren Baraiya Date: Tue Sep 5 23:34:48 2023 -0700 restore compose files commit a6165366bc90bf448de61d6309b91715ec17e7d5 Merge: 3bf2cfe9e c56b56a1b Author: Manan Bhatt Date: Wed Sep 6 11:18:52 2023 +0530 Merge branch 'docker_buils' into docker_changes commit 3bf2cfe9efceed4d218abfe5af99e02a17d7381b Author: Viren Baraiya Date: Tue Sep 5 22:40:58 2023 -0700 readme commit 96ca95123bcacef3b7fe61fc8c5c674beb0e19fd Author: Viren Baraiya Date: Tue Sep 5 22:28:37 2023 -0700 docker build with community server commit c56b56a1be18604eff28a857a72dc91c1a2d3b03 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Thu Aug 31 21:54:26 2023 +0530 changes commit 4a95a56f159537091a7e5287d62e86bfd7264367 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Wed Aug 30 00:08:45 2023 +0530 changes. commit 236fd361641806f0fe7ba3da7899ea3707f43d89 Merge: 271425341 4d99ff59c Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 21:40:16 2023 +0530 Merge branch 'main' of https://github.com/Netflix/conductor into docker_buils commit 271425341097b87b4f05ac395ba7360ec378d6b4 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 21:39:15 2023 +0530 revert property changes commit 1c07b5fb00ea6480e5aca47ad23c6ad7bc5c13a6 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 21:37:40 2023 +0530 revert commit 99f6b7c756f51b5423a501cd01feb2aede96fc7e Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 21:03:52 2023 +0530 docker builds commit 0cbec910c5be6fdfb34ccd7e201849eea0c0cee7 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 17:51:46 2023 +0530 update doc commit 90691b3ad30aaa88b0b5d6f0036e15cc53e689c3 Merge: efe072a3d 55ef67e68 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 17:45:31 2023 +0530 Merge branch 'main' into docker_buils commit efe072a3d773a276a395db83d9a8303f87f466d3 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Aug 29 14:37:31 2023 +0530 changes commit ad28adc02f399359db20caf0fc7326e876ff6922 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Mon Aug 28 12:47:21 2023 +0530 docker build changes. commit 55ef67e68d627efdc3f45e0938e2e6ecaf92f5aa Merge: 3ae3bc26f a32acec3e Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Wed Aug 23 14:14:46 2023 +0530 Merge branch 'main' of https://github.com/Netflix/conductor commit 3ae3bc26f6f9622a68c3b95f060c9fbae4f8ad2d Merge: e6ef05fc4 d0a588384 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Thu Aug 3 00:42:17 2023 +0530 Merge branch 'main' of https://github.com/Netflix/conductor commit e6ef05fc4563932eb259e445be5d70a406fc08db Merge: 90fd3fd29 878fcd933 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Wed Jun 14 10:53:06 2023 +0530 Merge branch 'main' of https://github.com/Netflix/conductor commit 90fd3fd290bd1998e5140c75f1e1e81d05a6eacc Merge: e4e7e0d0e 3d9b27f26 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Wed Apr 12 18:43:53 2023 +0530 Merge remote-tracking branch 'upstream/main' commit e4e7e0d0e534dd7999a042c1d5669fe8f02843ad Merge: 8c65ec197 9322716e9 Author: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue Apr 4 10:32:39 2023 +0530 Merge remote-tracking branch 'origin/loop_performance_improvement' commit 9322716e93e8141a4d0785bfe4f376e6826a5ca4 Author: Manan Bhatt Date: Wed Mar 2 11:32:29 2022 +0530 format plugin commit e1a084498f7bccb2786084ad52bbefb6d8d2ca5b Author: Manan Bhatt Date: Wed Mar 2 11:21:40 2022 +0530 Wait and check only for current iteration task to get completed. Wait and check only for current iteration task to get completed. --- docker/README.md | 52 ++++++++++++- docker/docker-compose-dynomite.yaml | 31 -------- ...compose.yaml => docker-compose-mysql.yaml} | 11 +-- docker/docker-compose-postgres.yaml | 44 ++++------- docker/docker-compose-prometheus.yaml | 20 ----- docker/docker-compose.yaml | 46 ++++-------- docker/grpc/Makefile | 18 ----- docker/server/Dockerfile | 54 +++++++++++--- docker/server/README.md | 13 ---- docker/server/bin/startup.sh | 10 ++- docker/server/config/config-local.properties | 36 --------- .../config/config-mysql-grpc.properties | 39 ---------- docker/server/config/config-mysql.properties | 27 ------- .../server/config/config-postgres.properties | 24 +++--- docker/server/config/config-redis.properties | 24 ++++++ docker/server/config/config.properties | 74 ++++++++----------- docker/server/config/redis.conf | 1 + docker/server/nginx/nginx.conf | 50 +++++++++++++ docker/serverAndUI/Dockerfile | 63 ---------------- docker/serverAndUI/README.md | 10 --- docker/serverAndUI/bin/startup.sh | 36 --------- .../config/config-local.properties | 33 --------- docker/serverAndUI/config/config.properties | 35 --------- docker/serverAndUI/nginx/nginx.conf | 20 ----- docker/ui/Dockerfile | 14 ++-- 25 files changed, 261 insertions(+), 524 deletions(-) delete mode 100644 docker/docker-compose-dynomite.yaml rename docker/{grpc/docker-compose.yaml => docker-compose-mysql.yaml} (90%) delete mode 100644 docker/docker-compose-prometheus.yaml delete mode 100644 docker/grpc/Makefile delete mode 100644 docker/server/README.md delete mode 100755 docker/server/config/config-local.properties delete mode 100755 docker/server/config/config-mysql-grpc.properties delete mode 100755 docker/server/config/config-mysql.properties create mode 100755 docker/server/config/config-redis.properties create mode 100644 docker/server/config/redis.conf create mode 100644 docker/server/nginx/nginx.conf delete mode 100644 docker/serverAndUI/Dockerfile delete mode 100644 docker/serverAndUI/README.md delete mode 100755 docker/serverAndUI/bin/startup.sh delete mode 100755 docker/serverAndUI/config/config-local.properties delete mode 100755 docker/serverAndUI/config/config.properties delete mode 100644 docker/serverAndUI/nginx/nginx.conf diff --git a/docker/README.md b/docker/README.md index 538ebae353..b45b2d9bc6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1 +1,51 @@ -[Docker Instructions](/docs/docs/gettingstarted/docker.md) \ No newline at end of file + +# Conductor Docker Builds + +## Pre-built docker images + +Conductor server with support for the following backend: +1. Redis +2. Postgres +3. Mysql +4. Cassandra + +### Docker File for Server and UI + +[Docker Image Source for Server with UI](docker/server/DockerFile) + +### Configuration Guide for Conductor Server +Conductor uses a persistent store for managing state. +The choice of backend is quite flexible and can be configured at runtime using `conductor.db.type` property. + +Refer to the table below for various supported backend and required configurations to enable each of them. + +> [!IMPORTANT] +> +> See [config.properties](docker/server/config/config.properties) for the required properties for each of the backends. +> +> | Backend | Property | +> |------------|------------------------------------| +> | postgres | conductor.db.type=postgres | +> | redis | conductor.db.type=redis_standalone | +> | mysql | conductor.db.type=mysql | +> | cassandra | conductor.db.type=cassandra | +> + +Conductor using Elasticsearch for indexing the workflow data. +Currently, Elasticsearch 6 and 7 are supported. + +We welcome community contributions for other indexing backends. + +**Note:** Docker images use Elasticsearch 7. + +## Helm Charts +TODO: Link to the helm charts + +## Run Docker Compose Locally +### Use the docker-compose to bring up the local conductor server. + +| Docker Compose | Description | +|--------------------------------------------------------------|----------------------------| +| [docker-compose.yaml](docker-compose.yaml) | Redis + Elasticsearch 7 | +| [docker-compose-postgres.yaml](docker-compose-postgres.yaml) | Postgres + Elasticsearch 7 | +| [docker-compose-postgres.yaml](docker-compose-mysql.yaml) | Mysql + Elasticsearch 7 | diff --git a/docker/docker-compose-dynomite.yaml b/docker/docker-compose-dynomite.yaml deleted file mode 100644 index 99e15af930..0000000000 --- a/docker/docker-compose-dynomite.yaml +++ /dev/null @@ -1,31 +0,0 @@ -version: '2.3' - -services: - conductor-server: - environment: - - CONFIG_PROP=config.properties - links: - - dynomite:dyno1 - depends_on: - dynomite: - condition: service_healthy - - dynomite: - image: v1r3n/dynomite - networks: - - internal - ports: - - 8102:8102 - healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/8102' - interval: 5s - timeout: 5s - retries: 12 - logging: - driver: "json-file" - options: - max-size: "1k" - max-file: "3" - -networks: - internal: diff --git a/docker/grpc/docker-compose.yaml b/docker/docker-compose-mysql.yaml similarity index 90% rename from docker/grpc/docker-compose.yaml rename to docker/docker-compose-mysql.yaml index 40a75625b7..0db7d31d65 100644 --- a/docker/grpc/docker-compose.yaml +++ b/docker/docker-compose-mysql.yaml @@ -4,11 +4,12 @@ services: conductor-server: environment: - - CONFIG_PROP=config-mysql-grpc.properties + - conductor.db.type=redis_standalone + - conductor.redis.hosts=rs:6379:us-east-1c image: conductor:server build: - context: ../../ - dockerfile: docker/server/Dockerfile + context: .. + dockerfile: server/Dockerfile networks: - internal ports: @@ -30,8 +31,8 @@ services: - WF_SERVER=http://conductor-server:8080 image: conductor:ui build: - context: ../../ - dockerfile: docker/ui/Dockerfile + context: .. + dockerfile: ui/Dockerfile networks: - internal ports: diff --git a/docker/docker-compose-postgres.yaml b/docker/docker-compose-postgres.yaml index 568eed95c7..12a6b70465 100644 --- a/docker/docker-compose-postgres.yaml +++ b/docker/docker-compose-postgres.yaml @@ -13,21 +13,19 @@ services: - internal ports: - 8080:8080 + - 5000:5000 healthcheck: test: [ "CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health" ] interval: 60s timeout: 30s retries: 12 links: - - elasticsearch:es - - redis:rs - - postgres:postgresdb + - conductor-elasticsearch:es + - conductor-postgres:postgresdb depends_on: - elasticsearch: + conductor-elasticsearch: condition: service_healthy - redis: - condition: service_healthy - postgres: + conductor-postgres: condition: service_healthy logging: driver: "json-file" @@ -35,7 +33,7 @@ services: max-size: "1k" max-file: "3" - postgres: + conductor-postgres: image: postgres environment: - POSTGRES_USER=conductor @@ -45,7 +43,7 @@ services: networks: - internal ports: - - 5432:5432 + - 6432:5432 healthcheck: test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/5432' interval: 5s @@ -57,32 +55,20 @@ services: max-size: "1k" max-file: "3" - redis: - image: redis:6.2.3-alpine - volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf - networks: - - internal - ports: - - 6379:6379 - healthcheck: - test: [ "CMD", "redis-cli","ping" ] - - elasticsearch: - image: elasticsearch:6.8.15 - container_name: elasticsearch + conductor-elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11 environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - xpack.security.enabled=false + - discovery.type=single-node + volumes: + - esdata-conductor:/usr/share/elasticsearch/data networks: - internal ports: - - 9200:9200 - - 9300:9300 + - 9201:9200 healthcheck: - test: wget http://localhost:9200/ -O /dev/null + test: curl http://localhost:9200/_cluster/health -o /dev/null interval: 5s timeout: 5s retries: 12 @@ -95,6 +81,8 @@ services: volumes: pgdata-conductor: driver: local + esdata-conductor: + driver: local networks: internal: diff --git a/docker/docker-compose-prometheus.yaml b/docker/docker-compose-prometheus.yaml deleted file mode 100644 index 10f8d80e40..0000000000 --- a/docker/docker-compose-prometheus.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: '3' - -services: - - prometheus: - image: prom/prometheus - volumes: - - ./prometheus/:/etc/prometheus/ - command: - - '--config.file=/etc/prometheus/prometheus.yml' - ports: - - 9090:9090 - external_links: - - conductor-server:conductor-server - networks: - - internal - restart: always - -networks: - internal: \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 91cb3d4610..81ab7aebd5 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -3,7 +3,7 @@ version: '2.3' services: conductor-server: environment: - - CONFIG_PROP=config-local.properties + - CONFIG_PROP=/app/config/config-redis.properties image: conductor:server container_name: conductor-server build: @@ -13,18 +13,19 @@ services: - internal ports: - 8080:8080 + - 5000:5000 healthcheck: test: ["CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health"] interval: 60s timeout: 30s retries: 12 links: - - elasticsearch:es - - redis:rs + - conductor-elasticsearch:es + - conductor-redis:rs depends_on: - elasticsearch: + conductor-elasticsearch: condition: service_healthy - redis: + conductor-redis: condition: service_healthy logging: driver: "json-file" @@ -32,50 +33,31 @@ services: max-size: "1k" max-file: "3" - conductor-ui: - environment: - - WF_SERVER=http://conductor-server:8080 - image: conductor:ui - container_name: conductor-ui - build: - context: ../ - dockerfile: docker/ui/Dockerfile - networks: - - internal - ports: - - 5000:5000 - links: - - conductor-server - stdin_open: true - - redis: + conductor-redis: image: redis:6.2.3-alpine volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf + - ../server/config/redis.conf:/usr/local/etc/redis/redis.conf networks: - internal ports: - - 6379:6379 + - 7379:6379 healthcheck: test: [ "CMD", "redis-cli","ping" ] - elasticsearch: - image: elasticsearch:6.8.15 - container_name: elasticsearch + conductor-elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11 environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - xpack.security.enabled=false + - discovery.type=single-node volumes: - esdata-conductor:/usr/share/elasticsearch/data networks: - internal ports: - - 9200:9200 - - 9300:9300 + - 9201:9200 healthcheck: - test: wget http://localhost:9200/ -O /dev/null + test: curl http://localhost:9200/_cluster/health -o /dev/null interval: 5s timeout: 5s retries: 12 diff --git a/docker/grpc/Makefile b/docker/grpc/Makefile deleted file mode 100644 index e111f0c63c..0000000000 --- a/docker/grpc/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - -clean-db: - docker volume rm grpc_conductor_mysql - -compose-build: - docker-compose build - -dependencies-up: - docker-compose up -d mysql elasticsearch - -dependencies-down: - docker-compose down - -stack-up: - docker-compose up - -stack-down: - docker-compose down diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index 882d5b6d91..a64622b2f6 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -1,35 +1,71 @@ # -# conductor:server - Netflix conductor server +# conductor:server - Combined Netflix conductor server & UI # - # =========================================================================================================== # 0. Builder stage # =========================================================================================================== -FROM eclipse-temurin:17-jdk-focal AS builder +FROM alpine:3.18 AS builder LABEL maintainer="Netflix OSS " -# Copy the project directly onto the image +# =========================================================================================================== +# 0. Build Conductor Server +# =========================================================================================================== + + +# Install dependencies +RUN apk add openjdk11 +RUN apk add git +RUN apk add --update nodejs npm yarn + COPY . /conductor -WORKDIR /conductor +WORKDIR /conductor/ui +RUN yarn install && yarn build +RUN ls -ltr +RUN echo "Done building UI" + +# Checkout the community project +WORKDIR / +RUN mkdir server-build +WORKDIR server-build +RUN ls -ltr + +RUN git clone https://github.com/Netflix/conductor-community.git + +# Copy the project directly onto the image +WORKDIR conductor-community +RUN ls -ltr # Build the server on run RUN ./gradlew build -x test --stacktrace +WORKDIR /server-build +RUN ls -ltr +RUN pwd + # =========================================================================================================== # 1. Bin stage # =========================================================================================================== -FROM eclipse-temurin:17-jre-focal +FROM alpine:3.18 LABEL maintainer="Netflix OSS " +RUN apk add openjdk11 +RUN apk add nginx + # Make app folders RUN mkdir -p /app/config /app/logs /app/libs # Copy the compiled output to new image -COPY --from=builder /conductor/docker/server/bin /app -COPY --from=builder /conductor/docker/server/config /app/config -COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs +COPY docker/server/bin /app +COPY docker/server/config /app/config +COPY --from=builder /server-build/conductor-community/community-server/build/libs/*boot*.jar /app/libs/conductor-server.jar + +# Copy compiled UI assets to nginx www directory +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=builder /conductor/ui/build . +COPY --from=builder /conductor/docker/server/nginx/nginx.conf /etc/nginx/http.d/default.conf # Copy the files for the server into the app folders RUN chmod +x /app/startup.sh diff --git a/docker/server/README.md b/docker/server/README.md deleted file mode 100644 index 8baafbfc05..0000000000 --- a/docker/server/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Docker -## Conductor server -This Dockerfile create the conductor:server image - -## Building the image - -Run the following commands from the project root. - -`docker build -f docker/server/Dockerfile -t conductor:server .` - -## Running the conductor server - - Standalone server (interal DB): `docker run -p 8080:8080 -d -t conductor:server` - - Server (external DB required): `docker run -p 8080:8080 -d -t -e "CONFIG_PROP=config.properties" conductor:server` diff --git a/docker/server/bin/startup.sh b/docker/server/bin/startup.sh index 9d1b98cba8..e5bd7f501d 100755 --- a/docker/server/bin/startup.sh +++ b/docker/server/bin/startup.sh @@ -16,6 +16,10 @@ echo "Starting Conductor server" +echo "Running Nginx in background" +# Start nginx as daemon +nginx + # Start the server cd /app/libs echo "Property file: $CONFIG_PROP" @@ -24,8 +28,8 @@ export config_file= if [ -z "$CONFIG_PROP" ]; then - echo "Using an in-memory instance of conductor"; - export config_file=/app/config/config-local.properties + echo "Using default configuration file"; + export config_file=/app/config/config.properties else echo "Using '$CONFIG_PROP'"; export config_file=/app/config/$CONFIG_PROP @@ -33,4 +37,4 @@ fi echo "Using java options config: $JAVA_OPTS" -java ${JAVA_OPTS} -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server-*-boot.jar 2>&1 | tee -a /app/logs/server.log +java ${JAVA_OPTS} -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server.jar 2>&1 | tee -a /app/logs/server.log diff --git a/docker/server/config/config-local.properties b/docker/server/config/config-local.properties deleted file mode 100755 index fa2cd25957..0000000000 --- a/docker/server/config/config-local.properties +++ /dev/null @@ -1,36 +0,0 @@ -# Servers. -conductor.grpc-server.enabled=false - -# Database persistence model. -conductor.db.type=redis_standalone -conductor.queue.type=redis_standalone -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=rs:6379:us-east-1c - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Elastic search instance indexing is disabled. -conductor.indexing.enabled=true -conductor.elasticsearch.url=http://es:9200 -conductor.elasticsearch.indexReplicasCount=0 - -# Load sample kitchen sink workflow -loadSample=true - -conductor.elasticsearch.clusterHealthColor=yellow diff --git a/docker/server/config/config-mysql-grpc.properties b/docker/server/config/config-mysql-grpc.properties deleted file mode 100755 index 6ed6563dc3..0000000000 --- a/docker/server/config/config-mysql-grpc.properties +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright 2021 Netflix, Inc. -#

-# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -#

-# http://www.apache.org/licenses/LICENSE-2.0 -#

-# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -# Servers. -conductor.grpc-server.enabled=true - -# Database persistence model. -conductor.db.type=mysql -conductor.queue.type=redis_standalone -conductor.redis.hosts=rs:6379:us-east-1c -spring.datasource.url=jdbc:mysql://mysql:3306/conductor -spring.datasource.username=conductor -spring.datasource.password=conductor - -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 - -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true - -# Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/server/config/config-mysql.properties b/docker/server/config/config-mysql.properties deleted file mode 100755 index d5effd8d6d..0000000000 --- a/docker/server/config/config-mysql.properties +++ /dev/null @@ -1,27 +0,0 @@ -# Servers. -conductor.grpc-server.enabled=false - -# Database persistence type. -conductor.db.type=mysql -conductor.queue.type=redis_standalone -conductor.redis.hosts=rs:6379:us-east-1c - -spring.datasource.url=jdbc:mysql://mysql:3306/conductor -spring.datasource.username=conductor -spring.datasource.password=conductor - -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 - -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true - -# Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/server/config/config-postgres.properties b/docker/server/config/config-postgres.properties index e1b3cc8fde..43aa64a0fb 100755 --- a/docker/server/config/config-postgres.properties +++ b/docker/server/config/config-postgres.properties @@ -1,27 +1,21 @@ -# Servers. -conductor.grpc-server.enabled=false - # Database persistence type. conductor.db.type=postgres -conductor.queue.type=redis_standalone -conductor.redis.hosts=rs:6379:us-east-1c -spring.datasource.url=jdbc:postgresql://postgres:5432/conductor +# postgres +spring.datasource.url=jdbc:postgresql://postgresdb:5432/postgres spring.datasource.username=conductor spring.datasource.password=conductor -# Hikari pool sizes are -1 by default and prevent startup -spring.datasource.hikari.maximum-pool-size=10 -spring.datasource.hikari.minimum-idle=2 - # Elastic search instance indexing is enabled. conductor.indexing.enabled=true - -# Transport address to elasticsearch conductor.elasticsearch.url=http://es:9200 - -# Name of the elasticsearch cluster conductor.elasticsearch.indexName=conductor +conductor.elasticsearch.version=7 +conductor.elasticsearch.clusterHealthColor=yellow + +# Additional modules for metrics collection exposed to Prometheus (optional) +conductor.metrics-prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus -# Load sample kitchen sink workflow +# Load sample kitchen-sink workflow loadSample=true diff --git a/docker/server/config/config-redis.properties b/docker/server/config/config-redis.properties new file mode 100755 index 0000000000..f2f3d20e4a --- /dev/null +++ b/docker/server/config/config-redis.properties @@ -0,0 +1,24 @@ +# Database persistence type. +# Below are the properties for redis +conductor.db.type=redis_standalone +conductor.redis.hosts=rs:6379:us-east-1c +conductor.redis-lock.serverAddress=redis://rs:6379 +conductor.redis.taskDefCacheRefreshInterval=1 +conductor.redis.workflowNamespacePrefix=conductor +conductor.redis.queueNamespacePrefix=conductor_queues + +#Use redis queues +conductor.queue.type=redis_standalone + +# Elastic search instance indexing is enabled. +conductor.indexing.enabled=true +conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.indexName=conductor +conductor.elasticsearch.version=7 + +# Additional modules for metrics collection exposed to Prometheus (optional) +conductor.metrics-prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus + +# Load sample kitchen sink workflow +loadSample=true diff --git a/docker/server/config/config.properties b/docker/server/config/config.properties index 55124c78c0..74d414520f 100755 --- a/docker/server/config/config.properties +++ b/docker/server/config/config.properties @@ -1,54 +1,42 @@ -# Servers. -conductor.grpc-server.enabled=false +# See README in the docker for configuration guide -# Database persistence type. -conductor.db.type=dynomite +# db.type determines the type of database used +# See various configurations below for the values +conductor.db.type=SET_THIS -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c +# =====================================================# +# Redis Configuration Properties +# =====================================================# +#conductor.db.type=redis_standalone -# Dynomite cluster name -conductor.redis.clusterName=dyno1 +# The last part MUST be us-east-1c, it is not used and is kept for backwards compatibility +# conductor.redis.hosts=rs:6379:us-east-1c +# -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor +# conductor.redis-lock.serverAddress=redis://rs:6379 +# conductor.redis.taskDefCacheRefreshInterval=1 +# conductor.redis.workflowNamespacePrefix=conductor +# conductor.redis.queueNamespacePrefix=conductor_queues -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 +# =====================================================# +# Postgres Configuration Properties +# =====================================================# -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true +# conductor.db.type=postgres +# spring.datasource.url=jdbc:postgresql://localhost:5432/postgres +# spring.datasource.username=postgres +# spring.datasource.password=postgres +# Additionally you can use set the spring.datasource.XXX properties for connection pool size etc. -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 +# If you want to use Postgres as indexing store set the following +# conductor.indexing.enabled=true +# conductor.indexing.type=postgres -# Elastic search instance indexing is enabled. -conductor.indexing.enabled=true +# When using Elasticsearch 7 for indexing, set the following -# Transport address to elasticsearch -conductor.elasticsearch.url=http://es:9200 +# conductor.indexing.enabled=true +# conductor.elasticsearch.url=http://es:9200 +# conductor.elasticsearch.version=7 +# conductor.elasticsearch.indexName=conductor -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor -#conductor.event-queues.amqp.queueType=classic -#conductor.event-queues.amqp.sequentialMsgProcessing=true - -# Additional modules for metrics collection exposed via logger (optional) -# conductor.metrics-logger.enabled=true -# conductor.metrics-logger.reportPeriodSeconds=15 - -# Additional modules for metrics collection exposed to Prometheus (optional) -# conductor.metrics-prometheus.enabled=true -# management.endpoints.web.exposure.include=prometheus - -# To enable Workflow/Task Summary Input/Output JSON Serialization, use the following: -# conductor.app.summary-input-output-json-serialization.enabled=true - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/server/config/redis.conf b/docker/server/config/redis.conf new file mode 100644 index 0000000000..f43add6148 --- /dev/null +++ b/docker/server/config/redis.conf @@ -0,0 +1 @@ +appendonly yes \ No newline at end of file diff --git a/docker/server/nginx/nginx.conf b/docker/server/nginx/nginx.conf new file mode 100644 index 0000000000..fa8f0871d0 --- /dev/null +++ b/docker/server/nginx/nginx.conf @@ -0,0 +1,50 @@ +server { + listen 5000; + server_name conductor; + server_tokens off; + + location / { + add_header Referrer-Policy "strict-origin"; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-Content-Type-Options "nosniff"; + add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' assets.orkes.io *.googletagmanager.com *.pendo.io https://cdn.jsdelivr.net; worker-src 'self' 'unsafe-inline' 'unsafe-eval' data: blob:;"; + add_header Permissions-Policy "accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), xr-spatial-tracking=(), clipboard-read=(self), clipboard-write=(self), gamepad=(), hid=(), idle-detection=(), serial=(), window-placement=(self)"; + + # This would be the directory where your React app's static files are stored at + root /usr/share/nginx/html; + try_files $uri /index.html; + } + + location /api { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:8080/api; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } + + location /actuator { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:8080/actuator; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } + + location /swagger-ui { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://localhost:8080/swagger-ui; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_cache_bypass $http_upgrade; + proxy_redirect off; + } +} \ No newline at end of file diff --git a/docker/serverAndUI/Dockerfile b/docker/serverAndUI/Dockerfile deleted file mode 100644 index 7840fc5f49..0000000000 --- a/docker/serverAndUI/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -# -# conductor:serverAndUI - Combined Netflix conductor server & UI -# -# =========================================================================================================== -# 0. Builder stage -# =========================================================================================================== -FROM openjdk:17-jdk AS builder -LABEL maintainer="Netflix OSS " - -# Install Node -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && apt-get update -qq \ - && apt-get install -qq --no-install-recommends \ - build-essential \ - nodejs \ - yarn \ - && apt-get upgrade -qq \ - && rm -rf /var/lib/apt/lists/* - -# Copy the project onto the builder image -COPY . /conductor - -# Build the server -WORKDIR /conductor -RUN ./gradlew build -x test - -# Build the client -WORKDIR /conductor/ui -RUN yarn install && yarn build - -# =========================================================================================================== -# 1. Bin stage -# =========================================================================================================== - -FROM nginx:alpine -RUN apk add openjdk17-jre - -LABEL maintainer="Netflix OSS " - -# Make app folders -RUN mkdir -p /app/config /app/logs /app/libs - -# Copy the compiled output to new image -COPY --from=builder /conductor/docker/serverAndUI/bin /app -COPY --from=builder /conductor/docker/serverAndUI/config /app/config -COPY --from=builder /conductor/server/build/libs/conductor-server-*-boot.jar /app/libs - -# Copy compiled UI assets to nginx www directory -WORKDIR /usr/share/nginx/html -RUN rm -rf ./* -COPY --from=builder /conductor/ui/build . -COPY --from=builder /conductor/docker/serverAndUI/nginx/nginx.conf /etc/nginx/conf.d/default.conf - -# Copy the files for the server into the app folders -RUN chmod +x /app/startup.sh - -HEALTHCHECK --interval=60s --timeout=30s --retries=10 CMD curl -I -XGET http://localhost:8080/health || exit 1 - -CMD [ "/app/startup.sh" ] -ENTRYPOINT [ "/bin/sh"] diff --git a/docker/serverAndUI/README.md b/docker/serverAndUI/README.md deleted file mode 100644 index 275d74add6..0000000000 --- a/docker/serverAndUI/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Docker -## Conductor server and UI -This Dockerfile create the conductor:serverAndUI image - -## Building the image -`docker build -t conductor:serverAndUI .` - -## Running the conductor server - - Standalone server (interal DB): `docker run -p 8080:8080 -p 80:5000 -d -t conductor:serverAndUI` - - Server (external DB required): `docker run -p 8080:8080 -p 80:5000 -d -t -e "CONFIG_PROP=config.properties" conductor:serverAndUI` diff --git a/docker/serverAndUI/bin/startup.sh b/docker/serverAndUI/bin/startup.sh deleted file mode 100755 index 0070cd0b9d..0000000000 --- a/docker/serverAndUI/bin/startup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# -# Copyright 2021 Netflix, Inc. -#

-# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -#

-# http://www.apache.org/licenses/LICENSE-2.0 -#

-# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. -# - -echo "Starting Conductor Server and UI" -echo "Running Nginx in background" -# Start nginx as daemon -nginx - -# Start the server -cd /app/libs -echo "Property file: $CONFIG_PROP" -echo $CONFIG_PROP -export config_file= - -if [ -z "$CONFIG_PROP" ]; - then - echo "Using an in-memory instance of conductor"; - export config_file=/app/config/config-local.properties - else - echo "Using '$CONFIG_PROP'"; - export config_file=/app/config/$CONFIG_PROP -fi - -nohup java -jar -DCONDUCTOR_CONFIG_FILE=$config_file conductor-server-*-boot.jar 1>&2 > /app/logs/server.log diff --git a/docker/serverAndUI/config/config-local.properties b/docker/serverAndUI/config/config-local.properties deleted file mode 100755 index d725130e89..0000000000 --- a/docker/serverAndUI/config/config-local.properties +++ /dev/null @@ -1,33 +0,0 @@ -# Database persistence type. -conductor.db.type=memory - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Transport address to elasticsearch -conductor.elasticsearch.url=localhost:9300 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/serverAndUI/config/config.properties b/docker/serverAndUI/config/config.properties deleted file mode 100755 index c596c6f10f..0000000000 --- a/docker/serverAndUI/config/config.properties +++ /dev/null @@ -1,35 +0,0 @@ -# Database persistence model. -conductor.db.type=dynomite - -# Dynomite Cluster details. -# format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c - -# Dynomite cluster name -conductor.redis.clusterName=dyno1 - -# Namespace for the keys stored in Dynomite/Redis -conductor.redis.workflowNamespacePrefix=conductor - -# Namespace prefix for the dyno queues -conductor.redis.queueNamespacePrefix=conductor_queues - -# No. of threads allocated to dyno-queues (optional) -queues.dynomite.threads=10 - -# By default with dynomite, we want the repairservice enabled -conductor.app.workflowRepairServiceEnabled=true - -# Non-quorum port used to connect to local redis. Used by dyno-queues. -# When using redis directly, set this to the same port as redis server -# For Dynomite, this is 22122 by default or the local redis-server port used by Dynomite. -conductor.redis.queuesNonQuorumPort=22122 - -# Transport address to elasticsearch -conductor.elasticsearch.url=es:9300 - -# Name of the elasticsearch cluster -conductor.elasticsearch.indexName=conductor - -# Load sample kitchen sink workflow -loadSample=true diff --git a/docker/serverAndUI/nginx/nginx.conf b/docker/serverAndUI/nginx/nginx.conf deleted file mode 100644 index 74e0ec2e61..0000000000 --- a/docker/serverAndUI/nginx/nginx.conf +++ /dev/null @@ -1,20 +0,0 @@ -server { - listen 5000; - server_name conductor; - location / { - # This would be the directory where your React app's static files are stored at - root /usr/share/nginx/html; - try_files $uri /index.html; - } - - location /api { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://localhost:8080/api; - proxy_ssl_session_reuse off; - proxy_set_header Host $http_host; - proxy_cache_bypass $http_upgrade; - proxy_redirect off; - } -} \ No newline at end of file diff --git a/docker/ui/Dockerfile b/docker/ui/Dockerfile index a79aef3b0b..b7967b9a00 100644 --- a/docker/ui/Dockerfile +++ b/docker/ui/Dockerfile @@ -1,25 +1,25 @@ # # conductor:ui - Netflix Conductor UI # -FROM node:16-alpine +FROM node:20-alpine LABEL maintainer="Netflix OSS " # Install the required packages for the node build # to run on alpine RUN apk update && apk add --no-cache python3 py3-pip make g++ - + # A directory within the virtualized Docker environment # Becomes more relevant when using Docker Compose later WORKDIR /usr/src/app - + # Copies package.json to Docker environment in a separate layer as a performance optimization COPY ./ui/package.json ./ - + # Installs all node packages. Cached unless package.json changes RUN yarn install - + # Copies everything else over to Docker environment -# node_modules excluded in .dockerignore. +# node_modules excluded in .dockerignore. COPY ./ui . - + CMD [ "yarn", "start" ] From 915fd18a8fdb1d9ad9cc7cba638a5d27223ce827 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Wed, 27 Sep 2023 23:17:43 -0700 Subject: [PATCH 27/28] fixes for the containers --- docker/docker-compose.yaml | 2 +- docker/server/Dockerfile | 4 ++-- docker/server/config/config-redis.properties | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 81ab7aebd5..7c32c1437c 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -3,7 +3,7 @@ version: '2.3' services: conductor-server: environment: - - CONFIG_PROP=/app/config/config-redis.properties + - CONFIG_PROP=config-redis.properties image: conductor:server container_name: conductor-server build: diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index a64622b2f6..ab6b099b50 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -14,7 +14,7 @@ LABEL maintainer="Netflix OSS " # Install dependencies -RUN apk add openjdk11 +RUN apk add openjdk17 RUN apk add git RUN apk add --update nodejs npm yarn @@ -50,7 +50,7 @@ FROM alpine:3.18 LABEL maintainer="Netflix OSS " -RUN apk add openjdk11 +RUN apk add openjdk17 RUN apk add nginx # Make app folders diff --git a/docker/server/config/config-redis.properties b/docker/server/config/config-redis.properties index f2f3d20e4a..5afd337974 100755 --- a/docker/server/config/config-redis.properties +++ b/docker/server/config/config-redis.properties @@ -15,6 +15,7 @@ conductor.indexing.enabled=true conductor.elasticsearch.url=http://es:9200 conductor.elasticsearch.indexName=conductor conductor.elasticsearch.version=7 +conductor.elasticsearch.clusterHealthColor=yellow # Additional modules for metrics collection exposed to Prometheus (optional) conductor.metrics-prometheus.enabled=true From ec0d36a459487beca7586c6f595b3068130759c5 Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Thu, 28 Sep 2023 13:55:56 -0700 Subject: [PATCH 28/28] mysql containers --- docker/docker-compose-mysql.yaml | 70 ++++++++++---------- docker/server/config/config-mysql.properties | 24 +++++++ docker/server/config/log4j.properties | 1 + 3 files changed, 60 insertions(+), 35 deletions(-) create mode 100755 docker/server/config/config-mysql.properties diff --git a/docker/docker-compose-mysql.yaml b/docker/docker-compose-mysql.yaml index 0db7d31d65..5c587e3218 100644 --- a/docker/docker-compose-mysql.yaml +++ b/docker/docker-compose-mysql.yaml @@ -4,44 +4,41 @@ services: conductor-server: environment: - - conductor.db.type=redis_standalone - - conductor.redis.hosts=rs:6379:us-east-1c + - CONFIG_PROP=config-mysql.properties image: conductor:server + container_name: conductor-server build: - context: .. - dockerfile: server/Dockerfile + context: ../ + dockerfile: docker/server/Dockerfile networks: - internal ports: - 8080:8080 - - 8090:8090 + - 5000:5000 + healthcheck: + test: [ "CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health" ] + interval: 60s + timeout: 30s + retries: 12 links: - - elasticsearch:es - - redis:rs + - conductor-elasticsearch:es + - conductor-mysql:mysql + - conductor-redis:rs depends_on: - elasticsearch: + conductor-elasticsearch: condition: service_healthy - mysql: + conductor-mysql: condition: service_healthy - redis: + conductor-redis: condition: service_healthy + logging: + driver: "json-file" + options: + max-size: "1k" + max-file: "3" - conductor-ui: - environment: - - WF_SERVER=http://conductor-server:8080 - image: conductor:ui - build: - context: .. - dockerfile: ui/Dockerfile - networks: - - internal - ports: - - 5000:5000 - depends_on: - - conductor-server - - mysql: - image: mysql:5.7 + conductor-mysql: + image: mysql:latest environment: MYSQL_ROOT_PASSWORD: 12345 MYSQL_DATABASE: conductor @@ -61,31 +58,31 @@ services: timeout: 5s retries: 12 - redis: + conductor-redis: image: redis:6.2.3-alpine volumes: - ./redis.conf:/usr/local/etc/redis/redis.conf networks: - internal ports: - - 6379:6379 + - 7379:6379 healthcheck: test: [ "CMD", "redis-cli","ping" ] - elasticsearch: - image: elasticsearch:6.8.15 + conductor-elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.17.11 environment: - "ES_JAVA_OPTS=-Xms512m -Xmx1024m" - - transport.host=0.0.0.0 - - discovery.type=single-node - xpack.security.enabled=false + - discovery.type=single-node + volumes: + - esdata-conductor:/usr/share/elasticsearch/data networks: - internal ports: - - 9200:9200 - - 9300:9300 + - 9201:9200 healthcheck: - test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/9300' + test: curl http://localhost:9200/_cluster/health -o /dev/null interval: 5s timeout: 5s retries: 12 @@ -97,6 +94,9 @@ services: volumes: conductor_mysql: + driver: local + esdata-conductor: + driver: local networks: internal: diff --git a/docker/server/config/config-mysql.properties b/docker/server/config/config-mysql.properties new file mode 100755 index 0000000000..6b618dc2eb --- /dev/null +++ b/docker/server/config/config-mysql.properties @@ -0,0 +1,24 @@ +# Database persistence type. +conductor.db.type=mysql + +# mysql +spring.datasource.url=jdbc:mysql://mysql:3306/conductor +spring.datasource.username=conductor +spring.datasource.password=conductor + +# Use redis queues +conductor.queue.type=redis_standalone + +# Elastic search instance indexing is enabled. +conductor.indexing.enabled=true +conductor.elasticsearch.url=http://es:9200 +conductor.elasticsearch.indexName=conductor +conductor.elasticsearch.version=7 +conductor.elasticsearch.clusterHealthColor=yellow + +# Additional modules for metrics collection exposed to Prometheus (optional) +conductor.metrics-prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus + +# Load sample kitchen-sink workflow +loadSample=true diff --git a/docker/server/config/log4j.properties b/docker/server/config/log4j.properties index bb249b00d0..900fbc3224 100644 --- a/docker/server/config/log4j.properties +++ b/docker/server/config/log4j.properties @@ -23,3 +23,4 @@ log4j.appender.A1=org.apache.log4j.ConsoleAppender # A1 uses PatternLayout. log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n +logging.logger.com.netflix.dyno.queues.redis.RedisDynoQueue=ERROR \ No newline at end of file