From e517a3497eb66ba1530699880755337a11c22f52 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Mon, 11 Dec 2023 16:56:13 -0500 Subject: [PATCH 01/11] Add first draft of changing indexConfig/lockType to none --- solr/Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/solr/Dockerfile b/solr/Dockerfile index 8632f4e..2169223 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -10,6 +10,7 @@ RUN apt-get update && \ ca-certificates \ git \ wget \ + xmlstarlet \ unzip # Install Archives Space @@ -23,6 +24,13 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ wget -q https://github.com/archivesspace/archivesspace/releases/download/$ARCHIVESSPACE_VERSION/archivesspace-$ARCHIVESSPACE_VERSION.zip && \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / +RUN cp /archivesspace/solr/solrconfig.xml /archivesspace/solr/solrconfig-orig.xml + +RUN xmlstarlet edit -L \ + --subnode "//config" -t elem -n indexConfig \ + --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:none}" \ + /archivesspace/solr/solrconfig.xml + # List Archives Space Solr Conf Files RUN ls -l /archivesspace/solr From 847f5bc542f3959fe1bfd3e596872b8d03693f3e Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Tue, 12 Dec 2023 14:12:14 -0500 Subject: [PATCH 02/11] Resolve checksum verification error --- app/Dockerfile | 8 +++++++- solr/Dockerfile | 6 ++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index d04be21..fbf2c06 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -11,7 +11,8 @@ RUN apt-get update && \ git \ wget \ unzip \ - default-jdk && \ + default-jdk \ + xmlstarlet && \ rm -rf /var/lib/apt/lists/* # Install Archives Space @@ -26,6 +27,11 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / && \ mv /archivesspace/config/config.rb /archivesspace/config/config-$ARCHIVESSPACE_VERSION.rb +RUN xmlstarlet edit -L \ + --subnode "//config" -t elem -n indexConfig \ + --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:none}" \ + /archivesspace/solr/solrconfig.xml + # Install Java MySQL Connector RUN wget -q https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.30/mysql-connector-java-8.0.30.jar && \ cp /mysql-connector-java-8.0.30.jar /archivesspace/lib/ diff --git a/solr/Dockerfile b/solr/Dockerfile index 2169223..9db8f5c 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -10,8 +10,8 @@ RUN apt-get update && \ ca-certificates \ git \ wget \ - xmlstarlet \ - unzip + unzip \ + xmlstarlet # Install Archives Space RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ @@ -24,8 +24,6 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ wget -q https://github.com/archivesspace/archivesspace/releases/download/$ARCHIVESSPACE_VERSION/archivesspace-$ARCHIVESSPACE_VERSION.zip && \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / -RUN cp /archivesspace/solr/solrconfig.xml /archivesspace/solr/solrconfig-orig.xml - RUN xmlstarlet edit -L \ --subnode "//config" -t elem -n indexConfig \ --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:none}" \ From b15339066fde61b9248b845cf7f45b03751a68eb Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Wed, 13 Dec 2023 15:52:27 -0500 Subject: [PATCH 03/11] none -> single --- app/Dockerfile | 2 +- solr/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index fbf2c06..70c0449 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -29,7 +29,7 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ RUN xmlstarlet edit -L \ --subnode "//config" -t elem -n indexConfig \ - --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:none}" \ + --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml # Install Java MySQL Connector diff --git a/solr/Dockerfile b/solr/Dockerfile index 9db8f5c..e1aa6ab 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -26,7 +26,7 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ RUN xmlstarlet edit -L \ --subnode "//config" -t elem -n indexConfig \ - --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:none}" \ + --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml # List Archives Space Solr Conf Files From bed5da27b4a5127731f84aad52606a344c540823 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Wed, 13 Dec 2023 17:16:13 -0500 Subject: [PATCH 04/11] Temporarily remove version tag --- .github/workflows/build-solr-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-solr-image.yml b/.github/workflows/build-solr-image.yml index a117fd4..d8c77a8 100644 --- a/.github/workflows/build-solr-image.yml +++ b/.github/workflows/build-solr-image.yml @@ -37,7 +37,7 @@ jobs: with: context: ./solr push: true - tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-solr:${{ github.sha }}, ghcr.io/mlibrary/aspace-containerization/aspace-solr:${{ github.event.inputs.archives_space_version }}' + tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-solr:${{ github.sha }}' file: ./solr/Dockerfile build-args: | ASPACE_VERSION=${{ github.event.inputs.archives_space_version }} From 65683497fced990707ab26b929f65185da2fb7a8 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 09:53:05 -0500 Subject: [PATCH 05/11] Also temporarily remove AS release tag for app --- .github/workflows/build-app-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app-image.yml b/.github/workflows/build-app-image.yml index 27966b2..acd1956 100644 --- a/.github/workflows/build-app-image.yml +++ b/.github/workflows/build-app-image.yml @@ -37,7 +37,7 @@ jobs: with: context: ./app push: true - tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-app:${{ github.sha }}, ghcr.io/mlibrary/aspace-containerization/aspace-app:${{ github.event.inputs.archives_space_version }}' + tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-app:${{ github.sha }}' file: ./app/Dockerfile build-args: | ASPACE_VERSION=${{ github.event.inputs.archives_space_version }} From 58d9f9522ee5456e846111f97db3d3e639e9c161 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 10:56:35 -0500 Subject: [PATCH 06/11] Revert "Also temporarily remove AS release tag for app" This reverts commit 65683497fced990707ab26b929f65185da2fb7a8. --- .github/workflows/build-app-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app-image.yml b/.github/workflows/build-app-image.yml index acd1956..27966b2 100644 --- a/.github/workflows/build-app-image.yml +++ b/.github/workflows/build-app-image.yml @@ -37,7 +37,7 @@ jobs: with: context: ./app push: true - tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-app:${{ github.sha }}' + tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-app:${{ github.sha }}, ghcr.io/mlibrary/aspace-containerization/aspace-app:${{ github.event.inputs.archives_space_version }}' file: ./app/Dockerfile build-args: | ASPACE_VERSION=${{ github.event.inputs.archives_space_version }} From aa24b62894e40a0391dd8f0eee0afc11bffaa82b Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 10:56:42 -0500 Subject: [PATCH 07/11] Revert "Temporarily remove version tag" This reverts commit bed5da27b4a5127731f84aad52606a344c540823. --- .github/workflows/build-solr-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-solr-image.yml b/.github/workflows/build-solr-image.yml index d8c77a8..a117fd4 100644 --- a/.github/workflows/build-solr-image.yml +++ b/.github/workflows/build-solr-image.yml @@ -37,7 +37,7 @@ jobs: with: context: ./solr push: true - tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-solr:${{ github.sha }}' + tags: 'ghcr.io/mlibrary/aspace-containerization/aspace-solr:${{ github.sha }}, ghcr.io/mlibrary/aspace-containerization/aspace-solr:${{ github.event.inputs.archives_space_version }}' file: ./solr/Dockerfile build-args: | ASPACE_VERSION=${{ github.event.inputs.archives_space_version }} From 26f5723cc115d18b01095cddda6ce55b0a9d9e57 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 15:58:48 -0500 Subject: [PATCH 08/11] Add comments; use more verbose flag names --- app/Dockerfile | 11 ++++++++--- solr/Dockerfile | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 70c0449..cb57ea4 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -27,9 +27,14 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / && \ mv /archivesspace/config/config.rb /archivesspace/config/config-$ARCHIVESSPACE_VERSION.rb -RUN xmlstarlet edit -L \ - --subnode "//config" -t elem -n indexConfig \ - --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:single}" \ +# indexConfig/lockType is set to single in solrconfig.xml to prevent lock issues when Solr exits improperly. +# lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in +# the ArchivesSpace release's configuration. +# This change also needs to be made in the app image because the application compares +# the checksums of its and Solr's configuration files. +RUN xmlstarlet edit --inplace \ + --subnode "//config" --type elem -n indexConfig \ + --subnode "//config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml # Install Java MySQL Connector diff --git a/solr/Dockerfile b/solr/Dockerfile index e1aa6ab..3f0492f 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -24,9 +24,12 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ wget -q https://github.com/archivesspace/archivesspace/releases/download/$ARCHIVESSPACE_VERSION/archivesspace-$ARCHIVESSPACE_VERSION.zip && \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / -RUN xmlstarlet edit -L \ - --subnode "//config" -t elem -n indexConfig \ - --subnode "//config/indexConfig" -t elem -n lockType -v "\${solr.lock.type:single}" \ +# indexConfig/lockType is set to single in solrconfig.xml to prevent lock issues when Solr exits improperly. +# lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in +# the ArchivesSpace release's configuration. +RUN xmlstarlet edit --inplace \ + --subnode "//config" --type elem -n indexConfig \ + --subnode "//config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml # List Archives Space Solr Conf Files From a7bf5393b9cd0887929c0da5e3da670e8f350fde Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 16:07:28 -0500 Subject: [PATCH 09/11] Remove unnecessary leading / --- app/Dockerfile | 4 ++-- solr/Dockerfile | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index cb57ea4..12df414 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -33,8 +33,8 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ # This change also needs to be made in the app image because the application compares # the checksums of its and Solr's configuration files. RUN xmlstarlet edit --inplace \ - --subnode "//config" --type elem -n indexConfig \ - --subnode "//config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ + --subnode "/config" --type elem -n indexConfig \ + --subnode "/config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml # Install Java MySQL Connector diff --git a/solr/Dockerfile b/solr/Dockerfile index 3f0492f..3064a7b 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -28,10 +28,12 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ # lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in # the ArchivesSpace release's configuration. RUN xmlstarlet edit --inplace \ - --subnode "//config" --type elem -n indexConfig \ - --subnode "//config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ + --subnode "/config" --type elem -n indexConfig \ + --subnode "/config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml +RUN cat /archivesspace/solr/solrconfig.xml + # List Archives Space Solr Conf Files RUN ls -l /archivesspace/solr From a134a157495615897fcac60968a49511892e8cf6 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 16:31:33 -0500 Subject: [PATCH 10/11] Tweak/expand on comments for clarity --- app/Dockerfile | 3 ++- solr/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 12df414..cf8c51c 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -27,7 +27,8 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / && \ mv /archivesspace/config/config.rb /archivesspace/config/config-$ARCHIVESSPACE_VERSION.rb -# indexConfig/lockType is set to single in solrconfig.xml to prevent lock issues when Solr exits improperly. +# indexConfig/lockType is set to single in solrconfig.xml to prevent issues that occur with +# file-based locks when Solr exits improperly. # lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in # the ArchivesSpace release's configuration. # This change also needs to be made in the app image because the application compares diff --git a/solr/Dockerfile b/solr/Dockerfile index 3064a7b..19d8277 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -24,7 +24,8 @@ RUN if [ "$ASPACE_VERSION" = "latest" ]; then \ wget -q https://github.com/archivesspace/archivesspace/releases/download/$ARCHIVESSPACE_VERSION/archivesspace-$ARCHIVESSPACE_VERSION.zip && \ unzip -q /archivesspace-$ARCHIVESSPACE_VERSION.zip -d / -# indexConfig/lockType is set to single in solrconfig.xml to prevent lock issues when Solr exits improperly. +# indexConfig/lockType is set to single in solrconfig.xml to prevent issues that occur with +# file-based locks when Solr exits improperly. # lockType cannot be set via SOLR_OPTS because an indexConfig variable is not provided in # the ArchivesSpace release's configuration. RUN xmlstarlet edit --inplace \ From 5f72bc6a57aeb2a1241f80f640b79990daed17b6 Mon Sep 17 00:00:00 2001 From: Samuel Sciolla Date: Thu, 14 Dec 2023 16:38:29 -0500 Subject: [PATCH 11/11] Remove cat from testing --- solr/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/solr/Dockerfile b/solr/Dockerfile index 19d8277..92aa681 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -33,8 +33,6 @@ RUN xmlstarlet edit --inplace \ --subnode "/config/indexConfig" --type elem -n lockType --value "\${solr.lock.type:single}" \ /archivesspace/solr/solrconfig.xml -RUN cat /archivesspace/solr/solrconfig.xml - # List Archives Space Solr Conf Files RUN ls -l /archivesspace/solr