Permalink
Please sign in to comment.
Showing
with
124 additions
and 48 deletions.
- +1 −7 frameworks/CSharp/servicestack/bash_profile.sh
- +28 −0 frameworks/CSharp/servicestack/setup_nginx.sh
- +11 −0 frameworks/CSharp/servicestack/setup_xsp.sh
- +12 −0 frameworks/CSharp/servicestack/src/AppHostConfigHelper.cs
- +18 −1 frameworks/CSharp/servicestack/src/DbFactories/PostgreSqlOrmLiteConnectionFactory.cs
- +3 −1 frameworks/CSharp/servicestack/src/Model/Fortune.cs
- +1 −1 frameworks/CSharp/servicestack/src/ServiceStackBenchmark.csproj
- +39 −28 toolset/setup/linux/languages/mono.sh
- +11 −10 toolset/setup/linux/languages/xsp.sh
| @@ -1,8 +1,2 @@ | ||
| #!/bin/bash | ||
| export MONO_ROOT=${IROOT}/mono-3.6.0-install | ||
| export PATH="$MONO_ROOT/bin:$PATH" | ||
| # Needed to find Mono's shared libraries | ||
| export LD_LIBRARY_PATH="$MONO_ROOT/lib" | ||
| export NGINX_HOME=${IROOT}/nginx |
| @@ -0,0 +1,28 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| # mono environment variables | ||
| . ${IROOT}/mono.installed | ||
| sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config | ||
| sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' nginx.conf | ||
| # extra cleaning | ||
| rm -rf src/bin src/obj | ||
| xbuild src/ServiceStackBenchmark.csproj /t:Clean | ||
| xbuild src/ServiceStackBenchmark.csproj /t:Build | ||
| # one fastcgi instance for each thread | ||
| # load balanced by nginx | ||
| port_start=9001 | ||
| port_end=$(($port_start+$MAX_THREADS)) | ||
| # nginx | ||
| conf="upstream mono {\n" | ||
| for port in $(seq $port_start $port_end); do | ||
| conf+="\tserver 127.0.0.1:${port};\n" | ||
| done | ||
| conf+="}" | ||
| echo -e $conf > $TROOT/nginx.upstream.conf | ||
| $NGINX_HOME/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes ${MAX_THREADS};" | ||
| # To debug, use --printlog --verbose --loglevels=All | ||
| for port in $(seq $port_start $port_end); do | ||
| MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:${TROOT}/src --socket=tcp:127.0.0.1:$port & | ||
| done |
| @@ -0,0 +1,11 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| # mono environment variables | ||
| . ${IROOT}/mono.installed | ||
| sed -i 's|localhost|'"$DBHOST"'|g' src/Web.config | ||
| # extra cleaning | ||
| rm -rf src/bin src/obj | ||
| xbuild src/ServiceStackBenchmark.csproj /t:Clean | ||
| xbuild src/ServiceStackBenchmark.csproj /p:Configuration=Release | ||
| # xsp | ||
| MONO_OPTIONS=--gc=sgen xsp4 --port 8080 -nonstop & |
| @@ -1,30 +1,41 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| RETCODE=$(fw_exists $IROOT/mono.installed) | ||
| [ ! "$RETCODE" == 0 ] || { return 0; } | ||
| # what do we want? latest mono | ||
| # how do we want it? already compiled from packages but without sudo | ||
| # save environment | ||
| cat > $IROOT/mono.installed <<'END' | ||
| export SNAPDATE=20150102075051 | ||
| export MONO_HOME=$IROOT/mono-snapshot-$SNAPDATE | ||
| export MONO_PATH=$MONO_HOME/lib/mono/4.5 | ||
| export MONO_CFG_DIR=$MONO_HOME/etc | ||
| export PATH=$MONO_HOME/bin:$PATH | ||
| export LD_LIBRARY_PATH=$MONO_HOME/lib:$LD_LIBRARY_PATH | ||
| export PKG_CONFIG_PATH=$MONO_HOME/lib/pkgconfig:$PKG_CONFIG_PATH | ||
| END | ||
| # load environment | ||
| . $IROOT/mono.installed | ||
| # temp dir for extracting archives | ||
| TEMP=$IROOT/mono-snapshot-${SNAPDATE}-temp | ||
| # start fresh | ||
| rm -rf $TEMP && mkdir -p $TEMP | ||
| rm -rf $MONO_HOME && mkdir -p $MONO_HOME | ||
| # download .debs and extract them into $TEMP dir | ||
| fw_get http://jenkins.mono-project.com/repo/debian/pool/main/m/mono-snapshot-${SNAPDATE}/mono-snapshot-${SNAPDATE}_${SNAPDATE}-1_amd64.deb | ||
| fw_get http://jenkins.mono-project.com/repo/debian/pool/main/m/mono-snapshot-${SNAPDATE}/mono-snapshot-${SNAPDATE}-assemblies_${SNAPDATE}-1_all.deb | ||
| dpkg-deb -x mono-*amd64.deb $TEMP | ||
| dpkg-deb -x mono-*assemblies*.deb $TEMP | ||
| # move /opt/mono-$SNAPDATE to /installs | ||
| mv $TEMP/opt/mono-*/* $MONO_HOME | ||
| # cleanup | ||
| rm mono-*.deb | ||
| rm -rf $TEMP | ||
| # replace /opt/mono-$SNAPDATE path | ||
| file $MONO_HOME/bin/* | grep "POSIX shell script" | awk -F: '{print $1}' | xargs sed -i "s|/opt/mono-$SNAPDATE|$MONO_HOME|g" | ||
| sed -i "s|/opt/mono-$SNAPDATE|$MONO_HOME|g" $MONO_HOME/lib/pkgconfig/*.pc $MONO_HOME/etc/mono/config | ||
| # import SSL certificates | ||
| mozroots --import --sync | ||
| #echo -e 'y\ny\ny\n' | certmgr -ssl https://nuget.org | ||
| set -x | ||
| RETCODE=$(fw_exists ${IROOT}/mono.installed) | ||
| [ ! "$RETCODE" == 0 ] || { \ | ||
| echo "Installing RootCAs from Mozilla..."; | ||
| sudo $IROOT/mono-3.6.0-install/bin/mozroots --import --sync; | ||
| return 0; } | ||
| sudo apt-get install -y build-essential \ | ||
| autoconf \ | ||
| automake \ | ||
| libtool \ | ||
| zlib1g-dev \ | ||
| pkg-config \ | ||
| gettext | ||
| fw_get http://download.mono-project.com/sources/mono/mono-3.6.0.tar.bz2 -O mono-3.6.0.tar.bz2 | ||
| fw_untar mono-3.6.0.tar.bz2 | ||
| cd mono-3.6.0 | ||
| ./autogen.sh --prefix=${IROOT}/mono-3.6.0-install | ||
| make -j4 EXTERNAL_MCS=${IROOT}/mono-3.6.0/mcs/class/lib/monolite/basic.exe | ||
| make install | ||
| echo "Installing RootCAs from Mozilla..."; | ||
| sudo ${IROOT}/mono-3.6.0-install/bin/mozroots --import --sync; | ||
| touch ${IROOT}/mono.installed | ||
| touch $IROOT/mono.installed |
| @@ -1,18 +1,19 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| RETCODE=$(fw_exists ${IROOT}/xsp.installed) | ||
| [ ! "$RETCODE" == 0 ] || { return 0; } | ||
| fw_depends mono | ||
| # mono environment variables | ||
| . ${IROOT}/mono.installed | ||
| # get | ||
| git clone git://github.com/mono/xsp | ||
| cd xsp | ||
| git checkout 8a31bc625727594d42f94173768bee5cf8afd0a4 | ||
| export PKG_CONFIG_PATH=${IROOT}/mono-3.6.0-install/lib/pkgconfig | ||
| export PATH=${IROOT}/mono-3.6.0-install/bin:$PATH | ||
| ./autogen.sh --prefix=${IROOT}/mono-3.6.0-install | ||
| git checkout e272a2c006211b6b03be2ef5bbb9e3f8fefd0768 | ||
| # build | ||
| ./autogen.sh --prefix=${MONO_HOME} --disable-docs | ||
| make | ||
| make install | ||
| touch ${IROOT}/xsp.installed | ||
| # cleanup | ||
| cd .. | ||
| rm -rf xsp | ||
| touch ${IROOT}/xsp.installed |
0 comments on commit
a2b252a