Skip to content

Commit

Permalink
this branch is from main. with updated actions (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: James Wood <[email protected]>
Co-authored-by: James Wood <[email protected]>
  • Loading branch information
3 people authored Sep 14, 2024
1 parent ac88d72 commit b17d422
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 49 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/camunda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
WORKERS: 1

services:
mdb103:
mdb106:
image: mariadb:10.6
ports:
- 3306:3306
env:
MYSQL_DATABASE: cws_dev
MYSQL_ROOT_PASSWORD: adminpw
options: >-
--name mdb103
--name mdb106
steps:
- uses: actions/checkout@v4
Expand All @@ -38,7 +38,14 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Create open-source certs
run: |
Expand All @@ -54,11 +61,8 @@ jobs:
chmod 600 ~/.cws/creds
- name: Download Logstash
uses: carlosperate/download-file-action@v2
with:
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip
file-name: logstash-8.12.0.zip
location: install/logging/
run: |
curl -o install/logging/logstash-8.12.0.zip https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip
- name: Check for Logstash
run: |
Expand Down Expand Up @@ -90,8 +94,8 @@ jobs:
- name: Set up Google Chrome
run: |
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
sudo apt update
sudo apt install -y google-chrome-stable
- name: Display Google Chrome version
run: google-chrome --version
Expand Down Expand Up @@ -150,15 +154,15 @@ jobs:
WORKERS: 2

services:
mdb103:
mdb106:
image: mariadb:10.6
ports:
- 3306:3306
env:
MYSQL_DATABASE: cws_dev
MYSQL_ROOT_PASSWORD: adminpw
options: >-
--name mdb103
--name mdb106
steps:
- uses: actions/checkout@v4
Expand All @@ -168,7 +172,14 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Create open-source certs
run: |
Expand All @@ -184,11 +195,8 @@ jobs:
chmod 600 ~/.cws/creds
- name: Download Logstash
uses: carlosperate/download-file-action@v2
with:
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip
file-name: logstash-8.12.0.zip
location: install/logging/
run: |
curl -o install/logging/logstash-8.12.0.zip https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip
- name: Check for Logstash
run: |
Expand Down Expand Up @@ -220,8 +228,8 @@ jobs:
- name: Set up Google Chrome
run: |
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
sudo apt update
sudo apt install -y google-chrome-stable
- name: Display Google Chrome version
run: google-chrome --version
Expand Down Expand Up @@ -271,10 +279,10 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

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

Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/ldap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
WORKERS: 1

services:
mdb103:
mdb106:
image: mariadb:10.6
ports:
- 3306:3306
env:
MYSQL_DATABASE: cws_dev
MYSQL_ROOT_PASSWORD: adminpw
options: >-
--name mdb103
--name mdb106
steps:
- uses: actions/checkout@v4
Expand All @@ -38,7 +38,14 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Create open-source certs
run: |
Expand All @@ -54,11 +61,8 @@ jobs:
chmod 600 ~/.cws/creds
- name: Download Logstash
uses: carlosperate/download-file-action@v2
with:
file-url: https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip
file-name: logstash-8.12.0.zip
location: install/logging/
run: |
curl -o install/logging/logstash-8.12.0.zip https://artifacts.elastic.co/downloads/logstash/logstash-8.12.0-windows-x86_64.zip
- name: Check for Logstash
run: |
Expand Down Expand Up @@ -94,9 +98,9 @@ jobs:
ls -al
- name: Set up Google Chrome
run: |
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
run: |
sudo apt update
sudo apt install -y google-chrome-stable
- name: Display Google Chrome version
run: google-chrome --version
Expand Down
9 changes: 5 additions & 4 deletions install/docker/console-db-es-ls-kibana/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker Setup

### Quickly run common-workflow-service on a single machine with all required services running on the same machine.
### Quickly run common-workflow-service on a single machine with all required services running on the same machine.

#### It will deploy the following services in Docker:
- db (MariaDb)
Expand All @@ -14,10 +14,11 @@
2. Build `common-workflow-service` Docker Image using the `build.sh` script in the cws-image dir
1. Update the version in the `build.sh` script if necessary
3. Update the `config.properties` and `docker-compose.yml` accordingly.
4. Run the command `docker network create cws-network` to create a shared network space for other workers to join
4. Create a creds file on your machine in path `~/.cws/creds` and set the file permission with `chmod 700 ~/.cws/creds`
5. Run the command `docker network create cws-network` to create a shared network space for other workers to join

To run use the command:

docker-compose up

## Adding more workers
Expand All @@ -31,4 +32,4 @@ To run use the command:
3. If you want to add even more workers you'll need to do the following:
1. Copy the `worker-ls` directory to a new location
2. Modify those `config.properites` and `docker-compose.yml` accordingly.
3. Run `docker-compose up` in each new worker directory
3. Run `docker-compose up` in each new worker directory
10 changes: 5 additions & 5 deletions install/docker/console-db-es-ls-kibana/config.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ---------------------------------------------------------------------------
# This is an example properties file that can be used when configuring CWS
# for the first time.
#
#
# To use:
#
# 1) Fill in the correct values where you see [YourXXX] below, for example
# [YourHostname].
# The hard-coded values are suggested to be used, but can be changed if
# desired.
#
#
# 2) Run CWS configuration program with this properties file:
# ./configure.sh config.properties
#
Expand Down Expand Up @@ -50,8 +50,8 @@ database_password=test
# The LDAP username for the user that will be the CWS Administrator.
# This User will have the initial permissions in CWS, and will have the ability
# to add users and modify permissions.
admin_user=cws
admin_user=cwsci

# The first and last name, and email address of the CWS Administrator.
# These fields are only required if using CAMUNDA security
admin_firstname=CWS
Expand Down Expand Up @@ -79,7 +79,7 @@ amq_port=31616
cws_amq_jmx_port=37099
cws_jmx_port=31099
identity_plugin_type=CAMUNDA
cws_ldap_url=ldaps://ldap.localhost:636
cws_ldap_url=ldap://ldapsearch:389
notify_users_email=y
email_subject=[CWS] You have been assigned a task (CWS_TASK_NAME)
email_body=fn:CWS_USER_FIRSTNAME<br/>ln:CWS_USER_LASTNAME,<br/>tn:(CWS_TASK_NAME), em:CWS_USER_EMAIL
Expand Down
23 changes: 21 additions & 2 deletions install/docker/console-db-es-ls-kibana/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ services:
interval: 3s
timeout: 1s
retries: 5
networks:
- external-network
es:
labels:
com.example.service: "es"
Expand All @@ -32,6 +34,8 @@ services:
- cluster.name=docker-cluster
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
networks:
- external-network
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
interval: 5s
Expand Down Expand Up @@ -93,6 +97,7 @@ services:
depends_on:
- db
- es
- ldapsearch
# - logstash
# - kibana
ports:
Expand All @@ -116,6 +121,8 @@ services:
- ./config.properties:/home/cws_user/config.properties:ro
- ~/.cws/creds:/root/.cws/creds:ro
- console-logs-volume:/home/cws_user/cws/server/apache-tomcat-9.0.75/logs
networks:
- external-network
cws-worker:
container_name: cws-worker1
labels:
Expand All @@ -126,6 +133,7 @@ services:
- db
- es
- cws
- ldapsearch
hostname: cws-worker1
environment:
- DB_HOST=db
Expand All @@ -138,11 +146,22 @@ services:
- ./worker-config.properties:/home/cws_user/config.properties:ro
- ~/.cws/creds:/root/.cws/creds:ro
- worker1-logs-volume:/home/cws_user/cws/server/apache-tomcat-9.0.75/logs
networks:
- external-network
ldapsearch:
container_name: ldapsearch_container
image: ghcr.io/nasa-ammos/common-workflow-service/openldap:v2.6
ports:
- 389:389
networks:
- external-network


volumes:
console-logs-volume:
worker1-logs-volume:

networks:
cws-network:
external: true
external-network:
external:
name: cws-network
10 changes: 5 additions & 5 deletions install/docker/console-db-es-ls-kibana/worker-config.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ---------------------------------------------------------------------------
# This is an example properties file that can be used when configuring CWS
# for the first time.
#
#
# To use:
#
# 1) Fill in the correct values where you see [YourXXX] below, for example
# [YourHostname].
# The hard-coded values are suggested to be used, but can be changed if
# desired.
#
#
# 2) Run CWS configuration program with this properties file:
# ./configure.sh config.properties
#
Expand Down Expand Up @@ -50,8 +50,8 @@ database_password=test
# The LDAP username for the user that will be the CWS Administrator.
# This User will have the initial permissions in CWS, and will have the ability
# to add users and modify permissions.
admin_user=cws
admin_user=cwsci

# The first and last name, and email address of the CWS Administrator.
# These fields are only required if using CAMUNDA security
admin_firstname=CWS
Expand All @@ -78,7 +78,7 @@ amq_port=31616

cws_jmx_port=31096
identity_plugin_type=CAMUNDA
cws_ldap_url=ldaps://ldap.localhost:636
cws_ldap_url=ldap://ldapsearch:389
notify_users_email=y
email_subject=[CWS] You have been assigned a task (CWS_TASK_NAME)
email_body=fn:CWS_USER_FIRSTNAME<br/>ln:CWS_USER_LASTNAME,<br/>tn:(CWS_TASK_NAME), em:CWS_USER_EMAIL
Expand Down

0 comments on commit b17d422

Please sign in to comment.