From 293bd072a4a8408df312d8b85c438d57e2704d30 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Thu, 22 Sep 2022 14:40:04 +0100 Subject: [PATCH 01/11] Fixing exception on empty manifest --- src/main/webapp/stats/manifest.xhtml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/stats/manifest.xhtml b/src/main/webapp/stats/manifest.xhtml index 8ace4cc6..2f83f06c 100644 --- a/src/main/webapp/stats/manifest.xhtml +++ b/src/main/webapp/stats/manifest.xhtml @@ -28,11 +28,15 @@ - + + + - + + + From 993154b30a861f5482d1b1098a5446181118859d Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 12:47:00 +0100 Subject: [PATCH 02/11] Fixing issue with duplicate IDs --- .../llgc/annotation/store/data/Manifest.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/uk/org/llgc/annotation/store/data/Manifest.java b/src/main/java/uk/org/llgc/annotation/store/data/Manifest.java index d7e16595..88ae14bf 100644 --- a/src/main/java/uk/org/llgc/annotation/store/data/Manifest.java +++ b/src/main/java/uk/org/llgc/annotation/store/data/Manifest.java @@ -276,16 +276,19 @@ public void setURI(final String pURI) { */ public String getShortId() { if (_shortId == null || _shortId.isEmpty()) { - if (_URI.endsWith("manifest.json")) { + // Its no longer safe to use this NLW shortcut + // as it fails the workbench: + // https://glenrobson.github.io/workbench/manifests/projectmanifest.json" + /*if (_URI.endsWith("manifest.json")) { String[] tURI = _URI.split("/"); _shortId = tURI[tURI.length - 2]; - } else { - try { - _shortId = AnnotationUtils.getHash(_URI, "md5"); - } catch (IOException tExcpt) { - tExcpt.printStackTrace(); - } + } else {*/ + try { + _shortId = AnnotationUtils.getHash(_URI, "md5"); + } catch (IOException tExcpt) { + tExcpt.printStackTrace(); } + //} } return _shortId; } From 0d0c968c59c07824d755d40812a1cdafbd3266f9 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 12:54:30 +0100 Subject: [PATCH 03/11] Checking to see if Manifest is null before calling methods --- src/main/webapp/manifest.xhtml | 207 ++++++++++++++------------- src/main/webapp/stats/manifest.xhtml | 4 +- 2 files changed, 108 insertions(+), 103 deletions(-) diff --git a/src/main/webapp/manifest.xhtml b/src/main/webapp/manifest.xhtml index 0504b23e..16118a2e 100644 --- a/src/main/webapp/manifest.xhtml +++ b/src/main/webapp/manifest.xhtml @@ -25,120 +25,125 @@

-
- -
- - - - - + + + + + + +

It looks like there was a problem finding your manifest. Please add it again in the Collections screen.

+
diff --git a/src/main/webapp/stats/manifest.xhtml b/src/main/webapp/stats/manifest.xhtml index 2f83f06c..bcc02586 100644 --- a/src/main/webapp/stats/manifest.xhtml +++ b/src/main/webapp/stats/manifest.xhtml @@ -28,13 +28,13 @@
- + - + From fd26e8f4711422849c604b68d0f7fd76b7ef77dc Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 14:00:26 +0100 Subject: [PATCH 04/11] Lengthening startup time --- .github/workflows/solr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/solr.yml b/.github/workflows/solr.yml index 0bffd8d0..657c22a7 100644 --- a/.github/workflows/solr.yml +++ b/.github/workflows/solr.yml @@ -18,7 +18,7 @@ jobs: run: docker-compose -f docker/sas-solr/docker-compose.yml --project-directory . up -d solr - name: Wait for SOLR to start - run: docker exec -t sas_solr /opt/docker-solr/scripts/wait-for-solr.sh --max-attempts 10 --wait-seconds 5 --solr-url http://0.0.0.0:8983/ + run: docker exec -t sas_solr /opt/docker-solr/scripts/wait-for-solr.sh --max-attempts 10 --wait-seconds 10 --solr-url http://0.0.0.0:8983/ - name: Run Tests run: export "config=solr.properties" && mvn test From 650efd62e0d891cd658cb2467a5345df190b56a6 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 14:06:55 +0100 Subject: [PATCH 05/11] Adding check to see if container has started --- .github/workflows/solr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/solr.yml b/.github/workflows/solr.yml index 657c22a7..81d95ff6 100644 --- a/.github/workflows/solr.yml +++ b/.github/workflows/solr.yml @@ -17,6 +17,9 @@ jobs: - name: Starting SOLR run: docker-compose -f docker/sas-solr/docker-compose.yml --project-directory . up -d solr + - name: checking docker + run: docker ps && docker logs sas_solr + - name: Wait for SOLR to start run: docker exec -t sas_solr /opt/docker-solr/scripts/wait-for-solr.sh --max-attempts 10 --wait-seconds 10 --solr-url http://0.0.0.0:8983/ From 9146d51159cfb0ee4e1389d6e8e65f35a3a055d4 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 14:20:04 +0100 Subject: [PATCH 06/11] Adding volume for SOLR data --- docker/sas-solr/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/sas-solr/docker-compose.yml b/docker/sas-solr/docker-compose.yml index 086430c8..c48b9aa1 100644 --- a/docker/sas-solr/docker-compose.yml +++ b/docker/sas-solr/docker-compose.yml @@ -14,6 +14,7 @@ services: - "8983:8983" volumes: - "./src/main/resources/solr:/tmp/config:ro" + - "./home:/var/solr" entrypoint: - bash - "-c" From 658392a970f9da6a2a332890d8319fb6756283c1 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 14:51:45 +0100 Subject: [PATCH 07/11] Creating SOLR home --- docker/sas-solr/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/sas-solr/docker-compose.yml b/docker/sas-solr/docker-compose.yml index c48b9aa1..0a2b2e0c 100644 --- a/docker/sas-solr/docker-compose.yml +++ b/docker/sas-solr/docker-compose.yml @@ -14,7 +14,7 @@ services: - "8983:8983" volumes: - "./src/main/resources/solr:/tmp/config:ro" - - "./home:/var/solr" + - "./home:/var/solr/data" entrypoint: - bash - "-c" From 0846596a1e3aece9edbab3826d5ac9d76eafeaf0 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 14:55:48 +0100 Subject: [PATCH 08/11] Making data directory writeable --- .github/workflows/solr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/solr.yml b/.github/workflows/solr.yml index 81d95ff6..5f326ad1 100644 --- a/.github/workflows/solr.yml +++ b/.github/workflows/solr.yml @@ -15,7 +15,7 @@ jobs: distribution: 'temurin' cache: maven - name: Starting SOLR - run: docker-compose -f docker/sas-solr/docker-compose.yml --project-directory . up -d solr + run: mkdir home && chmod 777 home && docker-compose -f docker/sas-solr/docker-compose.yml --project-directory . up -d solr - name: checking docker run: docker ps && docker logs sas_solr From 70ec172f992b8564147e931adc73e02438f060e0 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 15:25:21 +0100 Subject: [PATCH 09/11] Pinning to SOLR 8 --- docker/sas-solr/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/sas-solr/docker-compose.yml b/docker/sas-solr/docker-compose.yml index 0a2b2e0c..4182d100 100644 --- a/docker/sas-solr/docker-compose.yml +++ b/docker/sas-solr/docker-compose.yml @@ -9,13 +9,13 @@ services: - "8888:8080" solr: container_name: sas_solr - image: "solr:latest" + image: "solr:8" ports: - "8983:8983" volumes: - "./src/main/resources/solr:/tmp/config:ro" - - "./home:/var/solr/data" + - "./solr-data:/var/solr/data" entrypoint: - bash - "-c" - - "precreate-core testannotations /tmp/config; precreate-core annotations /tmp/config; exec solr -f" + - "solr-precreate testannotations /tmp/config; solr-precreate annotations /tmp/config; exec solr -f" From 318c5d286ff6540427cd4018e21a05ccb60884aa Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 15:25:52 +0100 Subject: [PATCH 10/11] Adding solr data to ignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4a12d11d..c0f2ff03 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ auth.json *auth.json node node_modules +solr-data From 5bfced91b9051d450b170af4d86f59664e0ca4b5 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Fri, 28 Oct 2022 15:27:22 +0100 Subject: [PATCH 11/11] Creating data dir --- .github/workflows/solr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/solr.yml b/.github/workflows/solr.yml index 5f326ad1..0ced5577 100644 --- a/.github/workflows/solr.yml +++ b/.github/workflows/solr.yml @@ -15,7 +15,7 @@ jobs: distribution: 'temurin' cache: maven - name: Starting SOLR - run: mkdir home && chmod 777 home && docker-compose -f docker/sas-solr/docker-compose.yml --project-directory . up -d solr + run: mkdir solr-data && chmod 777 solr-data && docker-compose -f docker/sas-solr/docker-compose.yml --project-directory . up -d solr - name: checking docker run: docker ps && docker logs sas_solr