Update image-opensim-herbal3d to build using new organization

This commit is contained in:
Robert Adams
2022-03-20 17:39:40 -04:00
parent 216c4a6962
commit ed7420ebb0
21 changed files with 40 additions and 207 deletions
@@ -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
+3 -4
View File
@@ -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 \
+2 -3
View File
@@ -3,7 +3,6 @@
docker build \
--pull \
--no-cache \
-t basiljs-herbal3d \
-f Dockerfile-basiljs \
-t basil-herbal3d \
-f Dockerfile-basil \
.
+3 -1
View File
@@ -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 \
.
@@ -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.
@@ -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
@@ -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.
@@ -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.
@@ -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.
@@ -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.
+2
View File
@@ -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 \
@@ -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
@@ -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
@@ -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
@@ -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
-2
View File
@@ -1,2 +0,0 @@
*/30 * * * * /home/opensim/checkOldLogFiles.sh
@@ -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"
@@ -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
+26
View File
@@ -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