From 58d85871527f507c6a349404513fbe61398ee9d6 Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 7 Oct 2025 17:50:36 +1100 Subject: [PATCH 1/6] Fix bug in Dockerfile --- Dockerfile | 29 +++++++++---------- .../server/core/service/ElasticSearch.java | 1 + .../ogcapi/server/features/RestApiTest.java | 4 +-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6ef41f5..21eabdcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,18 +4,17 @@ VOLUME /tmp ENV MAX_HEAP_PERCENTAGE=70 COPY ./server/target/ogcapi-java-server-*-exec.jar app.jar -ENTRYPOINT [\ - "java",\ - "-XX:MaxRAMPercentage=${MAX_HEAP_PERCENTAGE}",\ - "-Delasticsearch.index.name=${INDEX_NAME}",\ - "-Delasticsearch.cloud_optimized_index.name=${CO_INDEX_NAME}",\ - "-Delasticsearch.vocabs_index.name=${VOCABS_INDEX_NAME}",\ - "-Dapi.host=${HOST}:${PORT}",\ - "-Dserver.port=${PORT}",\ - "-Delasticsearch.serverUrl=${ELASTIC_URL}",\ - "-Delasticsearch.apiKey=${ELASTIC_KEY}",\ - "-Ddata-access-service.host=${DAS_HOST}",\ - "-Ddata-access-service.secret=${DAS_SECRET}",\ - "--enable-preview",\ - "-jar",\ - "/app.jar"] +ENTRYPOINT ["/bin/sh", "-c", "java \ + -XX:MaxRAMPercentage=${MAX_HEAP_PERCENTAGE} \ + -Delasticsearch.index.name=${INDEX_NAME} \ + -Delasticsearch.cloud_optimized_index.name=${CO_INDEX_NAME} \ + -Delasticsearch.vocabs_index.name=${VOCABS_INDEX_NAME} \ + -Dapi.host=${HOST}:${PORT} \ + -Dserver.port=${PORT} \ + -Delasticsearch.serverUrl=${ELASTIC_URL} \ + -Delasticsearch.apiKey=${ELASTIC_KEY} \ + -Ddata-access-service.host=${DAS_HOST} \ + -Ddata-access-service.secret=${DAS_SECRET} \ + --enable-preview \ + -jar \ + /app.jar"] diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java index 30d2bac2..a960fbea 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java @@ -315,6 +315,7 @@ public ElasticSearchBase.SearchResult searchByParameters(Li } } catch(Exception e) { + log.warn("Error parsing score assume null", e); // OK to ignore as accept null as the value } // Get the search after diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java index beb47960..034b8425 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java @@ -320,12 +320,12 @@ public void verifyCorrectPageSizeAndScoreWithQuery() throws IOException { // The search after give you the value to go to next batch assertEquals(3, collections.getBody().getSearchAfter().size(), "search_after three fields"); assertEquals( - "80", + "95", collections.getBody().getSearchAfter().get(1), "search_after 2 value" ); assertEquals( - "str:bc55eff4-7596-3565-e044-00144fdd4fa6", + "str:7709f541-fc0c-4318-b5b9-9053aa474e0e", collections.getBody().getSearchAfter().get(2), "search_after 3 value" ); From 80a8f3c3bd6f4a8f8ad7eef684e46902617981ac Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 7 Oct 2025 18:00:13 +1100 Subject: [PATCH 2/6] mvn do not enable test profile by default --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1dee1f2..e6ee4bce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn -B verify --file pom.xml + run: mvn -B verify -P test --file pom.xml - name: Build Docker Image uses: docker/build-push-action@v5 From 3d5c056b683c481b080809bd8f451afa24dabb33 Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 7 Oct 2025 18:04:33 +1100 Subject: [PATCH 3/6] rollback setting --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6ee4bce..b1dee1f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn -B verify -P test --file pom.xml + run: mvn -B verify --file pom.xml - name: Build Docker Image uses: docker/build-push-action@v5 From d54af5ad14638fec2a3c23d873236ae414f747b5 Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 7 Oct 2025 18:14:44 +1100 Subject: [PATCH 4/6] clean test pack --- .../databag/8cdcdcad-399b-4bed-8cb2-29c486b6b124.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/src/test/resources/databag/8cdcdcad-399b-4bed-8cb2-29c486b6b124.json b/server/src/test/resources/databag/8cdcdcad-399b-4bed-8cb2-29c486b6b124.json index 007f0c29..be802a8f 100644 --- a/server/src/test/resources/databag/8cdcdcad-399b-4bed-8cb2-29c486b6b124.json +++ b/server/src/test/resources/databag/8cdcdcad-399b-4bed-8cb2-29c486b6b124.json @@ -1,6 +1,6 @@ { "title": "IMOS - National Reef Monitoring Network Sub-Facility", - "description": "The National Reef Monitoring Network brings together shallow reef surveys conducted around Australia into a centralised database. The IMOS National Reef Monitoring Network sub-Facility collates, cleans, stores and makes this data rapidly available from contributors including: Reef Life Survey, Parks Australia, Department of Biodiversity, Conservation and Attractions (Western Australia), Department of Environment, Water and Natural Resources (South Australia), Department of Primary Industries (New South Wales), Tasmanian Parks and Wildlife Service and Parks Victoria. The data provided by the National Reef Monitoring Network contributes to establishing and supporting national marine baselines, and assisting with the management of Commonwealth and State marine reserves. Reef Life Survey (RLS) and the Australian Temperate Reef Network (ATRC) aims to improve biodiversity conservation and the sustainable management of marine resources by coordinating surveys of rocky and coral reefs using scientific methods, with the ultimate goal to improve coastal stewardship. Our activities depend on the skills of marine scientists, experienced and motivated recreational SCUBA divers, partnerships with management agencies and university researchers, and active input from the ATRC partners and RLS Advisory Committee RLS and ATRC data are freely available to the public for non-profit purposes, so not only managers, but also groups such as local dive clubs or schools may use these data to look at changes over time in their own local reefs. By making data freely available and through public outputs, RLS and ATRC aims to raise broader community awareness of the status of Australia’s marine biodiversity and associated conservation issues.", + "description": "No value is fine, this case is make sure short form of National Reef Monitoring Network not appear here", "extent": { "bbox": [ [ @@ -40,7 +40,7 @@ }, "creation": "2021-05-21T12:00:00", "revision": "2024-07-04T03:50:26", - "ai:description": "The National Reef Monitoring Network brings together shallow reef surveys conducted around Australia into a centralised database. The IMOS National Reef Monitoring Network sub-Facility collates, cleans, stores and makes this data rapidly available from contributors including: - Reef Life Surve - Parks Australi - Department of Biodiversity, Conservation and Attractions (Western Australia) - Department of Environment, Water and Natural Resources (South Australia) - Department of Primary Industries (New South Wales) - Tasmanian Parks and Wildlife Service - Parks Victoria. The data provided by the National Reef Monitoring Network contributes to establishing and supporting national marine baselines, and assisting with the management of Commonwealth and State marine reserves. Reef Life Survey (RLS) and the Australian Temperate Reef Network (ATRC) aims to improve biodiversity conservation and the sustainable management of marine resources by coordinating surveys of rocky and coral reefs using scientific methods, with the ultimate goal to improve coastal stewardship. Our activities depend on the skills of marine scientists, experienced and motivated recreational SCUBA divers, partnerships with management agencies and university researchers, and active input from the ATRC partners and RLS Advisory Committee. RLS and ATRC data are freely available to the public for non-profit purposes, so not only managers, but also groups such as local dive clubs or schools may use these data to look at changes over time in their own local reefs. By making data freely available and through public outputs, RLS and ATRC aims to raise broader community awareness of the status of Australia’s marine biodiversity and associated conservation issues.", + "ai:description": "No value is fine", "dataset_provider": "IMOS", "update_frequency": "other", "proj:geometry": { @@ -11300,8 +11300,7 @@ "href": "uuid:0f65b7ae-1f6f-4a55-b804-1c991f791e1a", "rel": "sibling", "type": "application/json", - "title": "{\"title\":\"IMOS - Autonomous Underwater Vehicles - AUV Iver", - "recordAbstract": "The IMOS Autonomous Underwater Vehicles Facility has an Autonomous Underwater Vehicle (AUV) called Iver (IMOS platform code:IVER), capable of undertaking high resolution geo-referenced survey work. This platform is a modified Ocean Server Iver2 AUV that is hand deployable off RHIBs and other small vessels in addition to being deployable off larger vessels.\n\nThis AUV has been modified for benthic imaging, including the addition of USBL and DVL for more accurate navigation and the addition of high resolution stereo cameras and strobes. The submersible is equipped with a suite of oceanographic sensors including high resolution stereo cameras (6MP each), depth sensor, Doppler Velocity Log (DVL), Compass and Ultra Short Baseline (USBL). The vehicle is controlled by an on-board PC stack which is used to log sensor information and run the vehicle's control algorithms.\n\nThe vehicle has demonstrated its capacity to collect high resolution, near bottom imagery on trajectories over smooth terrain that has been used to generate 3D meshes and ortho-mosaics.\"}" + "title": "Any works" } ], "license": "Creative Commons Attribution 4.0 International License", @@ -11793,7 +11792,7 @@ "National Reef Monitoring Network Sub-Facility, Integrated Marine Observing System (IMOS)" ] }, - "sci:citation": "{\"suggestedCitation\":\"The citation in a list of references is: \\\"Reef Life Survey (RLS); Institute for Marine and Antarctic Studies (IMAS); Parks Victoria; Department of Primary Industries (DPI), New South Wales Government; Parks and Wildlife Tasmania; Department for Environment and Water (DEWNR), South Australia, Integrated Marine Observing System (IMOS) [year-of-data-download], National Reef Monitoring Network Sub-Facility, [data-access-URL], accessed [date-of-access].\\\"\",\"useLimitations\":[\"Data, products and services from IMOS are provided \\\"as is\\\" without any warranty as to fitness for a particular purpose.\"],\"otherConstraints\":null}", + "sci:citation": "Not importand for testing", "type": "Collection", "stac_version": "1.0.0", "stac_extensions": [ From 491d2a7059928252aedc28a47b926ab2defaa6f3 Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 7 Oct 2025 18:23:59 +1100 Subject: [PATCH 5/6] missing profile in surefire --- server/pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/pom.xml b/server/pom.xml index 3efac3b7..53ca5b50 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -266,6 +266,9 @@ maven-surefire-plugin --enable-preview + + test + From a8c1ad632c924d6d8edeac40ef9adbff2e7d4798 Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 7 Oct 2025 22:43:49 +1100 Subject: [PATCH 6/6] missing profile in surefire --- .../au/org/aodn/ogcapi/server/features/RestApiTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java index 034b8425..06870636 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/features/RestApiTest.java @@ -290,14 +290,16 @@ public void verifyCorrectPageSizeDataReturnWithQuery() throws IOException { public void verifyCorrectPageSizeAndScoreWithQuery() throws IOException { assertEquals(4, pageSize, "This test only works with small page"); + logger.info("Start verifyCorrectPageSizeAndScoreWithQuery"); + // Given 6 records and we set page to 4, that means each query elastic return 4 record only // and the logic to load the reset can kick in. super.insertJsonToElasticRecordIndex( "5c418118-2581-4936-b6fd-d6bedfe74f62.json", "19da2ce7-138f-4427-89de-a50c724f5f54.json", - "516811d7-cd1e-207a-e0440003ba8c79dd.json", - "7709f541-fc0c-4318-b5b9-9053aa474e0e.json", - "bc55eff4-7596-3565-e044-00144fdd4fa6.json", + "516811d7-cd1e-207a-e0440003ba8c79dd.json", // + "7709f541-fc0c-4318-b5b9-9053aa474e0e.json", // * + "bc55eff4-7596-3565-e044-00144fdd4fa6.json", // "bf287dfe-9ce4-4969-9c59-51c39ea4d011.json"); // Call rest api directly and get query result with search on "dataset"