worker-workflow-container
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.github.cafdataprocessing.workers.workflow</groupId>
<artifactId>worker-workflow-container</artifactId>
<version>8.1.2-1550</version>
</dependency><?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017-2025 Open Text.
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.cafdataprocessing.workers.workflow</groupId>
<artifactId>worker-workflow-aggregator</artifactId>
<version>8.1.2-1550</version>
</parent>
<artifactId>worker-workflow-container</artifactId>
<packaging>pom</packaging>
<!-- Properties for the worker. -->
<properties>
<settingsServiceUrl>http://${docker.host.address}:${settings.service.port}</settingsServiceUrl>
<settingsServiceAdminUrl>http://${docker.host.address}:${settings.service.admin.port}</settingsServiceAdminUrl>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<settingsPostgresDbName>settings</settingsPostgresDbName>
<postgresDbPassword>root</postgresDbPassword>
<postgresDbUser>root</postgresDbUser>
<test.case.generation>false</test.case.generation>
<test.data>${project.basedir}/test-data/input</test.data>
<worker-workflow.container.name>${dockerCafDataProcessingOrg}worker-workflow${dockerProjectVersion}</worker-workflow.container.name>
<skipTests>true</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>com.github.workerframework</groupId>
<artifactId>standard-worker-container</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.github.cafdataprocessing.workers.workflow</groupId>
<artifactId>worker-workflow</artifactId>
</dependency>
<dependency>
<groupId>com.github.cafdataprocessing.workers.document</groupId>
<artifactId>worker-document</artifactId>
</dependency>
<dependency>
<!--
Work around an issue whereby the jakarta.el-api jar is not being included in the Docker image.
This may be fixed by https://github.com/dropwizard/dropwizard/pull/9570 but we won't know for sure until it is merged and
a version of DropWizard that includes it is released.
-->
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.cafapi.logging</groupId>
<artifactId>caf-logging-logback</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.github.cafdataprocessing.workers.document</groupId>
<artifactId>worker-document-testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.workerframework.testing</groupId>
<artifactId>workerframework-testing-integration</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.workerframework.testing</groupId>
<artifactId>workerframework-testing-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Unpack the base worker configuration files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>process-config-files</id>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.workerframework</groupId>
<artifactId>worker-default-configs</artifactId>
<outputDirectory>${project.build.directory}/config-files</outputDirectory>
<excludes>META-INF/**</excludes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Process the local configuration files -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>process-config-files</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/config-files</outputDirectory>
<resources>
<resource>
<directory>src/main/config</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Plugin for compiling the test source files. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Plugin for running integration tests in the integration-test phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<datastore.enabled>false</datastore.enabled>
<docker.host.address>${docker.host.address}</docker.host.address>
<expected.folder>${test.data}</expected.folder>
<input.folder>${test.data}</input.folder>
<rabbitmq.node.port>${rabbitmq.node.port}</rabbitmq.node.port>
<rabbitmq.ctrl.port>${rabbitmq.ctrl.port}</rabbitmq.ctrl.port>
<testCaseGeneration>${test.case.generation}</testCaseGeneration>
<worker.restport>${worker.restport}</worker.restport>
<worker.adminport>${worker.adminport}</worker.adminport>
</systemPropertyVariables>
<environmentVariables>
<CAF_APPNAME>caf/worker</CAF_APPNAME>
<CAF_CONFIG_PATH>${project.build.directory}/config-files</CAF_CONFIG_PATH>
<CAF_CONFIG_DECODER>JavascriptDecoder</CAF_CONFIG_DECODER>
<CAF_CONFIG_ENABLE_SUBSTITUTOR>false</CAF_CONFIG_ENABLE_SUBSTITUTOR>
<CAF_WORKER_DATASTORE_PATH>datastore</CAF_WORKER_DATASTORE_PATH>
<CAF_RABBITMQ_PREFETCH_BUFFER>1000</CAF_RABBITMQ_PREFETCH_BUFFER>
<CAF_WORKER_RETRY_LIMIT>2</CAF_WORKER_RETRY_LIMIT>
<CAF_WORKER_MAX_BATCH_SIZE>2</CAF_WORKER_MAX_BATCH_SIZE>
<CAF_WORKER_MAX_BATCH_TIME>5000</CAF_WORKER_MAX_BATCH_TIME>
</environmentVariables>
</configuration>
</plugin>
<!--
Builds the Docker image for the WorkflowWorker, starts RabbitMQ and assembles the configuration files
for running the integration tests.
-->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<!-- Build the container in compile phase. -->
<execution>
<id>build-docker-container</id>
<phase>compile</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<!-- Start the containers in pre-integration-test phase. -->
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<!-- Stop the containers in post-integration-test phase. -->
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
<!-- Push the docker image for the worker to the registry in deploy phase -->
<execution>
<id>upload-docker-container</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<filter>worker-workflow</filter>
</configuration>
</execution>
</executions>
<configuration>
<watchInterval>500</watchInterval>
<logDate>default</logDate>
<verbose>true</verbose>
<images>
<!-- WebDav -->
<image>
<alias>webdav</alias>
<name>${projectDockerRegistry}/cloudesire/webdav</name>
<run>
<volumes>
<bind>
<volume>/srv/common/webdav</volume>
</bind>
</volumes>
<ports>
<port>${webdav.apache.port}:8080</port>
</ports>
<env>
<APACHE_PORT>8080</APACHE_PORT>
</env>
<wait>
<log>WebDAV Server startup complete</log>
<http>
<url>http://${docker.host.address}:${webdav.apache.port}</url>
</http>
<time>120000</time>
<shutdown>500</shutdown>
</wait>
<log>
<enabled>true</enabled>
</log>
</run>
</image>
<!-- Run the RabbitMQ image. -->
<image>
<alias>rabbitmq</alias>
<name>${projectDockerRegistry}/library/rabbitmq</name>
<run>
<ports>
<port>${rabbitmq.ctrl.port}:15672</port>
<port>${rabbitmq.node.port}:5672</port>
</ports>
<wait>
<log>Server startup complete</log>
<http>
<url>http://${docker.host.address}:${rabbitmq.ctrl.port}</url>
</http>
<time>120000</time>
<shutdown>500</shutdown>
</wait>
<log>
<enabled>true</enabled>
</log>
</run>
</image>
<!-- Settings database -->
<image>
<alias>settings-db</alias>
<name>${projectDockerRegistry}/library/postgres</name>
<run>
<ports>
<port>${settings.postgres.db.port}:5432</port>
</ports>
<env>
<POSTGRES_PASSWORD>${postgresDbPassword}</POSTGRES_PASSWORD>
<POSTGRES_USER>${postgresDbUser}</POSTGRES_USER>
<POSTGRES_DB>${settingsPostgresDbName}</POSTGRES_DB>
</env>
<wait>
<log>PostgreSQL init process complete</log>
<time>120000</time>
<shutdown>500</shutdown>
</wait>
<log>
<enabled>true</enabled>
</log>
</run>
</image>
<!-- Settings Service -->
<image>
<alias>settings-service</alias>
<name>${projectDockerRegistry}/caf/settings-service</name>
<run>
<ports>
<port>${settings.service.port}:8080</port>
<port>${settings.service.admin.port}:8081</port>
</ports>
<env>
<CAF_SETTINGS_SERVICE_DATABASE_HOST>settings-db</CAF_SETTINGS_SERVICE_DATABASE_HOST>
<CAF_SETTINGS_SERVICE_DATABASE_PORT>5432</CAF_SETTINGS_SERVICE_DATABASE_PORT>
<CAF_SETTINGS_SERVICE_DATABASE_NAME>${settingsPostgresDbName}</CAF_SETTINGS_SERVICE_DATABASE_NAME>
<CAF_SETTINGS_SERVICE_DATABASE_USERNAME>${postgresDbUser}</CAF_SETTINGS_SERVICE_DATABASE_USERNAME>
<CAF_SETTINGS_SERVICE_DATABASE_PASSWORD>${postgresDbPassword}</CAF_SETTINGS_SERVICE_DATABASE_PASSWORD>
<CAF_SETTINGS_SERVICE_DATABASE_APPNAME>caf_settings_service</CAF_SETTINGS_SERVICE_DATABASE_APPNAME>
</env>
<wait>
<http>
<url>${settingsServiceAdminUrl}/healthcheck</url>
<method>GET</method>
</http>
<time>120000</time>
<shutdown>500</shutdown>
</wait>
<links>
<link>settings-db</link>
</links>
<log>
<enabled>true</enabled>
</log>
</run>
</image>
<!-- Configuration for the worker-workflow image -->
<image>
<alias>worker-workflow</alias>
<name>${worker-workflow.container.name}</name>
<build>
<from>${projectDockerRegistry}/cafapi/oraclelinux-jre21</from>
<!-- The entry point will be the worker.sh executable. -->
<cmd>
<exec>
<args>/maven/worker.sh</args>
</exec>
</cmd>
<healthCheck>
<cmd>curl -f http://localhost:8080/health-check?type=READY || exit 1</cmd>
</healthCheck>
<assembly>
<mode>tar</mode>
<inline>
<!-- Including the executable worker.sh and worker.yaml files in the docker tar -->
<fileSets>
<fileSet>
<lineEnding>unix</lineEnding>
<includes>
<include>worker.sh</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<lineEnding>unix</lineEnding>
<includes>
<include>worker.yaml</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/config-files</directory>
<outputDirectory>config</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/docker/workflows</directory>
<outputDirectory>workflows</outputDirectory>
</fileSet>
</fileSets>
<!-- Including the dependencies into the docker tar -->
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</inline>
</assembly>
</build>
<run>
<ports>
<port>${worker.restport}:8080</port>
<port>${worker.adminport}:8081</port>
<port>${worker.debugport}:5005</port>
</ports>
<env>
<CAF_WORKFLOW_WORKER_WORKFLOWS_DIRECTORY>/maven/workflows</CAF_WORKFLOW_WORKER_WORKFLOWS_DIRECTORY>
<CAF_RABBITMQ_PREFETCH_BUFFER>1000</CAF_RABBITMQ_PREFETCH_BUFFER>
<CAF_WORKER_DATASTORE_PATH>/srv/common/webdav</CAF_WORKER_DATASTORE_PATH>
<CAF_WORKER_JAVA_OPTS>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005</CAF_WORKER_JAVA_OPTS>
<CAF_WORKER_MAX_BATCH_SIZE>2</CAF_WORKER_MAX_BATCH_SIZE>
<CAF_WORKER_MAX_BATCH_TIME>5000</CAF_WORKER_MAX_BATCH_TIME>
<CAF_WORKER_RETRY_LIMIT>2</CAF_WORKER_RETRY_LIMIT>
<CAF_SETTINGS_SERVICE_URL>${settingsServiceUrl}</CAF_SETTINGS_SERVICE_URL>
</env>
<volumes>
<from>
<image>webdav</image>
</from>
</volumes>
<links>
<link>rabbitmq</link>
<link>settings-service</link>
</links>
<log>
<enabled>true</enabled>
</log>
<wait>
<http>
<url>http://${docker.host.address}:${worker.adminport}</url>
</http>
<time>120000</time>
<shutdown>500</shutdown>
</wait>
</run>
</image>
</images>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- profile to optionally disable build of a container, you can enable this profile, and run your tests against
a fixed container without rebuilding each time. -->
<profile>
<id>skip-build-docker-container</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>build-docker-container</id>
<phase>compile</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Use this profile if your virtual machine setup must use fixed ports. -->
<profile>
<id>use-default-fixed-ports</id>
<properties>
<settings.postgres.db.port>5532</settings.postgres.db.port>
<rabbitmq.ctrl.port>15672</rabbitmq.ctrl.port>
<rabbitmq.node.port>5672</rabbitmq.node.port>
<worker.restport>8080</worker.restport>
<worker.adminport>8081</worker.adminport>
<worker.debugport>5005</worker.debugport>
</properties>
</profile>
</profiles>
</project>