diff --git a/dependencies.gradle b/dependencies.gradle index 7f49e20bf7..fa71f80a37 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -41,6 +41,7 @@ ext { revJsr311Api = '1.1.1' revMockServerClient = '5.12.0' revOpenapi = '1.6.+' + revOrkesQueues = '1.0.3' revPowerMock = '2.0.9' revProtoBuf = '3.13.0' revProtogenAnnotations = '1.0.0' diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index b59fa7c38c..0ffd47175d 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -20,9 +20,15 @@ services: retries: 12 links: - elasticsearch:es + - redis:rs + - rabbitmq:amqp depends_on: elasticsearch: condition: service_healthy + redis: + condition: service_healthy + rabbitmq: + condition: service_healthy logging: driver: "json-file" options: @@ -45,6 +51,15 @@ services: - conductor-server stdin_open: true + redis: + image: redis:6.2.3-alpine + volumes: + - ./redis.conf:/usr/local/etc/redis/redis.conf + ports: + - 6379:6379 + healthcheck: + test: [ "CMD", "redis-cli","ping" ] + elasticsearch: image: elasticsearch:8.6.2 container_name: elasticsearch @@ -70,6 +85,24 @@ services: options: max-size: "1k" max-file: "3" + rabbitmq: + image: rabbitmq:3-management-alpine + container_name: rabbitmq + volumes: + - ./.docker/rabbitmq/etc/:/etc/rabbitmq/ + - ./.docker/rabbitmq/data/:/var/lib/rabbitmq/ + - ./.docker/rabbitmq/logs/:/var/log/rabbitmq/ + environment: + RABBITMQ_DEFAULT_USER: guest + RABBITMQ_DEFAULT_PASS: guest + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:15672" ] + interval: 30s + timeout: 10s + retries: 5 + ports: + - 5672:5672 + - 15672:15672 volumes: esdata-conductor: diff --git a/docker/server/config/config-local.properties b/docker/server/config/config-local.properties index 6e5071ea7a..44d4d38b81 100755 --- a/docker/server/config/config-local.properties +++ b/docker/server/config/config-local.properties @@ -2,11 +2,11 @@ conductor.grpc-server.enabled=false # Database persistence model. -conductor.db.type=memory +conductor.db.type=redis_standalone # Dynomite Cluster details. # format is host:port:rack separated by semicolon -conductor.redis.hosts=dyno1:8102:us-east-1c +conductor.redis.hosts=rs:63709:us-east-1c # Namespace for the keys stored in Dynomite/Redis conductor.redis.workflowNamespacePrefix=conductor @@ -26,7 +26,7 @@ conductor.app.workflowRepairServiceEnabled=true conductor.redis.queuesNonQuorumPort=22122 # Elastic search instance indexing is disabled. -conductor.indexing.enabled=false +conductor.indexing.enabled=true conductor.elasticsearch.url=http://es:9200 conductor.elasticsearch.indexReplicasCount=0 diff --git a/server/build.gradle b/server/build.gradle index 5a9183081b..1bee569167 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -39,6 +39,7 @@ dependencies { implementation 'org.apache.logging.log4j:log4j-web' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation "io.orkes.queues:orkes-conductor-queues:${revOrkesQueues}" implementation "org.springdoc:springdoc-openapi-ui:${revOpenapi}" diff --git a/server/src/main/java/com/netflix/conductor/Conductor.java b/server/src/main/java/com/netflix/conductor/Conductor.java index de253a7e20..be5bda17b6 100644 --- a/server/src/main/java/com/netflix/conductor/Conductor.java +++ b/server/src/main/java/com/netflix/conductor/Conductor.java @@ -21,12 +21,14 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.context.annotation.ComponentScan; import org.springframework.core.io.FileSystemResource; // Prevents from the datasource beans to be loaded, AS they are needed only for specific databases. // In case that SQL database is selected this class will be imported back in the appropriate // database persistence module. @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) +@ComponentScan(basePackages = {"com.netflix.conductor", "io.orkes.conductor"}) public class Conductor { private static final Logger log = LoggerFactory.getLogger(Conductor.class); diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index e002b55e23..09b8f22b46 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -16,13 +16,15 @@ springdoc.api-docs.path=/api-docs loadSample=true conductor.db.type=memory +conductor.queue.type=redis_standalone 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=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 conductor.redis.workflowNamespacePrefix= diff --git a/server/src/test/java/com/netflix/conductor/common/config/ConductorObjectMapperTest.java b/server/src/test/java/com/netflix/conductor/common/config/ConductorObjectMapperTest.java index 9fe058d20c..a02b7ce34a 100644 --- a/server/src/test/java/com/netflix/conductor/common/config/ConductorObjectMapperTest.java +++ b/server/src/test/java/com/netflix/conductor/common/config/ConductorObjectMapperTest.java @@ -21,6 +21,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; @@ -43,6 +44,7 @@ */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) @RunWith(SpringRunner.class) +@TestPropertySource(properties = "conductor.queue.type=") public class ConductorObjectMapperTest { @Autowired ObjectMapper objectMapper;