diff --git a/image-opensim-herbal3d/Dockerfile-basiljs b/image-opensim-herbal3d/Dockerfile-basil similarity index 85% rename from image-opensim-herbal3d/Dockerfile-basiljs rename to image-opensim-herbal3d/Dockerfile-basil index 8e40528..8dd5cfe 100644 --- a/image-opensim-herbal3d/Dockerfile-basiljs +++ b/image-opensim-herbal3d/Dockerfile-basil @@ -1,6 +1,7 @@ # Docker container with nginx server service up a Javascript Basil viewer -FROM node:10 as built +#FROM node:latest as built +FROM node:16 as built ENV DIR=/tmp/app @@ -13,7 +14,7 @@ ENV DIR=/tmp/app RUN mkdir -p "$DIR" \ && cd "$DIR" \ && git clone https://github.com/Herbal3d/basil.git \ - && cd basil/Basiljs \ + && cd basil/Basilts \ && npm install \ && npm run build @@ -33,7 +34,7 @@ LABEL Description="Docker container for serving Basiljs" # vim \ # && rm -rf /var/lib/apt/lists/* -COPY --from=built $DIR/basil/Basiljs/dist/ /usr/share/nginx/html +COPY --from=built $DIR/basil/Basilts/dist/ /usr/share/nginx/html EXPOSE 80/tcp diff --git a/image-opensim-herbal3d/Dockerfile-herbal3d b/image-opensim-herbal3d/Dockerfile-herbal3d index 2a68925..9f10a7d 100644 --- a/image-opensim-herbal3d/Dockerfile-herbal3d +++ b/image-opensim-herbal3d/Dockerfile-herbal3d @@ -55,15 +55,14 @@ RUN mkdir -p $VERSIONDIR \ # Fetch the latest version of the OpenSimulator sources. RUN cd /home/opensim \ - && git clone --depth=1 $OS_REPO opensim \ + && git clone --depth=1 -b $OS_BRANCH --single-branch $OS_REPO opensim \ && cd $OPENSIMDIR/addon-modules/ \ + && git clone --depth=1 https://github.com/Herbal3d/HerbalCommonUtilCS.git \ && git clone --depth=1 https://github.com/Herbal3d/HerbalCommonEntitiesCS.git \ && git clone --depth=1 https://github.com/Herbal3d/HerbalTransportCS.git \ && git clone --depth=1 https://github.com/Herbal3d/Loden.git \ && git clone --depth=1 https://github.com/Herbal3d/OSAuthModule.git \ - && git clone --depth=1 https://github.com/Herbal3d/RaguOS.git \ - && cd $OPENSIMDIR \ - && git checkout $OS_BRANCH + && git clone --depth=1 https://github.com/Herbal3d/RaguOS.git # Extract version information from the fetched sources RUN cd $OPENSIMDIR \ diff --git a/image-opensim-herbal3d/build-basil.sh b/image-opensim-herbal3d/build-basil.sh index 868f9f7..1e7cef0 100755 --- a/image-opensim-herbal3d/build-basil.sh +++ b/image-opensim-herbal3d/build-basil.sh @@ -3,7 +3,6 @@ docker build \ --pull \ - --no-cache \ - -t basiljs-herbal3d \ - -f Dockerfile-basiljs \ + -t basil-herbal3d \ + -f Dockerfile-basil \ . diff --git a/image-opensim-herbal3d/build-herbal3d.sh b/image-opensim-herbal3d/build-herbal3d.sh index d5af7c5..85e5d5f 100755 --- a/image-opensim-herbal3d/build-herbal3d.sh +++ b/image-opensim-herbal3d/build-herbal3d.sh @@ -13,8 +13,9 @@ GIT_COMMIT_SHORT=$(git rev-parse --short HEAD) rm -rf temp-run-scripts cp -r ../run-scripts temp-run-scripts -# Note that the '--no-cache' is here to force refetching of the OpenSimulator git sources +# Note that the '--no-cache' can be added force refetching of the OpenSimulator git sources # --no-cache +# As of 20220320, the Prebuild needed for Herbal3d is in a branch (setting of OS_BRANCH) docker build \ --build-arg BUILD_DATE=$BUILD_DATE \ --build-arg BUILD_DAY=$BUILD_DAY \ @@ -22,6 +23,7 @@ docker build \ --build-arg OS_DOCKER_GIT_BRANCH=$GIT_BRANCH \ --build-arg OS_DOCKER_GIT_COMMIT=$GIT_COMMIT \ --build-arg OS_DOCKER_GIT_COMMIT_SHORT=$GIT_COMMIT_SHORT \ + --build-arg OS_BRANCH=prebuildnet6 \ -t opensim-herbal3d \ -f Dockerfile-herbal3d \ . diff --git a/image-opensim-herbal3d/config-include/FlotsamCache.ini b/image-opensim-herbal3d/config-include/FlotsamCache.ini deleted file mode 100644 index f93cc37..0000000 --- a/image-opensim-herbal3d/config-include/FlotsamCache.ini +++ /dev/null @@ -1,3 +0,0 @@ -; This file exists because this file is the default architecture include -; in OpenSim.ini. -; Look for the real configuration in bin/config which overlays settings. diff --git a/image-opensim-herbal3d/config-include/README b/image-opensim-herbal3d/config-include/README deleted file mode 100644 index deaba73..0000000 --- a/image-opensim-herbal3d/config-include/README +++ /dev/null @@ -1,15 +0,0 @@ -These configuration files are copied on top of the configuration -files in the OpenSimulator distribution. - -These configuration files are empty (do nothing) and thus disable -most all configuration that is standardly included by the OpenSimulator -base configuration files. - -When OpenSimulator starts up, configuration files read are thus: - Read OpenSimDefault.ini - This also includes addon-modules/*/config/*.ini - Read OpenSim.ini (an exact copy of OpenSim.ini.example) - This includes these empty files in config-include - Read config/Includes.ini - This includes the files for the actual configuration - diff --git a/image-opensim-herbal3d/config-include/Standalone.ini b/image-opensim-herbal3d/config-include/Standalone.ini deleted file mode 100644 index f93cc37..0000000 --- a/image-opensim-herbal3d/config-include/Standalone.ini +++ /dev/null @@ -1,3 +0,0 @@ -; This file exists because this file is the default architecture include -; in OpenSim.ini. -; Look for the real configuration in bin/config which overlays settings. diff --git a/image-opensim-herbal3d/config-include/StandaloneCommon.ini b/image-opensim-herbal3d/config-include/StandaloneCommon.ini deleted file mode 100644 index f93cc37..0000000 --- a/image-opensim-herbal3d/config-include/StandaloneCommon.ini +++ /dev/null @@ -1,3 +0,0 @@ -; This file exists because this file is the default architecture include -; in OpenSim.ini. -; Look for the real configuration in bin/config which overlays settings. diff --git a/image-opensim-herbal3d/config-include/osslEnable.ini b/image-opensim-herbal3d/config-include/osslEnable.ini deleted file mode 100644 index f93cc37..0000000 --- a/image-opensim-herbal3d/config-include/osslEnable.ini +++ /dev/null @@ -1,3 +0,0 @@ -; This file exists because this file is the default architecture include -; in OpenSim.ini. -; Look for the real configuration in bin/config which overlays settings. diff --git a/image-opensim-herbal3d/config-include/storage/SQLiteStandalone.ini b/image-opensim-herbal3d/config-include/storage/SQLiteStandalone.ini deleted file mode 100644 index f93cc37..0000000 --- a/image-opensim-herbal3d/config-include/storage/SQLiteStandalone.ini +++ /dev/null @@ -1,3 +0,0 @@ -; This file exists because this file is the default architecture include -; in OpenSim.ini. -; Look for the real configuration in bin/config which overlays settings. diff --git a/image-opensim-herbal3d/run-herbal3d.sh b/image-opensim-herbal3d/run-herbal3d.sh index d05646f..b2ce8b4 100755 --- a/image-opensim-herbal3d/run-herbal3d.sh +++ b/image-opensim-herbal3d/run-herbal3d.sh @@ -60,6 +60,8 @@ if [[ ! -d "$HOME/opensim-sql-data" ]] ; then chmod o+w "$HOME/opensim-sql-data" fi +# https://docs.docker.com/engine/security/userns-remap/ +# --userns-remap="opensim:opensim" docker-compose \ --file "$COMPOSEFILE" \ --project-name opensim-herbal3d \ diff --git a/image-opensim-herbal3d/scripts/NOOPENSIM b/image-opensim-herbal3d/scripts/NOOPENSIM deleted file mode 100644 index e69de29..0000000 diff --git a/image-opensim-herbal3d/scripts/bootOpenSim.sh b/image-opensim-herbal3d/scripts/bootOpenSim.sh deleted file mode 100755 index 3e4b050..0000000 --- a/image-opensim-herbal3d/scripts/bootOpenSim.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -# Run when booting the Docker file. -# Checks to see if this is the very first time in which case it -# runs the first time setup. Otherwise it just sets things running. - -export OPENSIMHOME=/home/opensim -export OPENSIMBIN=$OPENSIMHOME/opensim/bin -export OPENSIMCONFIG=$OPENSIMBIN/config - -FIRSTTIMEFLAG=$OPENSIMHOME/.firstTimeFlag - -# Some setup environment variables should have been set -for requiredEnv in "CONFIGKEY" "EXTERNAL_HOSTNAME" ; do - if [[ -z "${!requiredEnv}" ]] ; then - echo "Environment variable $requiredEnv is not set" - exit 5 - fi -done - -# If this configuration has stuff to do... -if [[ -e "$OPENSIMCONFIG/setup.sh" ]] ; then - $OPENSIMCONFIG/setup.sh -fi - -if [[ ! -e "$FIRSTTIMEFLAG" ]] ; then - # First time setup for the OpenSim running and crash checking scripts - cd "$OPENSIMHOME" - ./firstTimeSetup.sh - touch "$FIRSTTIMEFLAG" - rm -f NOOPENSIM -fi - -# Start Opensim -cd "$OPENSIMHOME" -./run.opensim.sh -while true ; do - sleep 300 - ./checkOpenSim.sh -done diff --git a/image-opensim-herbal3d/scripts/captureCrash.sh b/image-opensim-herbal3d/scripts/captureCrash.sh deleted file mode 100755 index 6d81027..0000000 --- a/image-opensim-herbal3d/scripts/captureCrash.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/bash -# Copy physics logs from usual physics log directory into -# a subdirectory of the log dir so they won't get deleted. -# Also saves the OpenSimulator log and screen files in subdir. - -DATETAG=$1 - -OPENSIMHOME=${OPENSIMHOME:-/home/opensim} - -if [[ -z "$DATETAG" ]] ; then - DATETAG=$(date +%Y%m%d.%H%M) -fi - -OPENSIMBIN=${OPENSIMBIN:-$OPENSIMHOME/opensim/bin} - -LOGDIR=$OPENSIMHOME/logs -SAVEDIR=$LOGDIR/$DATETAG - -echo "Capturing crash from $OPENSIMBIN into $SAVEDIR" - -mkdir -p $SAVEDIR - -cd $LOGDIR -for logfile in phys*.log ; do - if [[ -e "$logfile" ]] ; then - mv "$logfile" "$SAVEDIR" - fi -done -if [[ -e "$OPENSIMBIN/screenlog.0" ]] ; then - mv $OPENSIMBIN/screenlog.0 $SAVEDIR -fi -if [[ -e "$OPENSIMBIN/OpenSim.log" ]] ; then - mv $OPENSIMBIN/OpenSim.log $SAVEDIR -fi - - diff --git a/image-opensim-herbal3d/scripts/checkOldLogFiles.sh b/image-opensim-herbal3d/scripts/checkOldLogFiles.sh deleted file mode 100755 index 473d572..0000000 --- a/image-opensim-herbal3d/scripts/checkOldLogFiles.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash -# Clean out old log files in the log directory. -# Does not delete saved log directories. - -OPENSIMHOME=${OPENSIMHOME:-/home/opensim} - -TIMEAGO=${OPENSIMHOME}/.lastLogCleanup - -LOGDIR="${OPENSIMHOME}/logs" -if [[ -d "$LOGDIR" ]] ; then - rm -f "$TIMEAGO" - touch --date="-1 hours" "$TIMEAGO" - - cd "$LOGDIR" - for file in phys*.log scene-*.log ; do - if [[ -e "$file" ]] ; then - if [[ $TIMEAGO -nt "$file" ]] ; then - rm -f "$file" - fi - fi - done -fi diff --git a/image-opensim-herbal3d/scripts/checkOpenSim.sh b/image-opensim-herbal3d/scripts/checkOpenSim.sh deleted file mode 100755 index a7aba35..0000000 --- a/image-opensim-herbal3d/scripts/checkOpenSim.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/bash -# Check to see if OpenSim is running and restart if it is not - -OPENSIMHOME=${OPENSIMHOME:-/home/opensim} -OPENSIMBIN=${OPENSIMBIN:-/home/opensim/opensim/bin} - -CRASHLOG=${OPENSIMHOME}/crashlog.log -HDR="$(date +%Y%m%d%H%M):" - -LASTCRASH=${OPENSIMHOME}/.lastCrash -TIMEAGO=${OPENSIMHOME}/.lastTimeAgo - -cd - -if [[ -e "${OPENSIMHOME}/NOOPENSIM" ]] ; then - exit 5 -fi - -flag=$(ps -efa | grep SCREEN | grep OpenSimScreen) - -if [[ -z "$flag" ]] ; then - echo "$HDR Found crashed OpenSim regions" - rm -f $TIMEAGO - # If crashed last time, don't keep restarting over and over. - touch --date="-1 hours" $TIMEAGO - if [[ ! -e $LASTCRASH || $TIMEAGO -nt $LASTCRASH ]] ; then - echo "$HDR Capturing OpenSim crash" - ${OPENSIMHOME}/captureCrash.sh - rm -f $LASTCRASH - touch $LASTCRASH - fi - echo "$HDR Restarting OpenSim regions" - ${OPENSIMHOME}/run.opensim.sh -fi >> $CRASHLOG diff --git a/image-opensim-herbal3d/scripts/crontab b/image-opensim-herbal3d/scripts/crontab deleted file mode 100755 index 213b8ae..0000000 --- a/image-opensim-herbal3d/scripts/crontab +++ /dev/null @@ -1,2 +0,0 @@ -*/30 * * * * /home/opensim/checkOldLogFiles.sh - diff --git a/image-opensim-herbal3d/scripts/firstTimeSetup.sh b/image-opensim-herbal3d/scripts/firstTimeSetup.sh deleted file mode 100755 index 7202c90..0000000 --- a/image-opensim-herbal3d/scripts/firstTimeSetup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/bash -# Run the first time to setup the environment for OpenSimulator control -OPENSIMHOME=${OPENSIMHOME:-/home/opensim} -OPENSIMBIN=${OPENSIMBIN:-$OPENSIMHOME/opensim/bin} - -# Setup the crontab entry for this account so OpenSim stays running -crontab "${OPENSIMHOME}/crontab" diff --git a/image-opensim-herbal3d/scripts/run.opensim.sh b/image-opensim-herbal3d/scripts/run.opensim.sh deleted file mode 100755 index 84c9c0c..0000000 --- a/image-opensim-herbal3d/scripts/run.opensim.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash -# Runs the simulators with screen - -OPENSIMBIN=${OPENSIMBIN:-/home/opensim/opensim/bin} -cd "$OPENSIMBIN" - -rm -f screenlog.0 -rm -f *.log - -export MONO_THREADS_PER_CPU=100 -# parameters suggested by Ubit (20170526) -ulimit -s 262144 -export MONO_GC_PARAMS="soft-heap-limit=1280m,minor=split,promotion-age=14" -export MONO_ENV_OPTIONS="--desktop" - -screen -L -S OpenSimScreen -p - -d -m mono OpenSim.exe -console=basic -# screen -L -S OpenSimScreen -p - -d -m mono --profile=log:sample=cycles/100 OpenSim.exe -console=basic -# screen -L -S OpenSimScreen -p - -d -m mono --profile=log:sample=instr/100 OpenSim.exe -console=basic -# screen -L -S OpenSimScreen -p - -d -m mono --profile=log:noalloc,calls,maxframes=4 OpenSim.exe -console=basic - -# To analyze: -# mprof-report --traces output.mlpd > /tmp/frog2 -# mprof-report --reports=sample output.mlpd -# mprof-report --reports=sample --verbose output.mlpd -# mprof-report --reports=call --verbose output.mlpd - diff --git a/image-opensim-herbal3d/scripts/stopOpenSim.sh b/image-opensim-herbal3d/scripts/stopOpenSim.sh deleted file mode 100755 index e69de29..0000000 diff --git a/image-opensim-herbal3d/stop-herbal3d.sh b/image-opensim-herbal3d/stop-herbal3d.sh new file mode 100644 index 0000000..e7eb0a8 --- /dev/null +++ b/image-opensim-herbal3d/stop-herbal3d.sh @@ -0,0 +1,26 @@ +#! /bin/bash +# Stop the running opensimulator + +BASE=$(pwd) + +export CONFIG_NAME=${CONFIG_NAME:-standalone} + +# This export fakes out the environment setup script to look for files in +# build environment rather than in run environment. +export OPENSIMBIN=$BASE +source config/scripts/setEnvironment.sh +unset OPENSIMBIN + +# Use the generic docker-compose file or the one specific to the configuration if it exists +cd "$BASE" +COMPOSEFILE=./docker-compose.yml +if [[ -e "config/config-${CONFIG_NAME}/docker-compose.yml" ]] ; then + COMPOSEFILE="config/config-${CONFIG_NAME}/docker-compose.yml" +fi + +echo "Stopping configuration $CONFIG_NAME from \"$COMPOSEFILE\"" + +docker-compose \ + --file "$COMPOSEFILE" \ + --project-name opensim-standalone \ + down