Skip to content

Commit

Permalink
Merge branch 'develop' into proj-m20-to-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgunter authored Oct 27, 2023
2 parents 82d5416 + 41718fb commit 5550187
Show file tree
Hide file tree
Showing 429 changed files with 303,687 additions and 7,087 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `advanced-test` job is fundamentally the same for the build of CWS, except 2

The `publish-cws-image` job is the CD component of the workflow, triggered upon a commit with a tag and dependant upon successful completion of the `build-and-test-cws` and `advanced-test` jobs.

> **Note**
> **Warning**
> The current GitHub runner configuration used for the build and test of CWS, as well as the advanced test, supports up to 1 console and 2 workers.
> More than 2 workers may result in test failures due to the stress on the runner.
Expand All @@ -25,10 +25,10 @@ The `publish-cws-image` job is the CD component of the workflow, triggered upon
- Image: mariadb:10.3
- Ports: 3306:3306
- [**checkout**](https://github.com/marketplace/actions/checkout): This action checks out the repository under `$GITHUB_WORKSPACE`, so the workflow can access it.
- Set up JDK 8:
- Set up JDK 11:
- [**setup-java**](https://github.com/marketplace/actions/setup-java-jdk): This action downloads and sets up a requested version of Java
- Current configuration:
- Java-version: 8
- Java-version: 11
- Distribution: Temurin
- Cache: Maven
- **Create open-source certs**:
Expand All @@ -37,7 +37,7 @@ The `publish-cws-image` job is the CD component of the workflow, triggered upon
- **Download Logstash**:
- [**download-file-action**](https://github.com/marketplace/actions/download-file-to-workspace): This action downloads a file from the internet into the workspace
- Downloads Logstash using a URL
- Renames the file as `logstash-7.16.2.zip`
- Renames the file as `logstash-8.8.0.zip`
- Stores Logstash in appropriate directory
- **Check for Logstash**:
- List files in the directory where Logstash is expected
Expand Down Expand Up @@ -87,7 +87,7 @@ The `publish-cws-image` job is the CD component of the workflow, triggered upon
- **Check out the repo**:
- Utilizes the same `checkout` action to check out the repository again
- This is done in a new GitHub runner
- **Set up JDK 8**
- **Set up JDK 11**
- Utilizes the same `setup-java` action to set up Java
- **Log in to Docker Hub**:
- [**Docker Login**](https://github.com/marketplace/actions/docker-login): This action is used to log in against a Docker registry
Expand All @@ -107,7 +107,7 @@ The `build-and-test-cws` job performs all the necessary preliminary steps requir

The following are key differences in the steps of the `build-and-test-cws` job between the `CWS CI Camunda` and `CWS CI LDAP` workflows.

> **Note**
> **Warning**
> The current GitHub runner configuration used for the build and test of CWS supports up to 1 console and 2 workers.
> More than 2 workers may result in test failures due to the stress on the runner.
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/camunda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven

Expand All @@ -49,8 +49,8 @@ jobs:
- name: Download Logstash
uses: carlosperate/download-file-action@v1
with:
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-oss-7.16.2-windows-x86_64.zip
file-name: logstash-7.16.2.zip
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.8.0-windows-x86_64.zip
file-name: logstash-8.8.0.zip
location: install/logging/

- name: Check for Logstash
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Show CWS Log
run: |
cd dist/console-only/cws/server/apache-tomcat-9.0.33/logs
cd dist/console-only/cws/server/apache-tomcat-9.0.72/logs
ls -al
- name: Set up Google Chrome
Expand Down Expand Up @@ -156,10 +156,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven

Expand All @@ -172,8 +172,8 @@ jobs:
- name: Download Logstash
uses: carlosperate/download-file-action@v1
with:
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-oss-7.16.2-windows-x86_64.zip
file-name: logstash-7.16.2.zip
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.8.0-windows-x86_64.zip
file-name: logstash-8.8.0.zip
location: install/logging/

- name: Check for Logstash
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:

- name: Show CWS Log
run: |
cd dist/console-only/cws/server/apache-tomcat-9.0.33/logs
cd dist/console-only/cws/server/apache-tomcat-9.0.72/logs
ls -al
- name: Set up Google Chrome
Expand Down Expand Up @@ -257,10 +257,10 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: maven

Expand All @@ -49,8 +49,8 @@ jobs:
- name: Download Logstash
uses: carlosperate/download-file-action@v1
with:
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-oss-7.16.2-windows-x86_64.zip
file-name: logstash-7.16.2.zip
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.8.0-windows-x86_64.zip
file-name: logstash-8.8.0.zip
location: install/logging/

- name: Check for Logstash
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:

- name: Show CWS Log
run: |
cd dist/console-only/cws/server/apache-tomcat-9.0.33/logs
cd dist/console-only/cws/server/apache-tomcat-9.0.72/logs
ls -al
- name: Set up Google Chrome
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,27 @@ See the [wiki](https://github.com/NASA-AMMOS/common-workflow-service/wiki) for m
- Verify installation using: `mvn -v`
- [**Docker**](https://docs.docker.com/get-docker/): Used to run external Elasticsearch, and create and configure mariaDB database container
- Recommended minimum system requirements from Docker Resources window:
- CPUs: 4
- Memory: 5.00 GB
- CPUs: 5
- Memory: 14.00 GB
- Swap: 1 GB
- Disk image size: 59.6 GB
- Disk image size: 64 GB
- MariaDB or MySQL database set up on either your local machine or a remote host. You will also need to create the following:
- A database for CWS to use. `cws_dev` is a good default name.
- A database user with full access to the above database.
- [**ITerm2**](https://iterm2.com/): Currently these build scripts include commands to open new terminal windows using ITerm2, so they are best run from that terminal.
- **Logstash 7.16.2+**: Download Logstash (OSS version) for the Windows platform. Rename the ZIP file from 'logstash-oss-7.16.2-windows-x86_64.zip' to 'logstash-7.16.2.zip' and place in `install/logging/`. This is a temporary workaround while we clean up our installation process. You can find the zip download [here](https://www.elastic.co/downloads/past-releases/logstash-oss-7-16-2).
- **Elasticsearch 7.16.2+**: CWS requires an externally-configured elasticsearch cluster to be set up. You can use an SSL Secure Elasticsearch with or without authentication, or an Insecure HTTP Elasticsearch.
- **Logstash 8.8.0+**: Download Logstash for your platform. Uncompress it (only if it is a .tar.gz) and then ZIP back it up with the filename 'logstash-8.8.0.zip' and place in `install/logging/`. This is a temporary workaround while we clean up our installation process. You can find the zip download [here](https://www.elastic.co/downloads/logstash).
- **Elasticsearch 8.8.0+**: CWS requires an externally-configured elasticsearch cluster to be set up. You can use an SSL Secure Elasticsearch with or without authentication, or an Insecure HTTP Elasticsearch.
- The "Elasticsearch Setup" instruction below provides a contained Dockerized way of running Elasticsearch. This serves as an alternative to installing Elasticsearch.
- Tomcat **keystore and truststore files** (needed for CWS web console to work properly):
- You will need to add your own Tomcat keystore file to this path: `install/.keystore`
- You will need to add your own truststore file to this path: `install/tomcat_lib/cws_truststore.jks`
- See: https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html
- **Java 8 SE JDK**: JDK 9+ deprecated, and JDK 11+ removed, dependencies used by CWS.
- **Java 11 JDK**: CWS only runs on JDK 11 now, but planning for JDK 17 soon.
- For Homebrew users:
- Install OpenJDK 8 using: `brew install openjdk@8`.`/usr/local/opt/openjdk@8`
- Point Maven to this JDK: `export JAVA_HOME=/usr/local/opt/openjdk@8`
- (Optional) Add this to your path: `export PATH="/usr/local/opt/openjdk@8/bin:$PATH"`
- Install OpenJDK 11 using: `brew install openjdk@11`
- Check the exact version installed using `/usr/libexec/java_home -V`
- Add to your Shell startup (e.g. .zprofile): `export JAVA_HOME=$(/usr/libexec/java_home -v X.X.X)`
- Replace the X.X.X version above with the OpenJDK 11 output from the `/usr/libexec/java_home -V` command.


### **Development Environment Configuration**
Expand Down
1 change: 1 addition & 0 deletions create_server_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ mkdir -p ${CWS}/{bpmn,config/templates,installer,logs,upgrade,sql/cws}

print 'Unzipping Camunda into distribution...'
unzip ${INSTALL_DIR}/cws_camunda-bpm-tomcat-${CAMUNDA_VER}.zip -x start-camunda.bat start-camunda.sh -d ${CWS} > ${CWS}/logs/camunda_extract.log 2>&1
unzip ${INSTALL_DIR}/cws_camunda-bpm-tomcat-${CAMUNDA_VER}-lib.zip -d ${CWS}/lib > ${CWS}/logs/camunda_extract.log 2>&1

if [[ $? -gt 0 ]]; then
print "ERROR: failed to unzip Camunda distribution, check ${CWS}/logs/camunda_extract.log for details."
Expand Down
11 changes: 7 additions & 4 deletions cws-adaptation-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.4.0</version><!-- update this each CWS release -->
<version>2.5.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-adaptation-engine</artifactId>

Expand All @@ -26,7 +26,7 @@
</dependency>

<dependency>
<groupId>org.camunda.bpm.assert</groupId>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
Expand All @@ -49,6 +49,10 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
Expand Down Expand Up @@ -151,8 +155,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>
</plugins>
Expand Down
5 changes: 2 additions & 3 deletions cws-adaptation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.4.0</version><!-- update this each CWS release -->
<version>2.5.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-adaptation</artifactId>

Expand Down Expand Up @@ -51,8 +51,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions cws-certs/generate-certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# the following bash script creates open-source certs required to access CWS

# create private key and self-signed certificate within a keystore
keytool -genkey -keyalg RSA -dname "cn=cws, ou=cws, o=cws, l=cws, s=FL, c=US" -alias cws -keypass changeit -keystore .keystore -storepass changeit -validity 360 -keysize 2048
keytool -genkey -keyalg RSA -dname "cn=cws, ou=cws, o=cws, l=cws, s=FL, c=US" -alias cws -keypass changeit -keystore .keystore -storepass changeit -storetype JKS -validity 360 -keysize 2048

# extract self-signed certificate from keystore
keytool -export -alias cws -file cws.crt -keystore .keystore -storepass changeit

# insert self-signed certificate into truststore
keytool -import -alias cws -file cws.crt -keypass changeit -noprompt -keystore cws_truststore.jks -storepass changeit
keytool -import -alias cws -file cws.crt -keypass changeit -noprompt -keystore cws_truststore.jks -storepass changeit -storetype JKS

# place open-source certs in appropriate directories
cp .keystore ../install
Expand Down
11 changes: 7 additions & 4 deletions cws-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>common-workflow-service</artifactId>
<version>2.4.0</version><!-- update this each CWS release -->
<version>2.5.0</version><!-- update this each CWS release -->
</parent>
<artifactId>cws-core</artifactId>

Expand Down Expand Up @@ -100,7 +100,7 @@
</dependency>

<dependency>
<groupId>org.camunda.bpm.assert</groupId>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -141,6 +141,10 @@
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
Expand All @@ -165,8 +169,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
Expand Down
32 changes: 17 additions & 15 deletions cws-core/src/main/java/jpl/cws/core/code/CodeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;

import javax.tools.Diagnostic;
import javax.tools.DiagnosticCollector;
Expand Down Expand Up @@ -60,19 +58,23 @@ public void afterPropertiesSet() throws Exception {
// Construct the set of URLs
File outputDir = new File(TEMP_DIR_PATH);

URLClassLoader cl = ((URLClassLoader) (Thread.currentThread().getContextClassLoader()));
URLClassLoader parent = cl;
ClassLoader cl = Thread.currentThread().getContextClassLoader();
ClassLoader parent = cl;

while (parent != null) {
for (URL url : parent.getURLs()) {
urls.add(url);
log.trace("CC ["+parent+"] URL: " + url);
if (parent.getClass().getName().equals("java.net.URLClassLoader")) {
try {
Method getURLsMethod = parent.getClass().getMethod("getURLs");
URL[] urlsArray = (URL[]) getURLsMethod.invoke(parent);
for (URL url : urlsArray) {
urls.add(url);
log.trace("CC ["+parent+"] URL: " + url);
}
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
log.error("Error accessing getURLs() method on classloader: " + parent, e);
}
}
parent = (URLClassLoader) parent.getParent(); // traverse up chain..
}

if (cl != null) {
cl.close();
parent = parent.getParent(); // traverse up the chain
}

urls.add(outputDir.toURI().toURL());
Expand Down Expand Up @@ -329,5 +331,5 @@ public void persistInProgressCode(String code) {
public String getTempDirPath() {
return TEMP_DIR_PATH;
}

}
Loading

0 comments on commit 5550187

Please sign in to comment.