Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge: develop --> main #220

Merged
merged 10 commits into from
Sep 23, 2024
Merged
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
56 changes: 32 additions & 24 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@v1
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 All @@ -68,7 +72,7 @@ jobs:
- name: Set up Elasticsearch
run: |
cd install/docker/es-only
docker-compose up -d
docker compose up -d

- name: Show Docker containers
run: |
Expand All @@ -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@v1
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 All @@ -198,7 +206,7 @@ jobs:
- name: Set up Elasticsearch
run: |
cd install/docker/es-only
docker-compose up -d
docker compose up -d

- name: Show Docker containers
run: |
Expand All @@ -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
30 changes: 17 additions & 13 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 All @@ -68,12 +72,12 @@ jobs:
- name: Set up Elasticsearch
run: |
cd install/docker/es-only
docker-compose up -d
docker compose up -d

- name: Set up CWS LDAP Server
run: |
cd cws-opensource-ldap
docker-compose up -d
docker compose up -d

- name: Show Docker containers
run: |
Expand All @@ -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
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [X.Y.Z](https://github.com/NASA-AMMOS/<repo_name>/releases/tag/X.Y.Z) - 2023-MM-DD

### Added

-
### Added
- IDS-10140
- Configure Elasticsearch Index name with Prefix setting: `elasticsearch_index_prefix`

### Changed
### Deprecated
### Removed
### Fixed
### Security
31 changes: 18 additions & 13 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@ DB_PASS=${8}

ES_PROTOCOL=${9}
ES_HOST=${10}
ES_PORT=${11}
ES_USE_AUTH=${12}
ES_USERNAME=${13}
ES_PASSWORD=${14}
ES_INDEX_PREFIX=${11}
ES_PORT=${12}
ES_USE_AUTH=${13}
ES_USERNAME=${14}
ES_PASSWORD=${15}

CLOUD=${15}
SECURITY=${16}
HOSTNAME=${17}
EMAIL_LIST=${18}
ADMIN_FIRST=${19}
ADMIN_LAST=${20}
ADMIN_EMAIL=${21}
NUM_WORKERS=${22}
WORKER_ABANDONED_DAYS=${23}
CLOUD=${16}
SECURITY=${17}
HOSTNAME=${18}
EMAIL_LIST=${19}
ADMIN_FIRST=${20}
ADMIN_LAST=${21}
ADMIN_EMAIL=${22}
NUM_WORKERS=${23}
WORKER_ABANDONED_DAYS=${24}


source ${ROOT}/../utils.sh
Expand Down Expand Up @@ -105,6 +106,7 @@ project_webapp_root=proj
cws_enable_cloud_autoscaling=n
elasticsearch_protocol=${ES_PROTOCOL}
elasticsearch_host=${ES_HOST}
elasticsearch_index_prefix=${ES_INDEX_PREFIX}
elasticsearch_use_auth=${ES_USE_AUTH}
elasticsearch_port=${ES_PORT}
elasticsearch_username=${ES_USERNAME}
Expand All @@ -115,6 +117,7 @@ default_cws_ldap_url=ldap://localhost:389
cws_ldap_url=ldap://localhost:389
default_elasticsearch_use_auth=n
aws_cloudwatch_endpoint=monitoring.us-west-1.amazonaws.com
default_elasticsearch_index_prefix=cws-index
default_elasticsearch_port=9200
default_aws_cloudwatch_endpoint=monitoring.us-west-1.amazonaws.com
aws_sqs_dispatcher_msgFetchLimit=1
Expand Down Expand Up @@ -167,11 +170,13 @@ 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
elasticsearch_protocol=${ES_PROTOCOL}
elasticsearch_host=${ES_HOST}
elasticsearch_index_prefix=${ES_INDEX_PREFIX}
elasticsearch_use_auth=${ES_USE_AUTH}
elasticsearch_port=${ES_PORT}
elasticsearch_username=${ES_USERNAME}
elasticsearch_password=${ES_PASSWORD}
smtp_hostname=smtp.localhost
default_elasticsearch_index_prefix=cws-index
default_smtp_hostname=smtp.localhost
default_cws_ldap_url=ldap://localhost:389
cws_ldap_url=ldap://localhost:389
Expand Down
3 changes: 2 additions & 1 deletion ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ADMIN_EMAIL="/"

ES_PROTOCOL="HTTP"
ES_HOST="http://localhost"
ES_INDEX_PREFIX="cws-index"
ES_PORT=9200
ES_USE_AUTH=n
ES_USERNAME="na"
Expand All @@ -44,4 +45,4 @@ NUM_WORKERS=${2} # parameter is passed as an env through workflow file
WORKER_ABANDONED_DAYS=1

# Run the ci script
./ci.sh `pwd` ${USER} ${DB_TYPE} ${DB_HOST} ${DB_PORT} ${DB_NAME} ${DB_USER} ${DB_PASS} ${ES_PROTOCOL} ${ES_HOST} ${ES_PORT} ${ES_USE_AUTH} ${ES_USERNAME} ${ES_PASSWORD} ${CLOUD} ${SECURITY} ${HOSTNAME} ${EMAIL_LIST} ${ADMIN_FIRST} ${ADMIN_LAST} ${ADMIN_EMAIL} ${NUM_WORKERS} ${WORKER_ABANDONED_DAYS}
./ci.sh `pwd` ${USER} ${DB_TYPE} ${DB_HOST} ${DB_PORT} ${DB_NAME} ${DB_USER} ${DB_PASS} ${ES_PROTOCOL} ${ES_HOST} ${ES_INDEX_PREFIX} ${ES_PORT} ${ES_USE_AUTH} ${ES_USERNAME} ${ES_PASSWORD} ${CLOUD} ${SECURITY} ${HOSTNAME} ${EMAIL_LIST} ${ADMIN_FIRST} ${ADMIN_LAST} ${ADMIN_EMAIL} ${NUM_WORKERS} ${WORKER_ABANDONED_DAYS}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore;

@Controller
@RequestMapping("/api")
Expand All @@ -27,6 +28,7 @@ public MyRestService() {
* Example POST service
*
*/
@ApiIgnore
@RequestMapping(value = "/example", method = POST)
public @ResponseBody String example(
final HttpSession session) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ public int getCountForClaimedProcInstPerKey(String procDefKey, List<String> clai

public List<Map<String, Object>> getProcDefKeyLatestCompleteInst(String procDefKey) {
return jdbcTemplate.queryForList(
"SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1",
new Object[]{procDefKey}
"SELECT proc_inst_id, start_time, end_time FROM cws_proc_inst_status WHERE proc_def_key=? AND status='complete' ORDER BY start_time DESC LIMIT 1",
new Object[]{procDefKey}
);
}

Expand Down Expand Up @@ -604,8 +604,8 @@ public int getNumUpWorkers() {
*/
public List<Map<String, Object>> getWorkerNumRunningProcs() {
return jdbcTemplate.queryForList(
"SELECT cws_worker.id, active_count as cnt " +
"FROM cws_worker");
"SELECT cws_worker.id, COUNT(*) AS cnt FROM cws_proc_inst_status,cws_worker "
+ "WHERE cws_proc_inst_status.status NOT LIKE '%complete%' GROUP BY cws_worker.id");
}


Expand Down
Loading
Loading