Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,17 @@ public String[] build() {

l.add("-Dconcord.exposeDockerDaemon=" + exposeDockerDaemon);

// disable warnings for unoptimized js compiler (EnableJVMCI jvm opt is still experimental)
// https://www.graalvm.org/latest/reference-manual/embed-languages/#enable-optimization-on-openjdk-and-oracle-jdk
l.add("-Dpolyglot.engine.WarnInterpreterOnly=false");

// Java 9+ requires additional add-opens for compatibility
if (majorJavaVersion >= 9) {
l.add("--add-opens");
l.add("java.base/java.lang=ALL-UNNAMED");
l.add("--add-opens");
l.add("java.base/java.util=ALL-UNNAMED");
l.add("--enable-native-access=ALL-UNNAMED");
}

// classpath
Expand Down
2 changes: 2 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@
<manifestEntries>
<Main-Class>${main.class}</Main-Class>
<Add-Opens>java.base/java.lang java.base/java.util</Add-Opens>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
Expand Down
4 changes: 0 additions & 4 deletions github-app-installation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-common</artifactId>
</dependency>
<dependency>
<groupId>io.takari.bpm</groupId>
<artifactId>bpm-engine-impl</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions it/runtime-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@
</exclusions>
</dependency>

<!-- for evaluating custom form data.js -->
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<scope>test</scope>
</dependency>

<!-- Node Roster stuff -->
<dependency>
<groupId>com.walmartlabs.concord.server.plugins.noderoster</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private static void startCustomFormSession(ConcordRule concord, UUID instanceId,
http.disconnect();
}

@SuppressWarnings({"unchecked", "UnstableApiUsage"})
@SuppressWarnings({"unchecked"})
private static Map<String, Object> getDataJs(ConcordRule concord, UUID instanceId, String formName) throws Exception {
URL url = new URL(concord.apiBaseUrl() + "/forms/" + instanceId + "/" + formName + "/form/data.js");
HttpURLConnection http = (HttpURLConnection) url.openConnection();
Expand All @@ -282,7 +282,7 @@ private static Map<String, Object> getDataJs(ConcordRule concord, UUID instanceI
String str = CharStreams.toString(new InputStreamReader(is, StandardCharsets.UTF_8));
ScriptEngine se = new ScriptEngineManager().getEngineByName("js");
Object result = se.eval(str);
assertTrue(result instanceof Map);
assertInstanceOf(Map.class, result);
return (Map<String, Object>) result;
} finally {
http.disconnect();
Expand Down
14 changes: 13 additions & 1 deletion runtime/v1/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@
<groupId>io.takari.bpm</groupId>
<artifactId>bpm-engine-impl</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand Down Expand Up @@ -222,7 +231,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -242,7 +250,11 @@
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.walmartlabs.concord.runner.Main</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
Expand Down
6 changes: 6 additions & 0 deletions runtime/v1/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@
<artifactId>bpm-engine-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
12 changes: 10 additions & 2 deletions runtime/v2/runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,13 @@
</dependency>

<dependency>
<groupId>org.graalvm.js</groupId>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
Expand Down Expand Up @@ -273,7 +278,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -293,7 +297,11 @@
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.walmartlabs.concord.runtime.v2.runner.Main</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
public class DefaultScriptEvaluator implements ScriptEvaluator {

// https://www.graalvm.org/latest/reference-manual/js/JavaScriptCompatibility/#ecmascript-language-compliance
static Integer[] GRAAL_ES_VERSIONS = new Integer[]{
static final Integer[] GRAAL_ES_VERSIONS = new Integer[]{
3,
5,
6,
Expand All @@ -55,8 +55,13 @@ public class DefaultScriptEvaluator implements ScriptEvaluator {
2020,
2021,
2022,
2024
};

private static final String DEFAULT_ES_VERSION = "6";

private static final String CTX_OPT_JS_ES_VERSION = "js.ecmascript-version";


private static final Logger log = LoggerFactory.getLogger(DefaultScriptEvaluator.class);

Expand Down Expand Up @@ -133,6 +138,9 @@ private org.graalvm.polyglot.Context.Builder getGraalEngineContextBuilder(Map<St
.targetTypeMapping(Value.class, Object.class, Value::hasArrayElements, v -> new LinkedList<>(v.as(List.class))).build();
org.graalvm.polyglot.Context.Builder ctx = org.graalvm.polyglot.Context.newBuilder("js")
.allowHostAccess(access);

ctx.option(CTX_OPT_JS_ES_VERSION, DEFAULT_ES_VERSION);

for (Map.Entry<String, Object> entry : variables.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
Expand All @@ -143,7 +151,7 @@ private org.graalvm.polyglot.Context.Builder getGraalEngineContextBuilder(Map<St
if (esVersion.isEmpty()) {
throw new UserDefinedException("unsupported esVersion: " + value.toString());
}
ctx.option("js.ecmascript-version", esVersion.get().toString());
ctx.option(CTX_OPT_JS_ES_VERSION, esVersion.get().toString());
}
}
return ctx;
Expand Down
8 changes: 8 additions & 0 deletions server/dist/src/assembly/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ if (( $JAVA_VERSION > 8 )); then
JDK_SPECIFIC_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED"
fi

if (( $JAVA_VERSION > 24 )); then
echo "Applying JDK 25+ specific options..."
# added to suppress warnings for graalvm on jdk25
# https://www.graalvm.org/release-notes/JDK_24/#polyglot-runtime
JDK_SPECIFIC_OPTS="${JDK_SPECIFIC_OPTS} --enable-native-access=ALL-UNNAMED"
fi

if [[ -z "${EXTRA_CLASSPATH}" ]]; then
EXTRA_CLASSPATH=""
fi
Expand All @@ -52,6 +59,7 @@ ${JDK_SPECIFIC_OPTS} \
-Dfile.encoding=UTF-8 \
-Djava.net.preferIPv4Stack=true \
-Djava.security.egd=file:/dev/./urandom \
-Dpolyglot.engine.WarnInterpreterOnly=false \
-Dconcord.conf=${CONCORD_CFG_FILE} \
-cp "${BASE_DIR}/lib/*:${BASE_DIR}/ext/*:${BASE_DIR}/classes:${EXTRA_CLASSPATH}" \
"${MAIN_CLASS}"
7 changes: 6 additions & 1 deletion server/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,13 @@
<artifactId>graal-sdk</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
Expand Down
22 changes: 17 additions & 5 deletions targetplatform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<cronutils.version>9.2.0</cronutils.version>
<errorproneannotations.version>2.28.0</errorproneannotations.version>
<glassfish.el.version>3.0.1-b12</glassfish.el.version>
<graalvm.version>22.0.0.2</graalvm.version>
<graalvm.version>25.0.2</graalvm.version>
<greenmail.version>1.6.5</greenmail.version>
<groovy.version>5.0.4</groovy.version>
<guava.version>33.3.1-jre</guava.version>
Expand Down Expand Up @@ -581,15 +581,21 @@
<artifactId>guice-servlet</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
<dependency> <!-- for backwards compat with bpm-engine-impl -->
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<artifactId>js-scriptengine</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<version>${graalvm.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
Expand Down Expand Up @@ -630,6 +636,12 @@
<groupId>io.takari.bpm</groupId>
<artifactId>bpm-engine-impl</artifactId>
<version>${bpm.version}</version>
<exclusions>
<exclusion>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.takari.bpm</groupId>
Expand Down