Skip to content

Commit

Permalink
Merge pull request #54 from ba-st/sunit_extensions
Browse files Browse the repository at this point in the history
Add Dependent-SUnit-Extensions component for GS64
  • Loading branch information
gcotelli authored Jan 16, 2024
2 parents 17dad7c + 83f2162 commit 3995d77
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 64 deletions.
1 change: 1 addition & 0 deletions .github/workflows/loading-gs64-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
matrix:
load-spec:
- Deployment
- Dependent-SUnit-Extensions
name: GS64 + ${{ matrix.load-spec }}
steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion docker/gs64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM ghcr.io/ba-st/gs64-gem:v3.7.0

COPY --chown=gemstone:users ./launchpad* ./
COPY --chown=gemstone:users ./command-line-handler.tpz ./command-line-handler.tpz
USER root
RUN set -eu; \
ln -s /opt/gemstone/launchpad /usr/local/bin/launchpad; \
ln -s /opt/gemstone/launchpad-gem /usr/local/bin/launchpad-gem; \
chmod a+x /usr/local/bin/launchpad*; \
true
USER ${GS_USER}
56 changes: 41 additions & 15 deletions docker/gs64/launchpad
Original file line number Diff line number Diff line change
@@ -1,19 +1,45 @@
#!/usr/bin/env bash

echo "${NETLDI_SERVICE_NAME} ${NETLDI_PORT}/tcp # GemStone - Netldi" >> /etc/services

# Ensure write permissions
NEED_WRITE_PERMISSION=(
"${GEMSTONE_GLOBAL_DIR}/locks/"
"${GEMSTONE_LOG_DIR}/"
)

for path in "${NEED_WRITE_PERMISSION[@]}"; do
if ! gosu "${GS_USER}" test -w "$path"; then
chown "${GS_UID}:${GS_GID}" "$path"
chmod ug+w "$path"
# Prepare Launchpad topaz input script
readonly SYSTEM_USER_PASSWORD="${GS64_SYSTEM_USER_PASSWORD:-swordfish}"
readonly STONE_NAME="${GS64_STONE_SERVICE_NAME:-gs64stone}"

set -e
readonly LAUNCHPAD_TOPAZ_SCRIPT="${GEMSTONE_GLOBAL_DIR}/launchpad-start.tpz"
set +o histexpand
echo "set gemstone !@${GS64_STONE_HOSTNAME}!${STONE_NAME} user SystemUser pass ${SYSTEM_USER_PASSWORD}" >> "${LAUNCHPAD_TOPAZ_SCRIPT}"
set -o histexpand

pid=0

termination_handler() {
exit_status=0
if [ $pid -ne 0 ]; then
echo 'SIGTERM received, shutting down the gem'
kill "$pid"
stopnetldi
wait "$pid"
exit_status=$?
fi
done
exit "$exit_status"
}

trap 'termination_handler' SIGTERM

# shellcheck disable=SC2086
startnetldi \
-g \
-a "${GS_USER}" \
-n \
-P "${NETLDI_PORT}" \
-l "${GEMSTONE_LOG_DIR}/${NETLDI_SERVICE_NAME}.log" \
-D "${GEMSTONE_LOG_DIR}" \
${NETLDI_ARGS:-} \
"${NETLDI_SERVICE_NAME}" >> "${GEMSTONE_LOG_DIR}/startnetldi.log"

# list GemStone services
gslist -cvl >> "${GEMSTONE_LOG_DIR}/startnetldi.log"

# Run as GS_USER
exec gosu "${GS_USER}" "${GEMSTONE_GLOBAL_DIR}/launchpad-gem" "$@"
topaz -l -q -I "${LAUNCHPAD_TOPAZ_SCRIPT}" -S "${GEMSTONE_GLOBAL_DIR}/command-line-handler.tpz" -- launchpad "$@" &
pid="$!"
wait "$pid"
45 changes: 0 additions & 45 deletions docker/gs64/launchpad-gem

This file was deleted.

20 changes: 20 additions & 0 deletions rowan/components/Dependent-SUnit-Extensions.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
RwSimpleProjectLoadComponentV2 {
#name : 'Dependent-SUnit-Extensions',
#condition : 'sunit',
#projectNames : [ ],
#componentNames : [
'Deployment'
],
#packageNames : [
'Launchpad-SUnit'
],
#conditionalPackageMapSpecs : {
'gemstone' : {
'allusers' : {
#packageNameToPlatformPropertiesMap : {
'Launchpad-SUnit' : { 'symbolDictName' : 'Launchpad' }
}
}
}
}
}
5 changes: 2 additions & 3 deletions rowan/components/Tests.ston
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ RwSimpleProjectLoadComponentV2 {
#condition : 'tests',
#projectNames : [ ],
#componentNames : [
'Deployment'
'Deployment',
'Dependent-SUnit-Extensions'
],
#packageNames : [
'Launchpad-Applications-Tests',
'Launchpad-Commands-Tests',
'Launchpad-Configuration-Tests',
'Launchpad-Examples',
'Launchpad-GS64-Extensions-Tests',
'Launchpad-SUnit',
'Launchpad-Tracing-Tests'
],
#conditionalPackageMapSpecs : {
Expand All @@ -23,7 +23,6 @@ RwSimpleProjectLoadComponentV2 {
'Launchpad-Configuration-Tests' : { 'symbolDictName' : 'Launchpad' },
'Launchpad-Examples' : { 'symbolDictName' : 'Launchpad' },
'Launchpad-GS64-Extensions-Tests' : { 'symbolDictName' : 'Launchpad' },
'Launchpad-SUnit' : { 'symbolDictName' : 'Launchpad' },
'Launchpad-Tracing-Tests' : { 'symbolDictName' : 'Launchpad' }
}
}
Expand Down
13 changes: 13 additions & 0 deletions rowan/specs/Launchpad-Dependent-SUnit-Extensions.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
RwLoadSpecificationV2 {
#specName: 'Launchpad-Dependent-SUnit-Extensions',
#projectName : 'Launchpad',
#diskUrl : 'Launchpad',
#projectSpecFile : 'rowan/project.ston',
#componentNames : [
'Dependent-SUnit-Extensions'
],
#customConditionalAttributes : [
'tests',
'sunit'
]
}

0 comments on commit 3995d77

Please sign in to comment.