diff --git a/.github/settings.xml b/.github/settings.xml
new file mode 100644
index 0000000000..59d889141e
--- /dev/null
+++ b/.github/settings.xml
@@ -0,0 +1,13 @@
+
+
+
+
+ gha
+
+ true
+
+
+
+
+
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d118728506..857ead849e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -14,23 +14,12 @@ jobs:
build:
strategy:
matrix:
- jdk_version: ['17']
+ jdk_version: [ '17' ]
fail-fast: false
- runs-on: self-hosted
+ runs-on: ubuntu-latest
steps:
- - name: Clear /tmp
- run: |
- docker run --rm -v /tmp:/data alpine find /data -ctime +2 -exec rm -rf '{}' \; 2>&1 > /dev/null || true
-
- - name: Clear old Docker resources
- run: |
- docker rm -f $(docker ps -aq) || true
- docker volume rm $(docker volume ps -q) || true
- docker system prune -af || true
- docker image prune -af || true
-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
@@ -42,21 +31,16 @@ jobs:
username: ${{ secrets.OSS_DOCKERHUB_USERNAME }}
password: ${{ secrets.OSS_DOCKERHUB_PASSWORD }}
- - uses: actions/checkout@v3
-
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '${{ matrix.jdk_version }}'
distribution: 'temurin'
- - name: Remove old Concord artifacts
- run: |
- rm -rf ~/.m2/repository/com/walmartlabs/concord
- rm -rf ~/actions-runner/.m2/repository/com/walmartlabs/concord
+ - name: Checkout
+ uses: actions/checkout@v3
- name: Build and test with Maven
- run: ./mvnw -B clean install -Pdocker -Pit -Pjdk${{ matrix.jdk_version }}
-
- - name: Build with debian docker images
- run: ./mvnw -C -B -f docker-images install -DskipTests -Pdocker -Pdebian -Pjdk${{ matrix.jdk_version }}
+ env:
+ SKIP_DOCKER_TESTS: "true"
+ run: ./mvnw -s .github/settings.xml -B clean install -Pgha -Pdocker -Pit -Pjdk${{ matrix.jdk_version }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 46e8c41cbb..8eb04f8723 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,89 @@
# Change log
+## [2.5.0] - 2023-12-10
+
+### Added
+
+- concord-server: support @Priority annotation when binding
+Jetty components
+([#841](https://github.com/walmartlabs/concord/pull/841));
+
+### Changed
+
+- runtime-v2: allow "true|false" string in if expression
+([#844](https://github.com/walmartlabs/concord/pull/844));
+- docker-images: Upgrade default Ansible installation to 2.14
+([#843](https://github.com/walmartlabs/concord/pull/843));
+- ansible-plugin: callback compatibility for Ansible 2.14
+([#842](https://github.com/walmartlabs/concord/pull/842));
+- concord-server: resume process now returns BAD_REQUEST
+if no event found
+([#838](https://github.com/walmartlabs/concord/pull/838)).
+
+### Breaking
+
+- docker-images: drop CentOS-based images, use Debian by default
+([#843](https://github.com/walmartlabs/concord/pull/843).
+
+
+
+## [2.4.0] - 2023-11-26
+
+### Added
+
+- concord-server: add `EXTRA_CLASSPATH` to start script
+([#836](https://github.com/walmartlabs/concord/pull/836));
+
+### Changed
+
+- concord-agent-operator: use JDK 17 base image
+([#836](https://github.com/walmartlabs/concord/pull/836));
+- concord-common: shared ObjectMapperProvider
+([#836](https://github.com/walmartlabs/concord/pull/836)).
+
+
+
+## [2.3.0] - 2023-11-21
+
+### Added
+
+- testing-concord-server: add getter for the server instance
+([#832](https://github.com/walmartlabs/concord/pull/832));
+- testing-concord-server: add agent wrapper, simple test
+([835](https://github.com/walmartlabs/concord/pull/835)).
+
+### Changed
+
+- project: attach source jars only on release
+([#832](https://github.com/walmartlabs/concord/pull/832));
+- concord-server: auto-wire modules in concord-server/dist
+instead of impl
+([#834](https://github.com/walmartlabs/concord/pull/834)).
+
+
+
+## [2.2.0] - 2023-11-13
+
+### Added
+
+- pfed-sso: enable bearer token authentication
+([#811](https://github.com/walmartlabs/concord/pull/811)).
+
+### Changed
+
+- runtime-v2: fix exit from parallel loop #830
+([#830](https://github.com/walmartlabs/concord/pull/830));
+- console2: calculate process duration from process last running timestamp
+([#794](https://github.com/walmartlabs/concord/pull/794));
+- console2: do not drop secrets form values on error/password check fail
+([#798](https://github.com/walmartlabs/concord/pull/798));
+- project: attach javadoc jars only on release
+([#823](https://github.com/walmartlabs/concord/pull/823));
+- project: upgrade to source level 17
+([#824](https://github.com/walmartlabs/concord/pull/824));
+- project: remove more @Named usage
+([#828](https://github.com/walmartlabs/concord/pull/828)).
+
## [2.1.0] - 2023-10-10
### Added
@@ -31,9 +115,10 @@
- cli: active profiles fix
([#789](https://github.com/walmartlabs/concord/pull/789)).
-## [2.0.0] - 2023-08-16
+## [2.0.0] - 2023-08-16
+
# Breaking
- project: drop support for JDK 8 and JDK 11. Make JDK 17
@@ -90,6 +175,8 @@ auth ([#764](https://github.com/walmartlabs/concord/pull/764));
- console2: do not remove project after rename;
([#770](https://github.com/walmartlabs/concord/pull/770)).
+
+
## [1.102.0] - 2023-05-22
### Added
@@ -124,6 +211,8 @@ improve error messages
- runtime-v2: allow increment variables in expressions
([#740](https://github.com/walmartlabs/concord/pull/740)).
+
+
## [1.101.0] - 2023-03-29
### Added
@@ -170,6 +259,8 @@ forms
- concord-server: remove more @Named usage
([#650](https://github.com/walmartlabs/concord/pull/650)).
+
+
## [1.99.0] - 2023-02-24
### Added
@@ -376,6 +467,7 @@ to support k8s 1.22+
([#639](https://github.com/walmartlabs/concord/pull/639)).
+
## [1.95.0] - 2022-04-16
### Added
@@ -417,6 +509,8 @@ files ([#593](https://github.com/walmartlabs/concord/pull/593)).
- it: explicitly specify initialBranch for git tests
([#582](https://github.com/walmartlabs/concord/pull/582)).
+
+
## [1.93.3] - 2022-03-11
### Changed
diff --git a/README.md b/README.md
index 60ff3d9000..0b77a4afad 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ different systems together using scenarios and plugins created by users.
Dependencies:
- [Git](https://git-scm.com/) 2.18+
-- [Java 8](https://adoptium.net/)
+- [Java 17](https://adoptium.net/)
- [Docker Community Edition](https://www.docker.com/community-edition)
- [Docker Buildx](https://docs.docker.com/build/buildx/install/)
- (Optional) [NodeJS and NPM](https://nodejs.org/en/download/) (Node 16 or greater)
@@ -39,14 +39,13 @@ cd concord
Available Maven profiles:
- `docker` - build Docker images;
-- `debian` - build Debian-based Docker images instead of the default CentOS base;
- `it` - run integration tests;
-- `jdk17`, `jdk17-aarch64` - use a different JDK version for building artifacts and Docker images.
+- `jdk17-aarch64` - use a different JDK version for building artifacts and Docker images.
Profiles can be combined, e.g.
```
-./mvnw clean install -Pdocker -Pdebian -Pit -Pjdk17-aarch64
+./mvnw clean install -Pdocker -Pit -Pjdk17-aarch64
```
## Console
@@ -122,4 +121,4 @@ See the [examples](examples) directory.
## Development Notes
-See [NOTES.md](NOTES.md).
\ No newline at end of file
+See [NOTES.md](NOTES.md).
diff --git a/agent/pom.xml b/agent/pom.xml
index 64c4001982..2b28147746 100644
--- a/agent/pom.xml
+++ b/agent/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -81,6 +81,14 @@
com.fasterxml.jackson.core
jackson-databind
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jdk8
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
com.fasterxml.jackson.core
jackson-annotations
@@ -125,10 +133,6 @@
com.fasterxml.jackson.datatype
jackson-datatype-guava
-
- com.fasterxml.jackson.datatype
- jackson-datatype-jdk8
-
com.google.code.findbugs
jsr305
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/Agent.java b/agent/src/main/java/com/walmartlabs/concord/agent/Agent.java
index cbf69159d1..c2c1e5c04f 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/Agent.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/Agent.java
@@ -37,18 +37,13 @@
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.io.IOException;
-import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
-@Named
-@Singleton
public class Agent {
private static final Logger log = LoggerFactory.getLogger(Agent.class);
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/AgentModule.java b/agent/src/main/java/com/walmartlabs/concord/agent/AgentModule.java
new file mode 100644
index 0000000000..8d33c466c1
--- /dev/null
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/AgentModule.java
@@ -0,0 +1,82 @@
+package com.walmartlabs.concord.agent;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2023 Walmart 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.
+ * =====
+ */
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.inject.Binder;
+import com.google.inject.Module;
+import com.typesafe.config.Config;
+import com.walmartlabs.concord.agent.cfg.*;
+import com.walmartlabs.concord.agent.executors.runner.DefaultDependencies;
+import com.walmartlabs.concord.agent.executors.runner.ProcessPool;
+import com.walmartlabs.concord.agent.remote.ApiClientFactory;
+import com.walmartlabs.concord.agent.remote.QueueClientProvider;
+import com.walmartlabs.concord.common.ObjectMapperProvider;
+import com.walmartlabs.concord.server.queueclient.QueueClient;
+import com.walmartlabs.ollie.config.ConfigurationProcessor;
+import com.walmartlabs.ollie.config.Environment;
+import com.walmartlabs.ollie.config.EnvironmentSelector;
+
+import javax.inject.Named;
+
+import static com.google.inject.Scopes.SINGLETON;
+
+@Named
+public class AgentModule implements Module {
+
+ private final Config config;
+
+ public AgentModule() {
+ this(loadDefaultConfig());
+ }
+
+ public AgentModule(Config config) {
+ this.config = config;
+ }
+
+ @Override
+ public void configure(Binder binder) {
+ binder.bind(ObjectMapper.class).toProvider(ObjectMapperProvider.class);
+ binder.bind(Config.class).toInstance(config);
+
+ binder.bind(AgentConfiguration.class).in(SINGLETON);
+ binder.bind(DockerConfiguration.class).in(SINGLETON);
+ binder.bind(GitConfiguration.class).in(SINGLETON);
+ binder.bind(ImportConfiguration.class).in(SINGLETON);
+ binder.bind(PreForkConfiguration.class).in(SINGLETON);
+ binder.bind(RepositoryCacheConfiguration.class).in(SINGLETON);
+ binder.bind(RunnerV1Configuration.class).in(SINGLETON);
+ binder.bind(RunnerV2Configuration.class).in(SINGLETON);
+ binder.bind(ServerConfiguration.class).in(SINGLETON);
+
+ binder.bind(DefaultDependencies.class).in(SINGLETON);
+ binder.bind(ProcessPool.class).in(SINGLETON);
+ binder.bind(ApiClientFactory.class).in(SINGLETON);
+ binder.bind(QueueClient.class).toProvider(QueueClientProvider.class).in(SINGLETON);
+
+ binder.bind(Agent.class).in(SINGLETON);
+ }
+
+ private static Config loadDefaultConfig() {
+ Environment env = new EnvironmentSelector().select();
+ return new ConfigurationProcessor("concord-agent", env, null, null).process();
+ }
+}
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/AgentConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/AgentConfiguration.java
index eadd5478fc..4c5c99a486 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/AgentConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/AgentConfiguration.java
@@ -25,8 +25,6 @@
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.nio.file.Path;
import java.time.Duration;
import java.util.List;
@@ -37,8 +35,6 @@
import static com.walmartlabs.concord.agent.cfg.Utils.getOrCreatePath;
import static com.walmartlabs.concord.agent.cfg.Utils.getStringOrDefault;
-@Named
-@Singleton
public class AgentConfiguration {
private static final Logger log = LoggerFactory.getLogger(AgentConfiguration.class);
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/DockerConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/DockerConfiguration.java
index 90fde7f7f9..da7bc9cca4 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/DockerConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/DockerConfiguration.java
@@ -23,13 +23,9 @@
import com.typesafe.config.Config;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.util.List;
import java.util.concurrent.TimeUnit;
-@Named
-@Singleton
public class DockerConfiguration {
private final String dockerHost;
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/GitConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/GitConfiguration.java
index 6dcce8e6e4..85bdcab673 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/GitConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/GitConfiguration.java
@@ -29,8 +29,6 @@
import static com.walmartlabs.concord.agent.cfg.Utils.getStringOrDefault;
-@Named
-@Singleton
public class GitConfiguration {
private final String token;
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ImportConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ImportConfiguration.java
index 7cde1f8ca7..f1f5756ba0 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ImportConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ImportConfiguration.java
@@ -23,14 +23,10 @@
import com.typesafe.config.Config;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
-@Named
-@Singleton
public class ImportConfiguration {
private final Set disabledProcessors;
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/PreForkConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/PreForkConfiguration.java
index 68758b065c..de38930cee 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/PreForkConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/PreForkConfiguration.java
@@ -23,12 +23,8 @@
import com.typesafe.config.Config;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.util.concurrent.TimeUnit;
-@Named
-@Singleton
public class PreForkConfiguration {
private final boolean enabled;
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RepositoryCacheConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RepositoryCacheConfiguration.java
index 81ef969da0..c1454e31a1 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RepositoryCacheConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RepositoryCacheConfiguration.java
@@ -23,15 +23,11 @@
import com.typesafe.config.Config;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.nio.file.Path;
import java.time.Duration;
import static com.walmartlabs.concord.agent.cfg.Utils.getOrCreatePath;
-@Named
-@Singleton
public class RepositoryCacheConfiguration {
private final Path cacheDir;
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV1Configuration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV1Configuration.java
index 90246a638f..dc57172c37 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV1Configuration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV1Configuration.java
@@ -23,11 +23,7 @@
import com.typesafe.config.Config;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-@Named
-@Singleton
public class RunnerV1Configuration extends AbstractRunnerConfiguration {
@Inject
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV2Configuration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV2Configuration.java
index 1f12aee1a6..8128b7dd67 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV2Configuration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/RunnerV2Configuration.java
@@ -23,11 +23,7 @@
import com.typesafe.config.Config;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-@Named
-@Singleton
public class RunnerV2Configuration extends AbstractRunnerConfiguration {
@Inject
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ServerConfiguration.java b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ServerConfiguration.java
index eabe02609c..5e6bfb4523 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ServerConfiguration.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/cfg/ServerConfiguration.java
@@ -25,14 +25,10 @@
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.util.concurrent.TimeUnit;
import static com.walmartlabs.concord.agent.cfg.Utils.getStringOrDefault;
-@Named
-@Singleton
public class ServerConfiguration {
private static final Logger log = LoggerFactory.getLogger(ServerConfiguration.class);
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/DefaultDependencies.java b/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/DefaultDependencies.java
index 70ad0e3387..4c5d88f5e2 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/DefaultDependencies.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/DefaultDependencies.java
@@ -23,8 +23,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -37,8 +35,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-@Named
-@Singleton
public class DefaultDependencies {
private static final Logger log = LoggerFactory.getLogger(DefaultDependencies.class);
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/ProcessPool.java b/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/ProcessPool.java
index a389be7e8d..54dd575a65 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/ProcessPool.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/executors/runner/ProcessPool.java
@@ -29,16 +29,12 @@
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.io.IOException;
import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-@Named
-@Singleton
public class ProcessPool {
private static final Logger log = LoggerFactory.getLogger(ProcessPool.class);
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/remote/ApiClientFactory.java b/agent/src/main/java/com/walmartlabs/concord/agent/remote/ApiClientFactory.java
index 92e2fde99b..0b2403c212 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/remote/ApiClientFactory.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/remote/ApiClientFactory.java
@@ -30,8 +30,6 @@
import com.walmartlabs.concord.common.IOUtils;
import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
import java.io.IOException;
import java.nio.file.Path;
import java.util.HashMap;
@@ -39,8 +37,6 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;
-@Named
-@Singleton
public class ApiClientFactory {
private static final String SESSION_COOKIE_NAME = "JSESSIONID";
diff --git a/agent/src/main/java/com/walmartlabs/concord/agent/remote/QueueClientProvider.java b/agent/src/main/java/com/walmartlabs/concord/agent/remote/QueueClientProvider.java
index 789a565b8a..63f6945bd2 100644
--- a/agent/src/main/java/com/walmartlabs/concord/agent/remote/QueueClientProvider.java
+++ b/agent/src/main/java/com/walmartlabs/concord/agent/remote/QueueClientProvider.java
@@ -26,13 +26,9 @@
import com.walmartlabs.concord.server.queueclient.QueueClientConfiguration;
import javax.inject.Inject;
-import javax.inject.Named;
import javax.inject.Provider;
-import javax.inject.Singleton;
import java.net.URISyntaxException;
-@Named
-@Singleton
public class QueueClientProvider implements Provider {
private final AgentConfiguration agentCfg;
diff --git a/cli/pom.xml b/cli/pom.xml
index e4a5d95703..244c7e320b 100644
--- a/cli/pom.xml
+++ b/cli/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/client/pom.xml b/client/pom.xml
index 4fc0aef8c0..a3c12448e2 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/client2/pom.xml b/client2/pom.xml
index b4bd0b0986..983b440c44 100644
--- a/client2/pom.xml
+++ b/client2/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/client2/src/main/java/com/walmartlabs/concord/client2/impl/MultipartRequestBodyHandler.java b/client2/src/main/java/com/walmartlabs/concord/client2/impl/MultipartRequestBodyHandler.java
index a6c705d22e..4575c072a8 100644
--- a/client2/src/main/java/com/walmartlabs/concord/client2/impl/MultipartRequestBodyHandler.java
+++ b/client2/src/main/java/com/walmartlabs/concord/client2/impl/MultipartRequestBodyHandler.java
@@ -27,6 +27,7 @@
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.Collection;
import java.util.Map;
import java.util.UUID;
@@ -36,6 +37,7 @@ public static HttpEntity handle(ObjectMapper objectMapper, Map d
return handle(new MultipartBuilder(), objectMapper, data);
}
+ @SuppressWarnings("unchecked")
public static HttpEntity handle(MultipartBuilder b, ObjectMapper objectMapper, Map data) {
for (Map.Entry e : data.entrySet()) {
String k = e.getKey();
@@ -60,6 +62,8 @@ public static HttpEntity handle(MultipartBuilder b, ObjectMapper objectMapper, M
b.addFormDataPart(k, null, RequestBody.create(ContentType.TEXT_PLAIN, v.toString()));
} else if (v instanceof String[]) {
b.addFormDataPart(k, null, RequestBody.create(ContentType.TEXT_PLAIN, String.join(",", (String[]) v)));
+ } else if (v instanceof Collection>) {
+ b.addFormDataPart(k, null, RequestBody.create(ContentType.TEXT_PLAIN, String.join(",", (Collection) v)));
} else if (v instanceof UUID) {
b.addFormDataPart(k, v.toString());
} else if (v instanceof Enum>) {
diff --git a/common/pom.xml b/common/pom.xml
index d3800d275d..fa388b17ee 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -47,6 +47,31 @@
commons-validator
provided
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ provided
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jdk8
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-guava
+ provided
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ provided
+
@@ -75,11 +100,6 @@
junit-jupiter-engine
test
-
- com.fasterxml.jackson.core
- jackson-databind
- test
-
diff --git a/common/src/main/java/com/walmartlabs/concord/common/ObjectMapperProvider.java b/common/src/main/java/com/walmartlabs/concord/common/ObjectMapperProvider.java
new file mode 100644
index 0000000000..7be85aca83
--- /dev/null
+++ b/common/src/main/java/com/walmartlabs/concord/common/ObjectMapperProvider.java
@@ -0,0 +1,59 @@
+package com.walmartlabs.concord.common;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2019 Walmart 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.
+ * =====
+ */
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.datatype.guava.GuavaModule;
+import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Provider;
+
+public class ObjectMapperProvider implements Provider {
+
+ private static final Logger log = LoggerFactory.getLogger(ObjectMapperProvider.class);
+
+ @Override
+ public ObjectMapper get() {
+ log.info("Using concord-common's ObjectMapper...");
+
+ ObjectMapper mapper = new ObjectMapper()
+ .registerModule(new Jdk8Module())
+ .registerModule(new GuavaModule())
+ .registerModule(new JavaTimeModule());
+
+ // Write dates as ISO-8601
+ mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+
+ // Ignore unknown properties
+ mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
+
+ // Ignore nulls
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+
+ return mapper;
+ }
+}
diff --git a/console2/pom.xml b/console2/pom.xml
index 3df2f8be18..e6463b44de 100644
--- a/console2/pom.xml
+++ b/console2/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/console2/src/components/organisms/ProcessActivity/Toolbar.tsx b/console2/src/components/organisms/ProcessActivity/Toolbar.tsx
index 1594193938..6bbd3393f1 100644
--- a/console2/src/components/organisms/ProcessActivity/Toolbar.tsx
+++ b/console2/src/components/organisms/ProcessActivity/Toolbar.tsx
@@ -146,7 +146,7 @@ const renderProcessStatus = (process?: ProcessEntry) => {
let duration;
if (process.status === ProcessStatus.RUNNING) {
- duration = formatDuration(new Date().getTime() - parseDate(process.createdAt).getTime());
+ duration = formatDuration(new Date().getTime() - parseDate(process.lastRunAt || process.createdAt).getTime());
}
return (
<>
diff --git a/dependency-manager/pom.xml b/dependency-manager/pom.xml
index ca193853fa..32e3a3e83b 100644
--- a/dependency-manager/pom.xml
+++ b/dependency-manager/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/docker-images/agent/oss/centos/Dockerfile b/docker-images/agent/oss/centos/Dockerfile
deleted file mode 100644
index 43974cf7c7..0000000000
--- a/docker-images/agent/oss/centos/Dockerfile
+++ /dev/null
@@ -1,20 +0,0 @@
-ARG docker_namespace=walmartlabs
-ARG concord_version=latest
-
-FROM $docker_namespace/concord-ansible:$concord_version
-LABEL maintainer="ibodrov@gmail.com"
-
-ENV DOCKER_HOST tcp://dind:2375
-ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt
-
-USER root
-
-RUN dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
- dnf -y install docker-ce-cli uuid && \
- dnf clean all
-
-COPY --chown=concord:concord target/deps/ /home/concord/.m2/repository
-ADD --chown=concord:concord target/dist/agent.tar.gz /opt/concord/agent/
-
-USER concord
-CMD ["bash", "/opt/concord/agent/start.sh"]
diff --git a/docker-images/agent/pom.xml b/docker-images/agent/pom.xml
index 175d05b0d1..b1e5a3521c 100644
--- a/docker-images/agent/pom.xml
+++ b/docker-images/agent/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.docker
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -15,7 +15,7 @@
${docker.namespace}/concord-agent
${agent.image}
- oss/centos/Dockerfile
+ oss/debian/Dockerfile
false
@@ -117,12 +117,4 @@
-
-
- debian
-
- oss/debian/Dockerfile
-
-
-
diff --git a/docker-images/ansible/galaxy_requirements.yml b/docker-images/ansible/galaxy_requirements.yml
new file mode 100644
index 0000000000..eef53e024e
--- /dev/null
+++ b/docker-images/ansible/galaxy_requirements.yml
@@ -0,0 +1,28 @@
+---
+collections:
+ - name: community.general
+ version: "7.0.1"
+ - name: ansible.windows
+ version: "1.14.0"
+ - name: ansible.posix
+ version: "1.5.4"
+ - name: community.windows
+ version: "1.13.0"
+ - name: kubernetes.core
+ version: "2.4.0"
+ - name: community.crypto
+ version: "2.13.1"
+ - name: community.mysql
+ version: "3.7.1"
+ - name: openstack.cloud
+ version: "2.1.0"
+ - name: community.postgresql
+ version: "2.4.1"
+ - name: community.docker
+ version: "3.4.6"
+ - name: "ansible.netcommon"
+ version: "5.1.1"
+ - name: "google.cloud"
+ version: "1.1.3"
+ - name: "chocolatey.chocolatey"
+ version: "1.4.0"
diff --git a/docker-images/ansible/oss/centos/Dockerfile b/docker-images/ansible/oss/centos/Dockerfile
deleted file mode 100644
index a2b4248696..0000000000
--- a/docker-images/ansible/oss/centos/Dockerfile
+++ /dev/null
@@ -1,45 +0,0 @@
-ARG docker_namespace=walmartlabs
-ARG concord_version=latest
-
-FROM $docker_namespace/concord-base:$concord_version
-LABEL maintainer="ybrigadirenko@walmartlabs.com"
-
-RUN mkdir -p /workspace
-WORKDIR /workspace
-
-RUN dnf -y install \
- gcc \
- gcc-c++ \
- krb5-devel \
- krb5-libs \
- krb5-workstation \
- libffi-devel \
- openssh-clients \
- openssl-devel \
- rsync \
- util-linux && \
- dnf clean all
-
-
-ENV PATH=/usr/local/bin/concord_venv/bin:${PATH}
-ENV VIRTUAL_ENV=/usr/local/bin/concord_venv
-
-RUN umask 0022 && \
- pip3 install --no-cache-dir --upgrade --ignore-installed \
- "cryptography<=3.3.1" \
- "ansible>=2.8.0,<2.9.0" \
- "Appium-Python-Client<1.0" \
- boto3 \
- botocore \
- bzt \
- docker \
- kerberos \
- openshift \
- pbr \
- pyvmomi \
- pywinrm>=0.4.1 \
- requests_kerberos \
- urllib3 \
- ujson
-
-USER concord
diff --git a/docker-images/ansible/oss/debian/Dockerfile b/docker-images/ansible/oss/debian/Dockerfile
index 4cd4d93bba..94131696f6 100644
--- a/docker-images/ansible/oss/debian/Dockerfile
+++ b/docker-images/ansible/oss/debian/Dockerfile
@@ -10,6 +10,8 @@ ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
RUN mkdir -p /workspace
WORKDIR /workspace
+COPY galaxy_requirements.yml galaxy_requirements.yml
+
RUN DEBIAN_FRONTEND=${DEBIAN_FRONTEND} apt-get -y install \
gcc \
g++ \
@@ -29,21 +31,27 @@ ENV VIRTUAL_ENV=/usr/local/bin/concord_venv
RUN umask 0022 && \
pip3 install --no-cache-dir --upgrade --break-system-packages --ignore-installed \
- "cryptography<=3.3.1" \
- "ansible>=2.8.0,<2.9.0" \
- "Appium-Python-Client<1.0" \
- "openshift<=0.11.2" \
- "jinja2<=3.0.3" \
- boto3 \
- botocore \
- bzt \
- docker \
- kerberos \
- pbr \
- pyvmomi \
- "pywinrm>=0.4.1" \
- requests_kerberos \
- urllib3 \
- ujson
+ "cryptography<=3.4.8" \
+ "ansible-core>=2.14,<2.15" \
+ "Appium-Python-Client<1.0" \
+ "openshift==0.13.2" \
+ "jinja2<=3.1.0" \
+ boto3 \
+ botocore \
+ bzt \
+ docker \
+ kerberos \
+ kubernetes \
+ pyyaml \
+ pbr \
+ pyvmomi \
+ "pywinrm>=0.4.3" \
+ requests_kerberos \
+ urllib3 \
+ ujson \
+ virtualenv
+
+RUN umask 0022 && \
+ ansible-galaxy collection install -p /usr/share/ansible/collections -r galaxy_requirements.yml
USER concord
diff --git a/docker-images/ansible/pom.xml b/docker-images/ansible/pom.xml
index f1d448825c..5e24a89d7d 100644
--- a/docker-images/ansible/pom.xml
+++ b/docker-images/ansible/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.docker
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -15,7 +15,7 @@
${docker.namespace}/concord-ansible
${ansible.image}
- oss/centos/Dockerfile
+ oss/debian/Dockerfile
false
@@ -42,13 +42,4 @@
-
-
-
- debian
-
- oss/debian/Dockerfile
-
-
-
diff --git a/docker-images/base/oss/centos/Dockerfile b/docker-images/base/oss/centos/Dockerfile
deleted file mode 100644
index cfcae8d472..0000000000
--- a/docker-images/base/oss/centos/Dockerfile
+++ /dev/null
@@ -1,48 +0,0 @@
-FROM library/centos:8
-LABEL maintainer="mtkunke@walmartlabs.com"
-
-ENTRYPOINT ["/usr/local/bin/concord_venv/bin/dumb-init", "--"]
-
-RUN echo 'fastestmirror=true' >> /etc/dnf/dnf.conf && \
- echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf
-
-# update mirrors to point to vault.centos.org(older versions)
-RUN cd /etc/yum.repos.d/ && \
- sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
- sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
-
-# requires Git >= 2.3
-RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial && \
- dnf -y upgrade && \
- dnf -y install \
- dnf-plugins-core \
- which \
- libtool-ltdl \
- strace \
- python3 \
- python3-virtualenv \
- git \
- coreutils-single \
- glibc-all-langpacks && \
- dnf clean all && \
- alternatives --set python /usr/bin/python3 && \
- alternatives --install /usr/bin/pip pip /usr/bin/pip2 0
-
-ADD --chmod=755 ./get_jdk_url.sh /tmp/
-ARG jdk_version
-ENV JDK_VERSION=${jdk_version}
-ENV TARGETARCH=${TARGETARCH:-"amd64"}
-RUN curl --location --output /tmp/jdk.tar.gz $(/tmp/get_jdk_url.sh) && \
- mkdir /opt/jdk && \
- tar xpf /tmp/jdk.tar.gz --strip 1 -C /opt/jdk && \
- rm /tmp/jdk.tar.gz
-
-ENV JAVA_HOME /opt/jdk
-ENV PATH="${JAVA_HOME}/bin:${PATH}"
-ENV LC_CTYPE en_US.UTF-8
-ENV LANG en_US.UTF-8
-
-RUN virtualenv /usr/local/bin/concord_venv && \
- /usr/local/bin/concord_venv/bin/pip3 --no-cache-dir install dumb-init
-
-RUN groupadd -g 456 concord && useradd --no-log-init -u 456 -g concord -m -s /sbin/nologin concord
diff --git a/docker-images/base/oss/debian/Dockerfile b/docker-images/base/oss/debian/Dockerfile
index d21bfaec86..5374975127 100644
--- a/docker-images/base/oss/debian/Dockerfile
+++ b/docker-images/base/oss/debian/Dockerfile
@@ -7,10 +7,9 @@ ENTRYPOINT ["/usr/local/bin/concord_venv/bin/dumb-init", "--"]
RUN apt-get update && \
apt-get -y upgrade && \
- apt-get -y install openssh-client libltdl-dev wget unzip diffutils strace git gdebi-core && \
- apt-get -y install python3 python3-pip coreutils locales locales-all curl && \
+ apt-get -y install openssh-client libltdl-dev wget unzip diffutils strace git gdebi-core \
+ python3 python3-pip python-is-python3 coreutils locales locales-all curl && \
apt-get clean && \
- ln -f -s /usr/bin/python3 /usr/bin/python && \
pip3 install --no-cache-dir --break-system-packages dumb-init virtualenv
diff --git a/docker-images/base/pom.xml b/docker-images/base/pom.xml
index 0b87dbeaa2..279070ea99 100644
--- a/docker-images/base/pom.xml
+++ b/docker-images/base/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.docker
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -16,7 +16,7 @@
${docker.namespace}/concord-base
${base.image}
- oss/centos/Dockerfile
+ oss/debian/Dockerfile
false
@@ -34,13 +34,4 @@
-
-
-
- debian
-
- oss/debian/Dockerfile
-
-
-
diff --git a/docker-images/pom.xml b/docker-images/pom.xml
index dbf4362db9..98ec2fe95a 100644
--- a/docker-images/pom.xml
+++ b/docker-images/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/docker-images/server/pom.xml b/docker-images/server/pom.xml
index 2210ff32ed..7e02c7f4b1 100644
--- a/docker-images/server/pom.xml
+++ b/docker-images/server/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.docker
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/forms/pom.xml b/forms/pom.xml
index 566ee416f3..4fd029283b 100644
--- a/forms/pom.xml
+++ b/forms/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/imports/pom.xml b/imports/pom.xml
index c8a1628e0f..1c9941bab0 100644
--- a/imports/pom.xml
+++ b/imports/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/it/common/pom.xml b/it/common/pom.xml
index a57fe249c2..b0f140cf92 100644
--- a/it/common/pom.xml
+++ b/it/common/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/it/compat/pom.xml b/it/compat/pom.xml
index dcf30a4d01..ff9240fca5 100644
--- a/it/compat/pom.xml
+++ b/it/compat/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/it/console/pom.xml b/it/console/pom.xml
index 343e8e99c5..d77bd4e437 100644
--- a/it/console/pom.xml
+++ b/it/console/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/it/pom.xml b/it/pom.xml
index 23ad1112a6..5a28cb8911 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -18,6 +18,7 @@
tasks/dependency-manager-test
tasks/serialization-test
tasks/suspend-test
+ tasks/client1-test
common
server
@@ -25,6 +26,8 @@
runtime-v1
runtime-v2
compat
+
+ testing-server
diff --git a/it/runtime-v1/pom.xml b/it/runtime-v1/pom.xml
index 0de62eba74..82037fc6a3 100644
--- a/it/runtime-v1/pom.xml
+++ b/it/runtime-v1/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/it/runtime-v1/src/test/filtered-resources/version.properties b/it/runtime-v1/src/test/filtered-resources/version.properties
new file mode 100644
index 0000000000..7e48b881dd
--- /dev/null
+++ b/it/runtime-v1/src/test/filtered-resources/version.properties
@@ -0,0 +1 @@
+project.version = ${project.version}
\ No newline at end of file
diff --git a/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ITConstants.java b/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ITConstants.java
index 192d6b0852..2d12545b88 100644
--- a/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ITConstants.java
+++ b/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ITConstants.java
@@ -20,10 +20,29 @@
* =====
*/
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
public final class ITConstants {
+ public static final String PROJECT_VERSION;
public static final long DEFAULT_TEST_TIMEOUT = 120000;
+ static {
+ PROJECT_VERSION = getProperties("version.properties").getProperty("project.version");
+ }
+
+ private static Properties getProperties(String path) {
+ try (InputStream in = ClassLoader.getSystemResourceAsStream(path)) {
+ Properties props = new Properties();
+ props.load(in);
+ return props;
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
private ITConstants() {
}
}
diff --git a/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ProcessIT.java b/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ProcessIT.java
index b8e9f63405..5fbf46b5c9 100644
--- a/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ProcessIT.java
+++ b/it/runtime-v1/src/test/java/com/walmartlabs/concord/it/runtime/v1/ProcessIT.java
@@ -24,8 +24,11 @@
import ca.ibodrov.concord.testcontainers.Payload;
import ca.ibodrov.concord.testcontainers.ProcessListQuery;
import ca.ibodrov.concord.testcontainers.junit5.ConcordRule;
+import com.google.common.base.Charsets;
+import com.google.common.io.Resources;
import com.walmartlabs.concord.client.FormListEntry;
import com.walmartlabs.concord.client.FormSubmitResponse;
+import com.walmartlabs.concord.client.ProcessCheckpointEntry;
import com.walmartlabs.concord.client.ProcessEntry;
import com.walmartlabs.concord.client.ProcessEntry.StatusEnum;
import com.walmartlabs.concord.it.common.JGitUtils;
@@ -35,8 +38,10 @@
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.extension.RegisterExtension;
+import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.net.URL;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -517,6 +522,22 @@ public void testEmptyExclusiveGroup() throws Exception {
proc.assertLog(".*Invalid exclusive mode.*");
}
+ @Test
+ public void testTaskWithClient1() throws Exception {
+ String concordYml = resourceToString(ProcessIT.class.getResource("client1Task/concord.yml"))
+ .replaceAll("PROJECT_VERSION", ITConstants.PROJECT_VERSION);
+
+ Payload payload = new Payload().concordYml(concordYml);
+
+ ConcordProcess proc = concord.processes().start(payload);
+ proc.expectStatus(StatusEnum.FINISHED);
+
+ // ---
+
+ proc.assertLog(".*process entry: RUNNING.*");
+ proc.assertLog(".*Works!.*");
+ }
+
@SuppressWarnings("unchecked")
private static void assertProcessErrorMessage(ProcessEntry p, String expected) {
assertNotNull(p);
@@ -536,4 +557,8 @@ private static void assertProcessErrorMessage(ProcessEntry p, String expected) {
private static URI resource(String name) throws URISyntaxException {
return ProcessIT.class.getResource(name).toURI();
}
+
+ private static String resourceToString(URL resource) throws IOException {
+ return Resources.toString(resource, Charsets.UTF_8);
+ }
}
diff --git a/it/runtime-v1/src/test/resources/com/walmartlabs/concord/it/runtime/v1/client1Task/concord.yml b/it/runtime-v1/src/test/resources/com/walmartlabs/concord/it/runtime/v1/client1Task/concord.yml
new file mode 100644
index 0000000000..b66dff02df
--- /dev/null
+++ b/it/runtime-v1/src/test/resources/com/walmartlabs/concord/it/runtime/v1/client1Task/concord.yml
@@ -0,0 +1,8 @@
+configuration:
+ dependencies:
+ - "mvn://com.walmartlabs.concord.it.tasks:client1-test:PROJECT_VERSION"
+
+flows:
+ default:
+ - task: client1Test
+ - log: "Works!"
\ No newline at end of file
diff --git a/it/runtime-v2/pom.xml b/it/runtime-v2/pom.xml
index 45c8a8bfa9..00433176a2 100644
--- a/it/runtime-v2/pom.xml
+++ b/it/runtime-v2/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/it/runtime-v2/src/test/java/com/walmartlabs/concord/it/runtime/v2/ProcessIT.java b/it/runtime-v2/src/test/java/com/walmartlabs/concord/it/runtime/v2/ProcessIT.java
index 9748625836..24fbb7798d 100644
--- a/it/runtime-v2/src/test/java/com/walmartlabs/concord/it/runtime/v2/ProcessIT.java
+++ b/it/runtime-v2/src/test/java/com/walmartlabs/concord/it/runtime/v2/ProcessIT.java
@@ -496,4 +496,20 @@ public void testForkVariablesAfterForm() throws Exception {
fork.assertLog(".*parentInstanceId: " + proc.instanceId() + ".*");
fork.assertLog(".*txId: " + fork.instanceId() + ".*");
}
+
+ @Test
+ public void testTaskWithClient1() throws Exception {
+ String concordYml = resourceToString(ProcessIT.class.getResource("client1Task/concord.yml"))
+ .replaceAll("PROJECT_VERSION", ITConstants.PROJECT_VERSION);
+
+ Payload payload = new Payload().concordYml(concordYml);
+
+ ConcordProcess proc = concord.processes().start(payload);
+ expectStatus(proc, ProcessEntry.StatusEnum.FINISHED);
+
+ // ---
+
+ proc.assertLog(".*process entry: RUNNING.*");
+ proc.assertLog(".*Works!.*");
+ }
}
diff --git a/it/runtime-v2/src/test/resources/com/walmartlabs/concord/it/runtime/v2/client1Task/concord.yml b/it/runtime-v2/src/test/resources/com/walmartlabs/concord/it/runtime/v2/client1Task/concord.yml
new file mode 100644
index 0000000000..29d3e6f7d4
--- /dev/null
+++ b/it/runtime-v2/src/test/resources/com/walmartlabs/concord/it/runtime/v2/client1Task/concord.yml
@@ -0,0 +1,9 @@
+configuration:
+ runtime: concord-v2
+ dependencies:
+ - "mvn://com.walmartlabs.concord.it.tasks:client1-test:PROJECT_VERSION"
+
+flows:
+ default:
+ - task: client1Test
+ - log: "Works!"
\ No newline at end of file
diff --git a/it/server/pom.xml b/it/server/pom.xml
index 70c293ea02..74ca5c19e1 100644
--- a/it/server/pom.xml
+++ b/it/server/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
@@ -29,6 +29,7 @@
ldap-node:389
custom
8001
+ false
${settings.localRepository}
net-server-it
osixia/openldap
@@ -268,6 +269,7 @@
ldap://localhost:${it.ldap.port}
${project.version}
${it.server.port}
+ ${it.skipDocker}
${tmp.dir}
diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java
index c13c02546d..9d715ed5c0 100644
--- a/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java
+++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/AbstractServerIT.java
@@ -214,4 +214,8 @@ protected static String env(String k, String def) {
}
return v;
}
+
+ public static boolean shouldSkipDockerTests() {
+ return Boolean.parseBoolean(System.getenv("IT_SKIP_DOCKER_TESTS"));
+ }
}
diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/AnsibleIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/AnsibleIT.java
index fccd8dc785..b87cd4a44b 100644
--- a/it/server/src/test/java/com/walmartlabs/concord/it/server/AnsibleIT.java
+++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/AnsibleIT.java
@@ -98,7 +98,9 @@ public void testVault() throws Exception {
// ---
ProcessEntry pir = waitForCompletion(processApi, spr.getInstanceId());
- assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus());
+
+ assertEquals(ProcessEntry.StatusEnum.FINISHED, pir.getStatus(),
+ new String(getLog(pir.getLogFileName())));
// ---
diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/CryptoIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/CryptoIT.java
index 98389eb456..7f76bc688a 100644
--- a/it/server/src/test/java/com/walmartlabs/concord/it/server/CryptoIT.java
+++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/CryptoIT.java
@@ -325,7 +325,7 @@ public void testDecryptInvalidString() throws Exception {
// ---
pir = waitForCompletion(processApi, spr.getInstanceId());
- assertEquals(ProcessEntry.StatusEnum.FAILED, pir.getStatus());
+ assertEquals(ProcessEntry.StatusEnum.FAILED, pir.getStatus(), "Process logs: " + new String(getLog(pir.getLogFileName())));
}
@Test
diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java
index 2a2242a04c..5bf1535aa1 100644
--- a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java
+++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerAnsibleIT.java
@@ -24,6 +24,7 @@
import com.walmartlabs.concord.client.ProcessEntry;
import com.walmartlabs.concord.client.StartProcessResponse;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
import java.io.File;
import java.util.HashMap;
@@ -35,6 +36,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+@DisabledIfEnvironmentVariable(named = "SKIP_DOCKER_TESTS", matches = "true", disabledReason = "Requires dockerd listening on a tcp socket. Not available in a typical CI environment")
public class DockerAnsibleIT extends AbstractServerIT {
@Test
diff --git a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java
index 04b298115f..89647ab99c 100644
--- a/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java
+++ b/it/server/src/test/java/com/walmartlabs/concord/it/server/DockerIT.java
@@ -24,6 +24,8 @@
import com.walmartlabs.concord.client.ProcessEntry;
import com.walmartlabs.concord.client.StartProcessResponse;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIf;
+import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
import java.util.HashMap;
import java.util.Map;
@@ -32,6 +34,7 @@
import static com.walmartlabs.concord.it.common.ServerClient.*;
import static org.junit.jupiter.api.Assertions.assertNotNull;
+@DisabledIfEnvironmentVariable(named = "SKIP_DOCKER_TESTS", matches = "true", disabledReason = "Requires dockerd listening on a tcp socket. Not available in a typical CI environment")
public class DockerIT extends AbstractServerIT {
@Test
diff --git a/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVault/get_password.py b/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVault/get_password.py
index 24f2a7760d..7064cc3efb 100755
--- a/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVault/get_password.py
+++ b/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVault/get_password.py
@@ -1,2 +1,2 @@
-#!/usr/bin/python
+#!/usr/bin/python3
print("q1")
diff --git a/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_all_password.py b/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_all_password.py
index c1ce83c804..d3bb3236ad 100755
--- a/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_all_password.py
+++ b/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_all_password.py
@@ -1,2 +1,2 @@
-#!/usr/bin/python
+#!/usr/bin/python3
print("q2")
diff --git a/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_local_password.py b/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_local_password.py
index 24f2a7760d..7064cc3efb 100755
--- a/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_local_password.py
+++ b/it/server/src/test/resources/com/walmartlabs/concord/it/server/ansibleVaultMultiplePasswordFiles/get_local_password.py
@@ -1,2 +1,2 @@
-#!/usr/bin/python
+#!/usr/bin/python3
print("q1")
diff --git a/it/tasks/broken-deps/pom.xml b/it/tasks/broken-deps/pom.xml
index ae95bac95f..f0bffdf254 100644
--- a/it/tasks/broken-deps/pom.xml
+++ b/it/tasks/broken-deps/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/it/tasks/client1-test/pom.xml b/it/tasks/client1-test/pom.xml
new file mode 100644
index 0000000000..361290c5c2
--- /dev/null
+++ b/it/tasks/client1-test/pom.xml
@@ -0,0 +1,52 @@
+
+
+ 4.0.0
+
+
+ com.walmartlabs.concord.it
+ parent
+ 2.5.1-SNAPSHOT
+ ../../pom.xml
+
+
+ com.walmartlabs.concord.it.tasks
+ client1-test
+ jar
+
+
+
+ com.walmartlabs.concord
+ concord-sdk
+ provided
+
+
+ com.walmartlabs.concord.runtime.v2
+ concord-runtime-sdk-v2
+ provided
+
+
+ com.walmartlabs.concord
+ concord-client
+ provided
+
+
+ javax.inject
+ javax.inject
+ provided
+
+
+ org.slf4j
+ slf4j-api
+ provided
+
+
+
+
+
+
+ org.eclipse.sisu
+ sisu-maven-plugin
+
+
+
+
diff --git a/it/tasks/client1-test/src/main/java/com/walmartlabs/concord/it/tasks/suspendtest/Client1TestTask.java b/it/tasks/client1-test/src/main/java/com/walmartlabs/concord/it/tasks/suspendtest/Client1TestTask.java
new file mode 100644
index 0000000000..95fc7d15d1
--- /dev/null
+++ b/it/tasks/client1-test/src/main/java/com/walmartlabs/concord/it/tasks/suspendtest/Client1TestTask.java
@@ -0,0 +1,55 @@
+package com.walmartlabs.concord.it.tasks.suspendtest;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2023 Walmart 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.
+ * =====
+ */
+
+import com.walmartlabs.concord.ApiClient;
+import com.walmartlabs.concord.client.ApiClientConfiguration;
+import com.walmartlabs.concord.client.ApiClientFactory;
+import com.walmartlabs.concord.client.ProcessApi;
+import com.walmartlabs.concord.client.ProcessEntry;
+import com.walmartlabs.concord.sdk.Context;
+import com.walmartlabs.concord.sdk.ContextUtils;
+import com.walmartlabs.concord.sdk.Task;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("client1Test")
+public class Client1TestTask implements Task {
+
+ private static final Logger log = LoggerFactory.getLogger(Client1TestTask.class);
+
+ private final ApiClientFactory factory;
+
+ @Inject
+ public Client1TestTask(ApiClientFactory factory) {
+ this.factory = factory;
+ }
+
+ @Override
+ public void execute(Context ctx) throws Exception {
+ ProcessApi api = new ProcessApi(factory.create(ApiClientConfiguration.builder().context(ctx).build()));
+ ProcessEntry p = api.get(ContextUtils.getTxId(ctx));
+ log.info("process entry: {}", p.getStatus());
+ }
+}
diff --git a/it/tasks/client1-test/src/main/java/com/walmartlabs/concord/it/tasks/suspendtest/Client1TestTaskV2.java b/it/tasks/client1-test/src/main/java/com/walmartlabs/concord/it/tasks/suspendtest/Client1TestTaskV2.java
new file mode 100644
index 0000000000..8545d8b881
--- /dev/null
+++ b/it/tasks/client1-test/src/main/java/com/walmartlabs/concord/it/tasks/suspendtest/Client1TestTaskV2.java
@@ -0,0 +1,62 @@
+package com.walmartlabs.concord.it.tasks.suspendtest;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2023 Walmart 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.
+ * =====
+ */
+
+import com.walmartlabs.concord.ApiClient;
+import com.walmartlabs.concord.client.ApiClientFactory;
+import com.walmartlabs.concord.client.ProcessApi;
+import com.walmartlabs.concord.client.ProcessEntry;
+import com.walmartlabs.concord.runtime.v2.sdk.Context;
+import com.walmartlabs.concord.runtime.v2.sdk.Task;
+import com.walmartlabs.concord.runtime.v2.sdk.TaskResult;
+import com.walmartlabs.concord.runtime.v2.sdk.Variables;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("client1Test")
+public class Client1TestTaskV2 implements Task {
+
+ private static final Logger log = LoggerFactory.getLogger(Client1TestTaskV2.class);
+
+ private final Context ctx;
+ private final ApiClient apiClient;
+ private final ApiClientFactory factory;
+
+ @Inject
+ public Client1TestTaskV2(Context ctx, ApiClient apiClient, ApiClientFactory factory) {
+ this.ctx = ctx;
+ this.apiClient = apiClient;
+ this.factory = factory;
+ }
+
+ @Override
+ public TaskResult execute(Variables input) throws Exception {
+ ProcessApi api = new ProcessApi(apiClient);
+
+ ProcessEntry p = api.get(ctx.processInstanceId());
+ log.info("process entry: {}", p.getStatus());
+
+ return TaskResult.success();
+ }
+}
diff --git a/it/tasks/dependency-manager-test/pom.xml b/it/tasks/dependency-manager-test/pom.xml
index 2549ad444a..f276db38fb 100644
--- a/it/tasks/dependency-manager-test/pom.xml
+++ b/it/tasks/dependency-manager-test/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/it/tasks/serialization-test/pom.xml b/it/tasks/serialization-test/pom.xml
index 857a52ef46..f111fb57d2 100644
--- a/it/tasks/serialization-test/pom.xml
+++ b/it/tasks/serialization-test/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/it/tasks/suspend-test/pom.xml b/it/tasks/suspend-test/pom.xml
index 9ec57b0391..2987b916a8 100644
--- a/it/tasks/suspend-test/pom.xml
+++ b/it/tasks/suspend-test/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.it
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/it/testing-server/pom.xml b/it/testing-server/pom.xml
new file mode 100644
index 0000000000..a5b6909cb6
--- /dev/null
+++ b/it/testing-server/pom.xml
@@ -0,0 +1,62 @@
+
+
+ 4.0.0
+
+
+ com.walmartlabs.concord.it
+ parent
+ 2.5.1-SNAPSHOT
+ ../pom.xml
+
+
+ testing-concord-server
+ jar
+
+
+
+ com.walmartlabs.concord.server
+ concord-server
+
+
+ com.walmartlabs.concord.server.plugins.ansible
+ concord-ansible-plugin
+
+
+ com.walmartlabs.concord.server.plugins
+ concord-oneops-plugin
+
+
+ com.walmartlabs.concord.server.plugins.noderoster
+ concord-noderoster-plugin
+
+
+ com.walmartlabs.concord.server.plugins
+ pfed-sso
+
+
+
+
+ com.walmartlabs.concord
+ concord-agent
+
+
+ org.testcontainers
+ postgresql
+
+
+ com.typesafe
+ config
+
+
+
+ com.walmartlabs.concord
+ concord-client2
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ test
+
+
+
diff --git a/it/testing-server/src/main/java/com/walmartlabs/concord/it/testingserver/TestingConcordAgent.java b/it/testing-server/src/main/java/com/walmartlabs/concord/it/testingserver/TestingConcordAgent.java
new file mode 100644
index 0000000000..531378e33b
--- /dev/null
+++ b/it/testing-server/src/main/java/com/walmartlabs/concord/it/testingserver/TestingConcordAgent.java
@@ -0,0 +1,97 @@
+package com.walmartlabs.concord.it.testingserver;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2023 Walmart 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.
+ * =====
+ */
+
+import com.google.inject.Guice;
+import com.google.inject.Module;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigParseOptions;
+import com.typesafe.config.ConfigResolveOptions;
+import com.walmartlabs.concord.agent.Agent;
+import com.walmartlabs.concord.agent.AgentModule;
+
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+/**
+ * A helper class for running concord-agent.
+ * The agent runs in the same JVM as TestingConcordAgent.
+ */
+public class TestingConcordAgent implements AutoCloseable {
+
+ private final Map extraConfiguration;
+ private final List> extraModules;
+ private final int apiPort;
+ private final String agentApiKey;
+
+ private Agent agent;
+
+ public TestingConcordAgent(TestingConcordServer testingConcordServer) {
+ this(testingConcordServer, Map.of(), List.of());
+ }
+
+ public TestingConcordAgent(TestingConcordServer testingConcordServer, Map extraConfiguration, List> extraModules) {
+ this.apiPort = testingConcordServer.getApiPort();
+ this.agentApiKey = testingConcordServer.getAgentApiKey();
+ this.extraConfiguration = extraConfiguration;
+ this.extraModules = extraModules;
+ }
+
+ public synchronized void start() {
+ var config = prepareConfig();
+ var system = new AgentModule(config);
+ var allModules = Stream.concat(extraModules.stream().map(f -> f.apply(config)), Stream.of(system)).toList();
+ var injector = Guice.createInjector(allModules);
+ agent = injector.getInstance(Agent.class);
+ agent.start();
+ }
+
+ public synchronized void stop() {
+ if (agent != null) {
+ agent.stop();
+ agent = null;
+ }
+ }
+
+ @Override
+ public void close() {
+ this.stop();
+ }
+
+ private Config prepareConfig() {
+ var extraConfig = ConfigFactory.parseMap(this.extraConfiguration);
+
+ var testConfig = ConfigFactory.parseMap(Map.of(
+ "maintenanceModeListenerPort", 0,
+ "server.apiBaseUrl", "http://localhost:" + apiPort,
+ "server.websocketUrl", "ws://localhost:" + apiPort + "/websocket",
+ "server.apiKey", agentApiKey
+ ));
+
+ var defaultConfig = ConfigFactory.load("concord-agent.conf", ConfigParseOptions.defaults(), ConfigResolveOptions.defaults().setAllowUnresolved(true))
+ .getConfig("concord-agent");
+
+ return extraConfig.withFallback(testConfig.withFallback(defaultConfig)).resolve();
+ }
+}
diff --git a/it/testing-server/src/main/java/com/walmartlabs/concord/it/testingserver/TestingConcordServer.java b/it/testing-server/src/main/java/com/walmartlabs/concord/it/testingserver/TestingConcordServer.java
new file mode 100644
index 0000000000..4f1260828e
--- /dev/null
+++ b/it/testing-server/src/main/java/com/walmartlabs/concord/it/testingserver/TestingConcordServer.java
@@ -0,0 +1,177 @@
+package com.walmartlabs.concord.it.testingserver;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2023 Walmart 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.
+ * =====
+ */
+
+import com.google.common.collect.ImmutableMap;
+import com.google.inject.Module;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigParseOptions;
+import com.typesafe.config.ConfigResolveOptions;
+import com.walmartlabs.concord.server.ConcordServer;
+import com.walmartlabs.concord.server.ConcordServerModule;
+import org.testcontainers.containers.PostgreSQLContainer;
+
+import java.security.SecureRandom;
+import java.util.Base64;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Stream;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
+/**
+ * A helper class for running concord-server. It runs PostgreSQL in Docker
+ * and the server runs in the same JVM as TestingConcordServer.
+ */
+public class TestingConcordServer implements AutoCloseable {
+
+ private final PostgreSQLContainer> db;
+ private final Map extraConfiguration;
+ private final List> extraModules;
+ private final int apiPort;
+ private final String adminApiKey;
+ private final String agentApiKey;
+
+ private ConcordServer server;
+
+ public TestingConcordServer(PostgreSQLContainer> db) {
+ this(db, 8001, Map.of(), List.of());
+ }
+
+ public TestingConcordServer(PostgreSQLContainer> db, int apiPort, Map extraConfiguration, List> extraModules) {
+ this.db = requireNonNull(db);
+ this.extraConfiguration = requireNonNull(extraConfiguration);
+ this.apiPort = apiPort;
+ this.extraModules = requireNonNull(extraModules);
+ this.adminApiKey = randomString(8);
+ this.agentApiKey = randomString(16);
+ }
+
+ public synchronized TestingConcordServer start() throws Exception {
+ checkArgument(db.isRunning(), "The database container is not running");
+
+ var config = prepareConfig(db);
+ var system = new ConcordServerModule(config);
+ var allModules = Stream.concat(extraModules.stream().map(f -> f.apply(config)), Stream.of(system)).toList();
+ server = ConcordServer.withModules(allModules)
+ .start();
+
+ return this;
+ }
+
+ public synchronized void stop() throws Exception {
+ if (server != null) {
+ server.stop();
+ server = null;
+ }
+ }
+
+ @Override
+ public void close() throws Exception {
+ this.stop();
+ }
+
+ public int getApiPort() {
+ return apiPort;
+ }
+
+ public String getApiBaseUrl() {
+ return "http://localhost:" + apiPort;
+ }
+
+ public ConcordServer getServer() {
+ return server;
+ }
+
+ public PostgreSQLContainer> getDb() {
+ return db;
+ }
+
+ public String getAdminApiKey() {
+ return adminApiKey;
+ }
+
+ public String getAgentApiKey() {
+ return agentApiKey;
+ }
+
+ private Config prepareConfig(PostgreSQLContainer> db) {
+ var extraConfig = ConfigFactory.parseMap(this.extraConfiguration);
+
+ var testConfig = ConfigFactory.parseMap(ImmutableMap.builder()
+ .put("server.port", String.valueOf(apiPort))
+ .put("db.url", db.getJdbcUrl())
+ .put("db.appUsername", db.getUsername())
+ .put("db.appPassword", db.getPassword())
+ .put("db.inventoryUsername", db.getUsername())
+ .put("db.inventoryPassword", db.getPassword())
+ .put("db.changeLogParameters.defaultAdminToken", adminApiKey)
+ .put("db.changeLogParameters.defaultAgentToken", agentApiKey)
+ .put("secretStore.serverPassword", randomString(64))
+ .put("secretStore.secretStoreSalt", randomString(64))
+ .put("secretStore.projectSecretSalt", randomString(64))
+ .build());
+
+ var defaultConfig = ConfigFactory.load("concord-server.conf", ConfigParseOptions.defaults(), ConfigResolveOptions.defaults().setAllowUnresolved(true))
+ .getConfig("concord-server");
+
+ return extraConfig.withFallback(testConfig.withFallback(defaultConfig)).resolve();
+ }
+
+ private static String randomString(int minLength) {
+ byte[] ab = new byte[minLength];
+ new SecureRandom().nextBytes(ab);
+ return Base64.getEncoder().encodeToString(ab);
+ }
+
+ /**
+ * Just an example.
+ */
+ public static void main(String[] args) throws Exception {
+ try (var db = new PostgreSQLContainer<>("postgres:15-alpine");
+ var server = new TestingConcordServer(db, 8001, Map.of("process.watchdogPeriod", "10 seconds"), List.of())) {
+ db.start();
+ server.start();
+ System.out.printf("""
+ ==============================================================
+
+ UI: http://localhost:8001/
+ DB:
+ JDBC URL: %s
+ username: %s
+ password: %s
+
+ admin API key: %s
+ agent API key: %s
+ %n""", db.getJdbcUrl(),
+ db.getUsername(),
+ db.getPassword(),
+ server.getAdminApiKey(),
+ server.getAgentApiKey());
+
+ Thread.currentThread().join();
+ }
+ }
+}
+
diff --git a/it/testing-server/src/test/java/com/walmartlabs/concord/it/testingserver/TestingConcordIT.java b/it/testing-server/src/test/java/com/walmartlabs/concord/it/testingserver/TestingConcordIT.java
new file mode 100644
index 0000000000..0e93548756
--- /dev/null
+++ b/it/testing-server/src/test/java/com/walmartlabs/concord/it/testingserver/TestingConcordIT.java
@@ -0,0 +1,109 @@
+package com.walmartlabs.concord.it.testingserver;
+
+/*-
+ * *****
+ * Concord
+ * -----
+ * Copyright (C) 2017 - 2023 Walmart 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.
+ * =====
+ */
+
+import com.walmartlabs.concord.client2.ApiClientConfiguration;
+import com.walmartlabs.concord.client2.DefaultApiClientFactory;
+import com.walmartlabs.concord.client2.ProcessApi;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.testcontainers.containers.PostgreSQLContainer;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+
+import static com.walmartlabs.concord.client2.ProcessEntry.StatusEnum.FINISHED;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/**
+ * A test that tests TestingConcordServer and TestingConcordAgent can run together in the same JVM.
+ */
+public class TestingConcordIT {
+
+ private PostgreSQLContainer> db;
+ private TestingConcordServer concordServer;
+ private TestingConcordAgent concordAgent;
+
+ @Before
+ public void setUp() throws Exception {
+ db = new PostgreSQLContainer<>("postgres:15-alpine");
+ db.start();
+
+ int apiPort = getFreePort();
+ concordServer = new TestingConcordServer(db, apiPort, Map.of(), List.of());
+ concordServer.start();
+
+ concordAgent = new TestingConcordAgent(concordServer);
+ concordAgent.start();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (concordAgent != null) {
+ concordAgent.close();
+ concordAgent = null;
+ }
+
+ if (concordServer != null) {
+ concordServer.close();
+ concordServer = null;
+ }
+
+ if (db != null) {
+ db.close();
+ db = null;
+ }
+ }
+
+ @Test(timeout = 120_000)
+ public void testRunningSimpleProcess() throws Exception {
+ var client = new DefaultApiClientFactory(concordServer.getApiBaseUrl())
+ .create(ApiClientConfiguration.builder()
+ .apiKey(concordServer.getAdminApiKey())
+ .build());
+
+ var processApi = new ProcessApi(client);
+ var response = processApi.startProcess(Map.of("concord.yml", """
+ configuration:
+ runtime: "concord-v2"
+ flows:
+ default:
+ - log: "Hello!"
+ """.getBytes()));
+ assertNotNull(response.getInstanceId());
+
+ var process = processApi.waitForCompletion(response.getInstanceId(), Duration.ofSeconds(60).toMillis());
+ assertEquals(FINISHED, process.getStatus());
+ }
+
+ private static int getFreePort() {
+ try (var socket = new ServerSocket(0)) {
+ return socket.getLocalPort();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/k8s/agent-operator/Dockerfile b/k8s/agent-operator/Dockerfile
index 74095896ea..9eb567520b 100644
--- a/k8s/agent-operator/Dockerfile
+++ b/k8s/agent-operator/Dockerfile
@@ -1,4 +1,4 @@
-ARG from_image=gcr.io/distroless/java:8
+ARG from_image=gcr.io/distroless/java17
FROM $from_image
COPY target/operator.jar /operator.jar
diff --git a/k8s/agent-operator/pom.xml b/k8s/agent-operator/pom.xml
index e03fd15f5e..a6a02dff01 100644
--- a/k8s/agent-operator/pom.xml
+++ b/k8s/agent-operator/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 9babe8bef3..470e3f87e1 100644
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/plugins/tasks/ansible/pom.xml b/plugins/tasks/ansible/pom.xml
index 23c59fa270..f44699cdf4 100644
--- a/plugins/tasks/ansible/pom.xml
+++ b/plugins/tasks/ansible/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/callback/concord_protectdata.py b/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/callback/concord_protectdata.py
index f68131acf9..1cf3787c60 100644
--- a/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/callback/concord_protectdata.py
+++ b/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/callback/concord_protectdata.py
@@ -2,7 +2,7 @@
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
-import collections
+from collections.abc import Mapping
def enc(s):
# we shouldn't use `str` as the input string can contain non-ascii characters
@@ -23,27 +23,35 @@ class CallbackModule(CallbackModule_default):
def __init__(self):
super(CallbackModule, self).__init__()
+
self.secret_list = ['password', 'credentials', 'secret', 'ansible_password', 'vaultpassword']
print("Log filter is enabled...")
-
+
+ def set_options(self, task_keys=None, var_options=None, direct=None):
+ super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct)
+
+ self.set_option('display_ok_hosts', True)
+ self.set_option('show_per_host_start', False)
+
def hide_password(self, result):
ret = {}
for key, value in result.items():
- if isinstance(value, collections.Mapping):
+ if isinstance(value, Mapping):
ret[key] = self.hide_password(value)
elif any (x in enc(value).lower() for x in self.secret_list) or any (y in enc(key).lower() for y in self.secret_list):
ret[key] = "******"
- else:
+ else:
ret[key] = value
return ret
def v2_playbook_on_task_start(self, task, is_conditional):
print("TASK", "[",task.get_name(),"]" , "*************************************************************************")
- task_args = task._attributes.get('args')
- for k, v in task_args.items():
- if any(s in enc(v).lower() for s in self.secret_list):
- print("*********** THIS TASK CONTAINS SENSITIVE INFORMATION. ENABLING NO_LOG ******************")
- task.no_log = True
-
+ if hasattr(task, 'args'):
+ task_args = getattr(task, 'args', None)
+ for k, v in task_args.items():
+ if any(s in enc(v).lower() for s in self.secret_list):
+ print("*********** THIS TASK CONTAINS SENSITIVE INFORMATION. ENABLING NO_LOG ******************")
+ task.no_log = True
+
def _dump_results(self, result, indent=None, sort_keys=True, keep_invocation=False):
return super(CallbackModule, self)._dump_results(self.hide_password(result), indent, sort_keys, keep_invocation)
diff --git a/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/lib/task_policy.py b/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/lib/task_policy.py
index 863ae7f254..3bd957898e 100644
--- a/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/lib/task_policy.py
+++ b/plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/lib/task_policy.py
@@ -36,7 +36,13 @@ def is_deny(self, task):
ansible_rules = self.policy_rules['ansible']
action = task.action
- args = self._enrich_args(action, task._attributes.get('args'))
+
+ if not hasattr(task, 'args'):
+ return False
+
+ task_args = getattr(task, 'args', None)
+
+ args = self._enrich_args(action, task_args)
if 'allow' in ansible_rules:
for r in ansible_rules['allow']:
diff --git a/plugins/tasks/concord/pom.xml b/plugins/tasks/concord/pom.xml
index b45109c03a..550db22cbf 100644
--- a/plugins/tasks/concord/pom.xml
+++ b/plugins/tasks/concord/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/crypto/pom.xml b/plugins/tasks/crypto/pom.xml
index d2632dfc03..b044413f22 100644
--- a/plugins/tasks/crypto/pom.xml
+++ b/plugins/tasks/crypto/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/docker/pom.xml b/plugins/tasks/docker/pom.xml
index a93215cb48..7435f2d02e 100644
--- a/plugins/tasks/docker/pom.xml
+++ b/plugins/tasks/docker/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/dynamic-tasks/pom.xml b/plugins/tasks/dynamic-tasks/pom.xml
index 81b99350b6..994d456989 100644
--- a/plugins/tasks/dynamic-tasks/pom.xml
+++ b/plugins/tasks/dynamic-tasks/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/example/pom.xml b/plugins/tasks/example/pom.xml
index 0b14ddaaf2..7bcd2b5a8c 100644
--- a/plugins/tasks/example/pom.xml
+++ b/plugins/tasks/example/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/files/pom.xml b/plugins/tasks/files/pom.xml
index 2c22a6b6d3..3c67d094d3 100644
--- a/plugins/tasks/files/pom.xml
+++ b/plugins/tasks/files/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/http/pom.xml b/plugins/tasks/http/pom.xml
index 675ccad56e..e7bbd95a5f 100644
--- a/plugins/tasks/http/pom.xml
+++ b/plugins/tasks/http/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/kv/pom.xml b/plugins/tasks/kv/pom.xml
index 39005eced9..1d42d040c9 100644
--- a/plugins/tasks/kv/pom.xml
+++ b/plugins/tasks/kv/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/locale/pom.xml b/plugins/tasks/locale/pom.xml
index aff649a2f6..1300860e10 100644
--- a/plugins/tasks/locale/pom.xml
+++ b/plugins/tasks/locale/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/lock/pom.xml b/plugins/tasks/lock/pom.xml
index 1901af9140..3384ab3850 100644
--- a/plugins/tasks/lock/pom.xml
+++ b/plugins/tasks/lock/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/log/pom.xml b/plugins/tasks/log/pom.xml
index 89ab126290..38f87bce0d 100644
--- a/plugins/tasks/log/pom.xml
+++ b/plugins/tasks/log/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/misc/pom.xml b/plugins/tasks/misc/pom.xml
index 4ab16563d2..94d102f021 100644
--- a/plugins/tasks/misc/pom.xml
+++ b/plugins/tasks/misc/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/noderoster/pom.xml b/plugins/tasks/noderoster/pom.xml
index 33107a3a71..d2d04cdc31 100644
--- a/plugins/tasks/noderoster/pom.xml
+++ b/plugins/tasks/noderoster/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/resource/pom.xml b/plugins/tasks/resource/pom.xml
index 442e02b5b2..935389b2ba 100644
--- a/plugins/tasks/resource/pom.xml
+++ b/plugins/tasks/resource/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/slack/pom.xml b/plugins/tasks/slack/pom.xml
index 071c27a3b5..aa7abc7a80 100644
--- a/plugins/tasks/slack/pom.xml
+++ b/plugins/tasks/slack/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/sleep/pom.xml b/plugins/tasks/sleep/pom.xml
index e1bf2fd684..0cfa9b7652 100644
--- a/plugins/tasks/sleep/pom.xml
+++ b/plugins/tasks/sleep/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/smtp/pom.xml b/plugins/tasks/smtp/pom.xml
index ca5bd1131d..827e74e4fb 100644
--- a/plugins/tasks/smtp/pom.xml
+++ b/plugins/tasks/smtp/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/throw/pom.xml b/plugins/tasks/throw/pom.xml
index 907db95b47..bcca2f35ec 100644
--- a/plugins/tasks/throw/pom.xml
+++ b/plugins/tasks/throw/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/tasks/variables/pom.xml b/plugins/tasks/variables/pom.xml
index a585ca4673..9e0495d862 100644
--- a/plugins/tasks/variables/pom.xml
+++ b/plugins/tasks/variables/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/plugins/templates/ansible/pom.xml b/plugins/templates/ansible/pom.xml
index 2205dc28fb..84c9257285 100644
--- a/plugins/templates/ansible/pom.xml
+++ b/plugins/templates/ansible/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord.plugins.basic
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/policy-engine/pom.xml b/policy-engine/pom.xml
index acfae4c163..c03b3eec84 100644
--- a/policy-engine/pom.xml
+++ b/policy-engine/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/pom.xml b/pom.xml
index e37a78b86d..f4e0b21669 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
pom
${project.groupId}:${project.artifactId}
@@ -60,8 +60,9 @@
- 1.8
- 1.8
+ 17
+ ${maven.compiler.release
+ ${maven.compiler.release}
UTF-8
UTF-8
@@ -73,7 +74,6 @@
5.8.2
3.5.1
- 3.1.2
16.13.1
1.12.0
@@ -107,10 +107,6 @@
maven-compiler-plugin
3.11.0
-
- ${maven.compiler.source}
- ${maven.compiler.target}
-
@@ -147,10 +143,9 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.1.1
+ 3.2.1
checkstyle.xml
- UTF-8
true
true
false
@@ -296,6 +291,9 @@
+
+ true
+
org.apache.maven.plugins
@@ -414,24 +412,12 @@
org.apache.maven.plugins
maven-dependency-plugin
- ${maven.dependency.plugin.version}
+ 3.1.2
org.apache.maven.plugins
maven-javadoc-plugin
3.2.0
-
-
- attach-javadocs
-
- jar
-
-
-
-
- true
- none
-
@@ -467,6 +453,37 @@
false
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+ true
+ none
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+ false
+
+
diff --git a/repository/pom.xml b/repository/pom.xml
index 70939ee58a..e4d0b7c4de 100644
--- a/repository/pom.xml
+++ b/repository/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/runtime/common/pom.xml b/runtime/common/pom.xml
index ea7f3e8754..1b17daceb2 100644
--- a/runtime/common/pom.xml
+++ b/runtime/common/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/runtime/loader/pom.xml b/runtime/loader/pom.xml
index b96696874c..724c7a5b02 100644
--- a/runtime/loader/pom.xml
+++ b/runtime/loader/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/runtime/v1/impl/pom.xml b/runtime/v1/impl/pom.xml
index 0384f0ed4f..8e2fb71505 100644
--- a/runtime/v1/impl/pom.xml
+++ b/runtime/v1/impl/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.runtime.v1
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/runtime/v1/pom.xml b/runtime/v1/pom.xml
index 29fe557fc9..f232638480 100644
--- a/runtime/v1/pom.xml
+++ b/runtime/v1/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/runtime/v1/project-model/pom.xml b/runtime/v1/project-model/pom.xml
index f066f72d90..bc6cd147e4 100644
--- a/runtime/v1/project-model/pom.xml
+++ b/runtime/v1/project-model/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.runtime.v1
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/runtime/v2/model/pom.xml b/runtime/v2/model/pom.xml
index 038153c8d0..0363203796 100644
--- a/runtime/v2/model/pom.xml
+++ b/runtime/v2/model/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.runtime.v2
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/runtime/v2/pom.xml b/runtime/v2/pom.xml
index ebb7fbcb82..1f6a5816c9 100644
--- a/runtime/v2/pom.xml
+++ b/runtime/v2/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../../pom.xml
diff --git a/runtime/v2/runner/pom.xml b/runtime/v2/runner/pom.xml
index b7c2586c18..ede9d4b001 100644
--- a/runtime/v2/runner/pom.xml
+++ b/runtime/v2/runner/pom.xml
@@ -6,7 +6,7 @@
com.walmartlabs.concord.runtime.v2
parent
- 2.1.1-SNAPSHOT
+ 2.5.1-SNAPSHOT
../pom.xml
diff --git a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/DefaultSynchronizationService.java b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/DefaultSynchronizationService.java
index e327d93c11..2c1d8950fd 100644
--- a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/DefaultSynchronizationService.java
+++ b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/DefaultSynchronizationService.java
@@ -29,6 +29,8 @@ public class DefaultSynchronizationService implements SynchronizationService {
private final List callbacks = new ArrayList<>();
+ private boolean stop;
+
@Override
public boolean hasPoint() {
synchronized (this) {
@@ -43,6 +45,7 @@ public void maintain() {
}
callbacks.clear();
+ stop = false;
}
@Override
@@ -51,4 +54,14 @@ public void point(Runnable callback) {
callbacks.add(callback);
}
}
+
+ @Override
+ public void stop() {
+ this.stop = true;
+ }
+
+ @Override
+ public boolean hasStop() {
+ return stop;
+ }
}
diff --git a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationService.java b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationService.java
index 5975964abf..fea6b9149e 100644
--- a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationService.java
+++ b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationService.java
@@ -27,4 +27,8 @@ public interface SynchronizationService {
void maintain();
void point(Runnable callback);
+
+ void stop();
+
+ boolean hasStop();
}
diff --git a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationServiceListener.java b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationServiceListener.java
index 87559c366d..c8f551abaf 100644
--- a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationServiceListener.java
+++ b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/SynchronizationServiceListener.java
@@ -23,6 +23,8 @@
import com.walmartlabs.concord.svm.Runtime;
import com.walmartlabs.concord.svm.*;
+import java.util.Map;
+
public class SynchronizationServiceListener implements ExecutionListener {
private final SynchronizationService delegate;
@@ -33,7 +35,7 @@ public SynchronizationServiceListener(SynchronizationService delegate) {
@Override
public Result afterCommand(Runtime runtime, VM vm, State state, ThreadId threadId, Command cmd) {
- if (delegate.hasPoint()) {
+ if (delegate.hasPoint() || delegate.hasStop()) {
state.setStatus(threadId, ThreadStatus.SUSPENDED);
return Result.BREAK;
}
@@ -43,6 +45,13 @@ public Result afterCommand(Runtime runtime, VM vm, State state, ThreadId threadI
@Override
public Result afterEval(Runtime runtime, VM vm, State state) {
+ if (delegate.hasStop()) {
+ for (Map.Entry e : state.threadStatus().entrySet()) {
+ state.setStatus(e.getKey(), ThreadStatus.DONE);
+ }
+ return Result.BREAK;
+ }
+
if (!delegate.hasPoint()) {
return Result.BREAK;
}
diff --git a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/tasks/TaskCallInterceptor.java b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/tasks/TaskCallInterceptor.java
index 774dc4948a..1bedb43928 100644
--- a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/tasks/TaskCallInterceptor.java
+++ b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/tasks/TaskCallInterceptor.java
@@ -124,7 +124,7 @@ default List> annotations() {
static Method of(Object base, String methodName, List