From 86e33a7f040d2619eb81e77903c66f03c0174712 Mon Sep 17 00:00:00 2001 From: tawoe Date: Mon, 5 May 2025 15:07:01 +0200 Subject: [PATCH 1/8] cp container logback.xml --- .github/Dockerfile_PreBuild | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/Dockerfile_PreBuild b/.github/Dockerfile_PreBuild index cf711494f..6827dc736 100644 --- a/.github/Dockerfile_PreBuild +++ b/.github/Dockerfile_PreBuild @@ -1,5 +1,4 @@ FROM jetty:9.4-jdk11-alpine - -# Copy OBP source code +COPY .github/logback.xml /var/lib/jetty/resources/logback.xml # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war From fc2463a14bb4e363ddeda08ad52462a654c638cf Mon Sep 17 00:00:00 2001 From: tawoe Date: Wed, 7 May 2025 14:33:39 +0200 Subject: [PATCH 2/8] auto-update images --- .github/workflows/auto_update_base_image.yml | 31 +++++++++++++++++++ .../build_container_develop_branch.yml | 1 + 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/auto_update_base_image.yml diff --git a/.github/workflows/auto_update_base_image.yml b/.github/workflows/auto_update_base_image.yml new file mode 100644 index 000000000..7f71c289a --- /dev/null +++ b/.github/workflows/auto_update_base_image.yml @@ -0,0 +1,31 @@ +name: Regular base image update check +on: + schedule: + - cron: "*/5 * * * *" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Docker Image Update Checker + id: baseupdatecheck + uses: lucacome/docker-image-update-checker@v2.0.0 + with: + base-image: jetty:9.4-jdk11-alpine + image: tawoe/obp-api + + - name: Trigger build_container_develop_branch workflow + uses: actions/github-script@v6 + with: + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'build_container_develop_branch.yml', + ref: 'refs/heads/develop' + }); + if: steps.baseupdatecheck.outputs.needs-updating == 'true' diff --git a/.github/workflows/build_container_develop_branch.yml b/.github/workflows/build_container_develop_branch.yml index a7f68daa9..d3f355042 100644 --- a/.github/workflows/build_container_develop_branch.yml +++ b/.github/workflows/build_container_develop_branch.yml @@ -3,6 +3,7 @@ name: Build and publish container develop # read-write repo token # access to secrets on: + workflow_dispatch: push: branches: - develop From 936f8bb633ed173cf372c8c3acc412cc381c711c Mon Sep 17 00:00:00 2001 From: tawoe Date: Mon, 12 May 2025 12:51:31 +0200 Subject: [PATCH 3/8] relax auto-update images --- .github/workflows/auto_update_base_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_update_base_image.yml b/.github/workflows/auto_update_base_image.yml index 7f71c289a..7e53258a7 100644 --- a/.github/workflows/auto_update_base_image.yml +++ b/.github/workflows/auto_update_base_image.yml @@ -1,7 +1,7 @@ name: Regular base image update check on: schedule: - - cron: "*/5 * * * *" + - cron: "0 */3 * * *" workflow_dispatch: jobs: From 58cd8e951f1eb679711078e0340e5323586d19e7 Mon Sep 17 00:00:00 2001 From: tawoe Date: Mon, 12 May 2025 15:19:57 +0200 Subject: [PATCH 4/8] add auto-update container image repo variable --- .github/workflows/auto_update_base_image.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_update_base_image.yml b/.github/workflows/auto_update_base_image.yml index 7e53258a7..3048faf15 100644 --- a/.github/workflows/auto_update_base_image.yml +++ b/.github/workflows/auto_update_base_image.yml @@ -1,9 +1,13 @@ name: Regular base image update check on: schedule: - - cron: "0 */3 * * *" + - cron: "0 5 * * *" workflow_dispatch: +env: + ## Sets environment variable + DOCKER_HUB_ORGANIZATION: ${{ vars.DOCKER_HUB_ORGANIZATION }} + jobs: build: runs-on: ubuntu-latest @@ -16,7 +20,7 @@ jobs: uses: lucacome/docker-image-update-checker@v2.0.0 with: base-image: jetty:9.4-jdk11-alpine - image: tawoe/obp-api + image: ${{ env.DOCKER_HUB_ORGANIZATION }}/obp-api:latest - name: Trigger build_container_develop_branch workflow uses: actions/github-script@v6 From 9ab277bdede2ac942cfca3b5b49a0e9e995601bf Mon Sep 17 00:00:00 2001 From: tawoe Date: Mon, 12 May 2025 16:00:56 +0200 Subject: [PATCH 5/8] Revert "cp container logback.xml" This reverts commit 86e33a7f040d2619eb81e77903c66f03c0174712. --- .github/Dockerfile_PreBuild | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild b/.github/Dockerfile_PreBuild index 6827dc736..cf711494f 100644 --- a/.github/Dockerfile_PreBuild +++ b/.github/Dockerfile_PreBuild @@ -1,4 +1,5 @@ FROM jetty:9.4-jdk11-alpine -COPY .github/logback.xml /var/lib/jetty/resources/logback.xml + +# Copy OBP source code # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war From 1b55e99aab3e54bbe44e9fb54202c7c919c408d2 Mon Sep 17 00:00:00 2001 From: tawoe Date: Wed, 14 May 2025 15:35:04 +0200 Subject: [PATCH 6/8] add jmx exporter to container image --- .github/Dockerfile_PreBuild | 5 +++++ .github/jmx_exporter.config | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .github/jmx_exporter.config diff --git a/.github/Dockerfile_PreBuild b/.github/Dockerfile_PreBuild index cf711494f..810a41bd2 100644 --- a/.github/Dockerfile_PreBuild +++ b/.github/Dockerfile_PreBuild @@ -1,5 +1,10 @@ FROM jetty:9.4-jdk11-alpine +ENV JMX_EXPORTER_VERSION=1.2.0 + +# To enable add "-javaagent:$JETTY_BASE/jmx-exporter.jar=8090:$JETTY_BASE/prometheus_config.yml" to the JAVA_OPTIONS +RUN wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/$JMX_EXPORTER_VERSION/jmx_prometheus_javaagent-$JMX_EXPORTER_VERSION.jar -o /var/lib/jetty/jmx-exporter.jar +COPY .github/jmx_exporter.config /var/lib/jetty/prometheus_config.yml # Copy OBP source code # Copy build artifact (.war file) into jetty from 'maven' stage. COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war diff --git a/.github/jmx_exporter.config b/.github/jmx_exporter.config new file mode 100644 index 000000000..f9ea32557 --- /dev/null +++ b/.github/jmx_exporter.config @@ -0,0 +1,15 @@ +--- +lowercaseOutputLabelNames: true +lowercaseOutputName: true +whitelistObjectNames: ["java.lang:type=OperatingSystem"] +blacklistObjectNames: [] +rules: +- pattern: 'java.lang<>(committed_virtual_memory|free_physical_memory|free_swap_space|total_physical_memory|total_swap_space)_size:' + name: os_$1_bytes + type: GAUGE + attrNameSnakeCase: true +- pattern: 'java.lang<>((?!process_cpu_time)\w+):' + name: os_$1 + type: GAUGE + attrNameSnakeCase: true +- pattern: ".*" \ No newline at end of file From a8a9199fbb3d75ed13fb5128355f069976a89fb9 Mon Sep 17 00:00:00 2001 From: tawoe Date: Wed, 14 May 2025 19:44:46 +0200 Subject: [PATCH 7/8] fix pipeline link --- .github/Dockerfile_PreBuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile_PreBuild b/.github/Dockerfile_PreBuild index 810a41bd2..782715024 100644 --- a/.github/Dockerfile_PreBuild +++ b/.github/Dockerfile_PreBuild @@ -3,7 +3,7 @@ FROM jetty:9.4-jdk11-alpine ENV JMX_EXPORTER_VERSION=1.2.0 # To enable add "-javaagent:$JETTY_BASE/jmx-exporter.jar=8090:$JETTY_BASE/prometheus_config.yml" to the JAVA_OPTIONS -RUN wget https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/$JMX_EXPORTER_VERSION/jmx_prometheus_javaagent-$JMX_EXPORTER_VERSION.jar -o /var/lib/jetty/jmx-exporter.jar +RUN wget https://github.com/prometheus/jmx_exporter/releases/download/$JMX_EXPORTER_VERSION/jmx_prometheus_javaagent-$JMX_EXPORTER_VERSION.jar -o /var/lib/jetty/jmx-exporter.jar COPY .github/jmx_exporter.config /var/lib/jetty/prometheus_config.yml # Copy OBP source code # Copy build artifact (.war file) into jetty from 'maven' stage. From f1be2d69b907a5bbe8066bed1ae0f469317642fe Mon Sep 17 00:00:00 2001 From: tawoe Date: Thu, 15 May 2025 16:07:00 +0200 Subject: [PATCH 8/8] fix metrics default in sample props --- obp-api/src/main/resources/props/sample.props.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 2d77ddd92..c98556d02 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -183,9 +183,9 @@ jwt.use.ssl=false ## Enable writing API metrics (which APIs are called) to RDBMS -write_metrics=true +write_metrics=false ## Enable writing connector metrics (which methods are called)to RDBMS -write_connector_metrics=true +write_connector_metrics=false ## ElasticSearch #allow_elasticsearch=true