From 05df4aa20d3b0fd16f47742a7f657591799938a0 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Wed, 23 Aug 2023 11:43:03 -0300 Subject: [PATCH] Configure the extent to be in Unicode comparison mode --- docs/README.md | 6 ++++-- docs/how-to/how-to-load-rowan-project.md | 2 +- docs/how-to/how-to-run-tests.md | 2 +- source/Dockerfile | 6 ++++-- source/configure.sh | 21 +++++++++++++++++++++ source/load-rowan-project.sh | 2 +- source/run-tests.sh | 2 +- source/start-gemstone.sh | 8 ++++++-- 8 files changed, 39 insertions(+), 10 deletions(-) create mode 100755 source/configure.sh diff --git a/docs/README.md b/docs/README.md index 64cc45b..37af7e6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,9 +13,11 @@ You can configure some things with environment variables: - `STONE_PORT` Stone service port. Defaults to `50385` - `GEMSTONE_NRS_ALL` Defaults to `#netldi:gs64ldi#dir:/opt/gemstone/logs/#log:/opt/gemstone/logs/%N_%P.log` - `GS_FORCE_CLEAN_LOG_FILE_DELETE` Defaults to `true` -- `DATA_CURATOR_PASSWORD` Password of the `DataCurator` user, used for stopping +- `GS64_DATA_CURATOR_PASSWORD` Password of the `DataCurator` user, used for stopping the services. Defaults to `swordfish`. -- `STOPSTONE_TIMEOUT_SECONDS` time-out in seconds to wait for `stopstone` +- `GS64_SYSTEM_USER_PASSWORD` Password of the `SystemUser` user, used for configuring + the Unicode comparison mode in the repository. Defaults to `swordfish`. +- `GS64_STOPSTONE_TIMEOUT_SECONDS` time-out in seconds to wait for `stopstone` command to finish. Defaults to 8 ## Important directories and files diff --git a/docs/how-to/how-to-load-rowan-project.md b/docs/how-to/how-to-load-rowan-project.md index f945fad..7f08eee 100644 --- a/docs/how-to/how-to-load-rowan-project.md +++ b/docs/how-to/how-to-load-rowan-project.md @@ -17,5 +17,5 @@ The script supports the following configuration: the project to load - `GS64_CI_SPEC` is optional. It's the name of the spec file to load. Defaults to `${GS64_CI_PROJECT_NAME}-CI` -- `GS64_CI_SYSTEM_USER_PASSWORD` is optional. The password for the `SystemUser` +- `GS64_SYSTEM_USER_PASSWORD` is optional. The password for the `SystemUser` account in the mounted extent. Defaults to `swordfish`. diff --git a/docs/how-to/how-to-run-tests.md b/docs/how-to/how-to-run-tests.md index bab6596..47c866f 100644 --- a/docs/how-to/how-to-run-tests.md +++ b/docs/how-to/how-to-run-tests.md @@ -11,5 +11,5 @@ docker exec -it examples-stone-1 ./run-tests.sh Buoy The script supports the following configuration: - The only accepted script argument is the rowan-aware project name -- `GS64_CI_SYSTEM_USER_PASSWORD` is optional. The password for the `SystemUser` +- `GS64_SYSTEM_USER_PASSWORD` is optional. The password for the `SystemUser` account in the mounted extent. Defaults to `swordfish`. diff --git a/source/Dockerfile b/source/Dockerfile index 1f997c4..a903176 100644 --- a/source/Dockerfile +++ b/source/Dockerfile @@ -99,13 +99,14 @@ ENV NETLDI_PORT=50384 ENV STONE_SERVICE_NAME=gs64stone ENV STONE_PORT=50385 -ENV DATA_CURATOR_PASSWORD=swordfish +ENV GS64_DATA_CURATOR_PASSWORD=swordfish +ENV GS64_SYSTEM_USER_PASSWORD=swordfish # By default `docker stop` will wait 10 seconds for the container to handle # SIGTERM signals, after the grace period docker will send a SIGKILL. # By default we wait 8 seconds to allow a clean shutdown of the Stone. # If your installation needs a greater timeout change the docker wait time # and this timet-out in consequence -ENV STOPSTONE_TIMEOUT_SECONDS=8 +ENV GS64_STOPSTONE_TIMEOUT_SECONDS=8 ENV GS_FORCE_CLEAN_LOG_FILE_DELETE=true ENV GEMSTONE_NRS_ALL=#netldi:$NETLDI_SERVICE_NAME#dir:$GEMSTONE_LOG_DIR/#log:$GEMSTONE_LOG_DIR/%N_%P.log @@ -139,6 +140,7 @@ RUN apt-get update \ ENV ROWAN_PROJECTS_HOME=${GEMSTONE_GLOBAL_DIR}/projects RUN install -d --owner=${GS_USER} --group=users ${ROWAN_PROJECTS_HOME} +COPY --chown=${GS_USER}:users configure.sh ${GEMSTONE_GLOBAL_DIR}/configure.sh COPY --chown=${GS_USER}:users load-rowan-project.sh ${GEMSTONE_GLOBAL_DIR}/load-rowan-project.sh COPY --chown=${GS_USER}:users run-tests.sh ${GEMSTONE_GLOBAL_DIR}/run-tests.sh COPY --chown=${GS_USER}:users StdOutPrinter.gs ${GEMSTONE_GLOBAL_DIR}/StdOutPrinter.gs diff --git a/source/configure.sh b/source/configure.sh new file mode 100755 index 0000000..38e66f1 --- /dev/null +++ b/source/configure.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +readonly SYSTEM_USER_PASSWORD="${GS64_SYSTEM_USER_PASSWORD:-swordfish}" + +echo "Configuring GS Repository..." + +topaz -i -q < "${GEMSTONE_LOG_DIR}/configuring-repository.log" +set gemstone gs64stone user SystemUser pass ${SYSTEM_USER_PASSWORD} +iferror exit 1 +login +doit +StringConfiguration enableUnicodeComparisonMode +% +commit +logout +exit 0 +EOF + +echo "Configuring GS Repository... [FINISHED]" diff --git a/source/load-rowan-project.sh b/source/load-rowan-project.sh index b7afecf..3530d1f 100755 --- a/source/load-rowan-project.sh +++ b/source/load-rowan-project.sh @@ -17,7 +17,7 @@ else readonly LRP_LOAD_SPEC="${GS64_CI_SPEC:-${LRP_PROJECT_NAME}-CI}" fi -readonly SYSTEM_USER_PASSWORD="${GS64_CI_SYSTEM_USER_PASSWORD:-swordfish}" +readonly SYSTEM_USER_PASSWORD="${GS64_SYSTEM_USER_PASSWORD:-swordfish}" echo "Loading code in GS..." echo " Project Name: ${LRP_PROJECT_NAME}" diff --git a/source/run-tests.sh b/source/run-tests.sh index 970c54e..aa73fe1 100755 --- a/source/run-tests.sh +++ b/source/run-tests.sh @@ -3,7 +3,7 @@ set -e readonly PROJECT_NAME=$1 -readonly SYSTEM_USER_PASSWORD="${GS64_CI_SYSTEM_USER_PASSWORD:-swordfish}" +readonly SYSTEM_USER_PASSWORD="${GS64_SYSTEM_USER_PASSWORD:-swordfish}" echo "Running ${PROJECT_NAME} tests..." diff --git a/source/start-gemstone.sh b/source/start-gemstone.sh index bee78bb..33c5734 100755 --- a/source/start-gemstone.sh +++ b/source/start-gemstone.sh @@ -9,10 +9,10 @@ sigterm_handler() { stopnetldi stopstone \ -i \ - -t "${STOPSTONE_TIMEOUT_SECONDS}" \ + -t "${GS64_STOPSTONE_TIMEOUT_SECONDS}" \ "$STONE_SERVICE_NAME" \ DataCurator \ - "${DATA_CURATOR_PASSWORD}" + "${GS64_DATA_CURATOR_PASSWORD}" exit 143; # 128 + 15 -- SIGTERM } @@ -43,6 +43,10 @@ startstone \ # list GemStone servers gslist -cvl +# Configure GS repository + +"${GEMSTONE_GLOBAL_DIR}"/configure.sh + # wait forever, (loop to handle multiple signals if needed) while true do