From 79977f7cacda7113ba07fe048cb8e735566668e0 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 14:59:37 -0500 Subject: [PATCH 01/16] Enable stress tests. --- Jenkinsfile | 6 +++++- docker-compose.stress.test.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 docker-compose.stress.test.yml diff --git a/Jenkinsfile b/Jenkinsfile index ab2e25fa..98bfc14f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ def pollReposAndEndBuild = env.poll_repos_and_end_build?.toBoolean() ?: false def postBuildStatusEnabled = 'post_build_status' in env ? env.post_build_status.toBoolean() : true def githubAuthToken = env.github_auth_token def emailRecipients = env.email_recipients - +def extraTestDataPath = env.extra_test_data_path class Repo { @@ -321,6 +321,9 @@ try { stage('Run Integration Tests') { dir('openmpf-docker') { def composeFiles = "docker-compose.integration.test.yml:$componentComposeFiles" + if (extraTestDataPath) { + composeFiles += ":docker-compose.stress.test.yml" + } def nproc = shOutput('nproc') as int def servicesInSystemTests = ['ocv-face-detection', 'darknet-detection', 'dlib-face-detection', @@ -333,6 +336,7 @@ try { withEnv(["TAG=$inProgressTag", "EXTRA_MVN_OPTIONS=$mvnTestOptions", + "EXTRA_TEST_DATA_PATH=$extraTestDataPath", // Use custom project name to allow multiple builds on same machine "COMPOSE_PROJECT_NAME=openmpf_$buildId", "COMPOSE_FILE=$composeFiles"]) { diff --git a/docker-compose.stress.test.yml b/docker-compose.stress.test.yml new file mode 100644 index 00000000..e3cd01a1 --- /dev/null +++ b/docker-compose.stress.test.yml @@ -0,0 +1,32 @@ +############################################################################# +# NOTICE # +# # +# This software (or technical data) was produced for the U.S. Government # +# under contract, and is subject to the Rights in Data-General Clause # +# 52.227-14, Alt. IV (DEC 2007). # +# # +# Copyright 2020 The MITRE Corporation. All Rights Reserved. # +############################################################################# + +############################################################################# +# Copyright 2020 The MITRE Corporation # +# # +# 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. # +############################################################################# + +version: '3.7' + +services: + workflow-manager: + volumes: + - ${EXTRA_TEST_DATA_PATH}:/mpfdata:ro From 619c38b6ea20b19546e9a280319d0a780c312eb9 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 15:39:57 -0500 Subject: [PATCH 02/16] Add debug. --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 98bfc14f..8389e171 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ def pollReposAndEndBuild = env.poll_repos_and_end_build?.toBoolean() ?: false def postBuildStatusEnabled = 'post_build_status' in env ? env.post_build_status.toBoolean() : true def githubAuthToken = env.github_auth_token def emailRecipients = env.email_recipients -def extraTestDataPath = env.extra_test_data_path +def extraTestDataPath = env.extra_test_data_path ?: '' class Repo { @@ -321,7 +321,9 @@ try { stage('Run Integration Tests') { dir('openmpf-docker') { def composeFiles = "docker-compose.integration.test.yml:$componentComposeFiles" + echo "extraTestDataPath: $extraTestDataPath" // DEBUG if (extraTestDataPath) { + echo "Add docker-compose.stress.test.yml" // DEBUG composeFiles += ":docker-compose.stress.test.yml" } From 7090fd5b87c270e92ef012255c3d5d0edc11e0e0 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 15:49:59 -0500 Subject: [PATCH 03/16] Add EXTRA_TEST_DATA_PATH to env.tpl. --- .env.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.tpl b/.env.tpl index a9bc6459..3fdb1024 100644 --- a/.env.tpl +++ b/.env.tpl @@ -48,10 +48,12 @@ USER_PROPERTIES_PATH= KEYSTORE_PATH= KEYSTORE_PASSWORD= - # Optional database configuration options. # Uncomment and modify to customize database configuration. # JDBC_URL=jdbc:postgresql://db:5432/mpf # POSTGRES_USER=mpf # POSTGRES_PASSWORD=password # POSTGRES_DB=mpf + +# Set this if using "docker-compose.stress.test.yml". +EXTRA_TEST_DATA_PATH= \ No newline at end of file From 25653ee41ef5b8f4f23280e04f66298fcc66acdc Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:03:33 -0500 Subject: [PATCH 04/16] Add debug. --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 8389e171..39f3264c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -343,6 +343,7 @@ try { "COMPOSE_PROJECT_NAME=openmpf_$buildId", "COMPOSE_FILE=$composeFiles"]) { try { + echo "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' } From 41f22226d842b38aa768bf5a4784f73ab6baab67 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:08:06 -0500 Subject: [PATCH 05/16] Add debug. --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 39f3264c..6dfe94bc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -344,6 +344,7 @@ try { "COMPOSE_FILE=$composeFiles"]) { try { echo "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG + docker-compose config // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' } From 18f2aeb9bb02b59293570a018e02e25ab9a7ef65 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:09:56 -0500 Subject: [PATCH 06/16] Fix debug. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6dfe94bc..b5995d07 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -344,7 +344,7 @@ try { "COMPOSE_FILE=$composeFiles"]) { try { echo "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG - docker-compose config // DEBUG + sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' } From 42fde8ebc28320617eb98383722ea25107b0013e Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:15:11 -0500 Subject: [PATCH 07/16] Attempt. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5995d07..5778ef4f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -324,7 +324,7 @@ try { echo "extraTestDataPath: $extraTestDataPath" // DEBUG if (extraTestDataPath) { echo "Add docker-compose.stress.test.yml" // DEBUG - composeFiles += ":docker-compose.stress.test.yml" + composeFiles = "docker-compose.stress.test.yml:$composeFiles" } def nproc = shOutput('nproc') as int From 4ba00a40743f203809539cb76f1735dc07faf118 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:27:32 -0500 Subject: [PATCH 08/16] Cannot use variables on right side. --- docker-compose.stress.test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-compose.stress.test.yml b/docker-compose.stress.test.yml index e3cd01a1..e906c46f 100644 --- a/docker-compose.stress.test.yml +++ b/docker-compose.stress.test.yml @@ -29,4 +29,8 @@ version: '3.7' services: workflow-manager: volumes: - - ${EXTRA_TEST_DATA_PATH}:/mpfdata:ro + - extra_data:/mpfdata:ro + +volumes: + extra_data: + name: ${EXTRA_TEST_DATA_PATH} From 2de3a36e5c9192bac9107378ace412a3a5aa1f7e Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:41:35 -0500 Subject: [PATCH 09/16] Add debug. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5778ef4f..731417e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -343,7 +343,7 @@ try { "COMPOSE_PROJECT_NAME=openmpf_$buildId", "COMPOSE_FILE=$composeFiles"]) { try { - echo "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG + sh "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' From 734639ec651d0f2564caf72d5f5d66d7fdba0b6c Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 16:56:58 -0500 Subject: [PATCH 10/16] Add debug. --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 731417e5..6f88e6f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -344,6 +344,7 @@ try { "COMPOSE_FILE=$composeFiles"]) { try { sh "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG + sh "printenv" sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' From 8ae188d4ed50c8bde06e6a01379f7959dd926417 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 17:07:18 -0500 Subject: [PATCH 11/16] Add debug. --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6f88e6f5..eee2edcc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -345,6 +345,9 @@ try { try { sh "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG sh "printenv" + + sh "export EXTRA_TEST_DATA_PATH=$extraTestDataPath" + sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' From 37c5afe614b586469b0cf3b0c105c31b5638410e Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 17:10:21 -0500 Subject: [PATCH 12/16] Add debug. --- docker-compose.integration.test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.integration.test.yml b/docker-compose.integration.test.yml index d959ee60..69006ebc 100644 --- a/docker-compose.integration.test.yml +++ b/docker-compose.integration.test.yml @@ -52,6 +52,7 @@ services: - activemq environment: - EXTRA_MVN_OPTIONS=$EXTRA_MVN_OPTIONS + - EXTRA_TEST_DATA_PATH=$EXTRA_TEST_DATA_PATH volumes: - shared_data:/opt/mpf/share - ./test-reports:/test-reports From 9b7f07b090f1a1168e850f14975dcbc20245549a Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 17:15:02 -0500 Subject: [PATCH 13/16] Add debug. --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index eee2edcc..8e6b2167 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ def pollReposAndEndBuild = env.poll_repos_and_end_build?.toBoolean() ?: false def postBuildStatusEnabled = 'post_build_status' in env ? env.post_build_status.toBoolean() : true def githubAuthToken = env.github_auth_token def emailRecipients = env.email_recipients -def extraTestDataPath = env.extra_test_data_path ?: '' +def testDataPath = env.extra_test_data_path ?: '' class Repo { @@ -321,8 +321,8 @@ try { stage('Run Integration Tests') { dir('openmpf-docker') { def composeFiles = "docker-compose.integration.test.yml:$componentComposeFiles" - echo "extraTestDataPath: $extraTestDataPath" // DEBUG - if (extraTestDataPath) { + echo "testDataPath: $testDataPath" // DEBUG + if (testDataPath) { echo "Add docker-compose.stress.test.yml" // DEBUG composeFiles = "docker-compose.stress.test.yml:$composeFiles" } @@ -338,7 +338,7 @@ try { withEnv(["TAG=$inProgressTag", "EXTRA_MVN_OPTIONS=$mvnTestOptions", - "EXTRA_TEST_DATA_PATH=$extraTestDataPath", + "EXTRA_TEST_DATA_PATH=$testDataPath", // Use custom project name to allow multiple builds on same machine "COMPOSE_PROJECT_NAME=openmpf_$buildId", "COMPOSE_FILE=$composeFiles"]) { @@ -346,7 +346,7 @@ try { sh "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG sh "printenv" - sh "export EXTRA_TEST_DATA_PATH=$extraTestDataPath" + // sh "export EXTRA_TEST_DATA_PATH=$testDataPath" sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" From 08939c079280bb9cda81240acfbc5b4f2f67eb78 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 17:20:21 -0500 Subject: [PATCH 14/16] Add debug. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8e6b2167..98bb1102 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,7 +44,7 @@ def pollReposAndEndBuild = env.poll_repos_and_end_build?.toBoolean() ?: false def postBuildStatusEnabled = 'post_build_status' in env ? env.post_build_status.toBoolean() : true def githubAuthToken = env.github_auth_token def emailRecipients = env.email_recipients -def testDataPath = env.extra_test_data_path ?: '' +def testDataPath = env.test_data_path ?: '' class Repo { From 72e2f81b06b54812056e7919d7dc01134e66a9a0 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 17:28:45 -0500 Subject: [PATCH 15/16] Fix with debug. --- Jenkinsfile | 7 ------- docker-compose.stress.test.yml | 6 +----- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 98bb1102..70835d8a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -321,9 +321,7 @@ try { stage('Run Integration Tests') { dir('openmpf-docker') { def composeFiles = "docker-compose.integration.test.yml:$componentComposeFiles" - echo "testDataPath: $testDataPath" // DEBUG if (testDataPath) { - echo "Add docker-compose.stress.test.yml" // DEBUG composeFiles = "docker-compose.stress.test.yml:$composeFiles" } @@ -343,11 +341,6 @@ try { "COMPOSE_PROJECT_NAME=openmpf_$buildId", "COMPOSE_FILE=$composeFiles"]) { try { - sh "echo EXTRA_TEST_DATA_PATH: $EXTRA_TEST_DATA_PATH" // DEBUG - sh "printenv" - - // sh "export EXTRA_TEST_DATA_PATH=$testDataPath" - sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' diff --git a/docker-compose.stress.test.yml b/docker-compose.stress.test.yml index e906c46f..e3cd01a1 100644 --- a/docker-compose.stress.test.yml +++ b/docker-compose.stress.test.yml @@ -29,8 +29,4 @@ version: '3.7' services: workflow-manager: volumes: - - extra_data:/mpfdata:ro - -volumes: - extra_data: - name: ${EXTRA_TEST_DATA_PATH} + - ${EXTRA_TEST_DATA_PATH}:/mpfdata:ro From 2b05bfe64d32fc4d1b5eeeed7c6af10137f48c92 Mon Sep 17 00:00:00 2001 From: jrobble Date: Fri, 6 Mar 2020 17:32:06 -0500 Subject: [PATCH 16/16] Remove debug. --- Jenkinsfile | 1 - docker-compose.integration.test.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 70835d8a..64b539de 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -341,7 +341,6 @@ try { "COMPOSE_PROJECT_NAME=openmpf_$buildId", "COMPOSE_FILE=$composeFiles"]) { try { - sh "docker-compose config" // DEBUG sh "docker-compose up --exit-code-from workflow-manager $scaleArgs" sh 'docker-compose down --volumes' } diff --git a/docker-compose.integration.test.yml b/docker-compose.integration.test.yml index 69006ebc..d959ee60 100644 --- a/docker-compose.integration.test.yml +++ b/docker-compose.integration.test.yml @@ -52,7 +52,6 @@ services: - activemq environment: - EXTRA_MVN_OPTIONS=$EXTRA_MVN_OPTIONS - - EXTRA_TEST_DATA_PATH=$EXTRA_TEST_DATA_PATH volumes: - shared_data:/opt/mpf/share - ./test-reports:/test-reports