Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit d592403

Browse files
committed
add scripts from semanticmedia wiki for travis
1 parent 35feb90 commit d592403

File tree

4 files changed

+352
-0
lines changed

4 files changed

+352
-0
lines changed

application/scripts/travis/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
- `install-services.sh` to handle the install of additional services
2+
3+
## SPARQL services
4+
5+
This file and scripts are taken form the SemanticMediaWiki repo and only selected files where copied for running tests with virtuoso.
6+
It is taken as of commit 721a63d3a73400300f73e0a088196a6ed0fe5afd from https://github.com/SemanticMediaWiki/SemanticMediaWiki.
7+
The unsupported services are marked with *Endabled* "No".
8+
9+
<table>
10+
<tr>
11+
<th>Endabled</th>
12+
<th>Service</th>
13+
<th>Connector</th>
14+
<th>QueryEndPoint</th>
15+
<th>UpdateEndPoint</th>
16+
<th>DataEndpoint</th>
17+
<th>DefaultGraph</th>
18+
<th>Comments</th>
19+
</tr>
20+
<tr>
21+
<th>No</th>
22+
<th>Fuseki (mem)<sup>1</sup></th>
23+
<td>Fuseki</td>
24+
<td>http://localhost:3030/db/query</td>
25+
<td>http://localhost:3030/db/update</td>
26+
<td>''</td>
27+
<td>''</td>
28+
<td>fuseki-server --update --port=3030 --mem /db</td>
29+
</tr>
30+
<tr>
31+
<th>No</th>
32+
<th>Fuseki (memTDB)</th>
33+
<td>Fuseki</td>
34+
<td>http://localhost:3030/db/query</td>
35+
<td>http://localhost:3030/db/update</td>
36+
<td>''</td>
37+
<td>http://example.org/myFusekiGraph</td>
38+
<td>fuseki-server --update --port=3030 --memTDB --set tdb:unionDefaultGraph=true /db</td>
39+
</tr>
40+
<tr>
41+
<th>Yes</th>
42+
<th>Virtuoso opensource</th>
43+
<td>Virtuoso</td>
44+
<td>http://localhost:8890/sparql</td>
45+
<td>http://localhost:8890/sparql</td>
46+
<td>''</td>
47+
<td>http://example.org/myVirtuosoGraph</td>
48+
<td>sudo apt-get install virtuoso-opensource</td>
49+
</tr>
50+
<tr>
51+
<th>No</th>
52+
<th>4store<sup>2</sup></th>
53+
<td>4store</td>
54+
<td>http://localhost:8088/sparql/</td>
55+
<td>http://localhost:8088/update/</td>
56+
<td>''</td>
57+
<td>http://example.org/myFourGraph</td>
58+
<td>apt-get install 4store</td>
59+
</tr>
60+
<tr>
61+
<th>No</th>
62+
<th>Sesame</th>
63+
<td>Custom</td>
64+
<td>http://localhost:8080/openrdf-sesame/repositories/test-smw</td>
65+
<td>http://localhost:8080/openrdf-sesame/repositories/test-smw/statements</td>
66+
<td>''</td>
67+
<td>`test-smw` is specifed as native in-memory store</td>
68+
<td></td>
69+
</tr>
70+
71+
</table>
72+
73+
<sup>1</sup> When running integration tests with [Jena Fuseki][fuseki] it is suggested that the `in-memory` option is used to avoid potential loss of production data during test execution.
74+
75+
<sup>2</sup> Currently, Travis-CI doesn't support `4Store` (1.1.4-2) as service but the following configuration has been sucessfully tested with the available test suite. ([issue #110](https://github.com/garlik/4store/issues/110) )
76+
77+
[fuseki]: https://jena.apache.org/
78+
[virtuoso]: https://github.com/openlink/virtuoso-opensource
79+
[4store]: https://github.com/garlik/4store
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
echo $TRAVIS_PHP_VERSION
4+
5+
# skip hhvm
6+
if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then
7+
exit 0
8+
fi
9+
10+
# get build dependencies
11+
sudo apt-get install -y unixODBC-dev
12+
13+
PHPVERSION=$( php -v | head -n1 | sed "s|^PHP \([0-9][0-9\.]*\).*$|\1|" | tr -d '\n' )
14+
15+
ls ~/.phpenv/versions/
16+
echo "PHPVERSION: " $PHPVERSION
17+
echo "LOADED CONFIG: " `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
18+
19+
# get php sources
20+
wget https://github.com/php/php-src/archive/php-$PHPVERSION.tar.gz
21+
ls
22+
tar -xzf php-$PHPVERSION.tar.gz
23+
24+
# build odbc extension
25+
cd php-src-php-$PHPVERSION/ext/odbc/
26+
phpize
27+
# use fix from https://github.com/docker-library/php/issues/103
28+
sed -ri 's@^ *test +"\$PHP_.*" *= *"no" *&& *PHP_.*=yes *$@#&@g' configure
29+
./configure --with-unixODBC=shared,/usr
30+
make
31+
make install
32+
33+
# enable odbc
34+
echo "extension=odbc.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
35+
36+
# build pdo_odbc
37+
cd ../pdo_odbc/
38+
phpize
39+
./configure --with-pdo-odbc=unixODBC,/usr
40+
make
41+
make install
42+
43+
#enable pdo_odbc
44+
echo "extension=pdo_odbc.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
45+
php -m
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
#!/bin/bash
2+
set -ex
3+
BASE_PATH=$(pwd)
4+
E_UNREACHABLE=86
5+
6+
# skip hhvm
7+
if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then
8+
exit 0
9+
fi
10+
11+
if [ "$FOURSTORE" != "" ] || [ "$VIRTUOSO" != "" ] || [ "$SESAME" != "" ] || [[ "$FUSEKI" == "2."* ]]
12+
then
13+
sudo apt-get update -qq
14+
fi
15+
16+
# Version 1.1.0 is available and testable on Travis/SMW
17+
if [ "$FUSEKI" != "" ]
18+
then
19+
# Archive
20+
# http://archive.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz
21+
# http://www.eu.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz
22+
23+
# Avoid ERROR 503: Service Unavailable
24+
# wget http://archive.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz
25+
26+
if [[ "$FUSEKI" == "2."* ]]
27+
then
28+
29+
# Fuseki requires Java8 for Fuseki2 v2.3.0 onwards
30+
sudo apt-get install oracle-java8-installer
31+
32+
export JAVA_HOME="/usr/lib/jvm/java-8-oracle";
33+
export PATH="$PATH:/usr/lib/jvm/java-8-oracle/bin";
34+
export java_path="/usr/lib/jvm/java-8-oracle/jre/bin/java";
35+
36+
wget https://github.com/mwjames/travis-support/raw/master/fuseki/$FUSEKI/apache-jena-fuseki-$FUSEKI.tar.gz
37+
38+
# option z caused "gzip: stdin: not in gzip format"
39+
tar -xf apache-jena-fuseki-$FUSEKI.tar.gz
40+
mv apache-jena-fuseki-$FUSEKI fuseki
41+
else
42+
wget https://github.com/mwjames/travis-support/raw/master/fuseki/$FUSEKI/jena-fuseki-$FUSEKI-distribution.tar.gz
43+
44+
tar -zxf jena-fuseki-$FUSEKI-distribution.tar.gz
45+
mv jena-fuseki-$FUSEKI fuseki
46+
fi
47+
48+
cd fuseki
49+
50+
## Start fuseki in-memory as background
51+
bash fuseki-server --update --mem /db &>/dev/null &
52+
fi
53+
54+
if [ "$SESAME" != "" ]
55+
then
56+
TOMCAT_VERSION=tomcat6
57+
sudo java -version
58+
59+
sudo apt-get install $TOMCAT_VERSION
60+
61+
CATALINA_BASE=/var/lib/$TOMCAT_VERSION
62+
CATALINA_HOME=/usr/share/$TOMCAT_VERSION
63+
64+
sudo chown $USER -R $CATALINA_BASE/
65+
sudo chmod g+rw -R $CATALINA_BASE/
66+
67+
sudo mkdir -p $CATALINA_HOME/.aduna
68+
sudo chown -R $TOMCAT_VERSION:$TOMCAT_VERSION $CATALINA_HOME
69+
70+
# One method to get the war files
71+
# wget http://search.maven.org/remotecontent?filepath=org/openrdf/sesame/sesame-http-server/$SESAME/sesame-http-server-$SESAME.war -O openrdf-sesame.war
72+
# wget http://search.maven.org/remotecontent?filepath=org/openrdf/sesame/sesame-http-workbench/$SESAME/sesame-http-workbench-$SESAME.war -O openrdf-workbench.war
73+
# cp *.war /var/lib/tomcat6/webapps/
74+
75+
# http://sourceforge.net/projects/sesame/
76+
# Unreliable sourceforge.net download
77+
# wget http://downloads.sourceforge.net/project/sesame/Sesame%202/$SESAME/openrdf-sesame-$SESAME-sdk.zip
78+
wget https://github.com/mwjames/travis-support/raw/master/sesame/$SESAME/openrdf-sesame-$SESAME-sdk.zip
79+
80+
# tar caused a lone zero block, using zip instead
81+
unzip -q openrdf-sesame-$SESAME-sdk.zip
82+
cp openrdf-sesame-$SESAME/war/*.war $CATALINA_BASE/webapps/
83+
84+
sudo service $TOMCAT_VERSION restart
85+
ps -ef | grep tomcat
86+
87+
sleep 5
88+
89+
if curl --output /dev/null --silent --head --fail "http://localhost:8080/openrdf-sesame"
90+
#if curl --output /dev/null --silent --head --fail "http://localhost:8080/openrdf-sesame/home/overview.view"
91+
then
92+
echo "openrdf-sesame service url is reachable"
93+
else
94+
echo "openrdf-sesame service url is not reachable"
95+
sudo cat $CATALINA_BASE/logs/*.log &
96+
sudo cat $CATALINA_BASE/logs/catalina.out &
97+
exit $E_UNREACHABLE
98+
fi
99+
100+
./openrdf-sesame-$SESAME/bin/console.sh < $BASE_PATH/scripts/travis/openrdf-sesame-memory-repository.txt
101+
fi
102+
103+
# Version 1.1.4-1 is available but has a problem
104+
# https://github.com/garlik/4store/issues/110
105+
# 4STORE can not be used as variable name therefore FOURSTORE
106+
if [ "$FOURSTORE" != "" ]
107+
then
108+
109+
sudo mkdir /var/lib/4store/
110+
sudo mkdir /var/lib/4store/db
111+
sudo chown $USER -R /var/lib/4store/
112+
sudo chmod g+rw -R /var/lib/4store/
113+
114+
sudo apt-get install 4store=$FOURSTORE
115+
116+
## Disabling the firewall
117+
sudo iptables -F
118+
119+
4s-backend-setup db
120+
4s-backend db
121+
122+
## Output the current process table
123+
ps auwwx | grep 4s-
124+
125+
## -D only used to check the status of the 4store instance
126+
## 4s-httpd -D -p 8088 db
127+
128+
4s-httpd -p 8088 db
129+
fi
130+
131+
# We build all Virtuoso version from scratch
132+
if [[ "$VIRTUOSO" != "" ]]
133+
then
134+
sudo apt-get install libssl-dev -q
135+
sudo apt-get install autoconf automake bison flex gawk gperf libtool -q
136+
137+
if [[ -f virtuoso-opensource/$VIRTUOSO/binsrc/virtuoso/virtuoso-t ]]
138+
then
139+
echo "use cached virtuoso-opensource"
140+
cd virtuoso-opensource/$VIRTUOSO
141+
else
142+
#git clone git://github.com/openlink/virtuoso-opensource.git
143+
#cd virtuoso-opensource
144+
#git pull origin stable/7
145+
wget --no-check-certificate -q https://github.com/openlink/virtuoso-opensource/archive/v$VIRTUOSO.zip -O virtuoso-opensource.zip
146+
147+
unzip -q virtuoso-opensource.zip
148+
rm -r virtuoso-opensource/$VIRTUOSO || true
149+
mv virtuoso-opensource-$VIRTUOSO virtuoso-opensource/$VIRTUOSO
150+
151+
cd virtuoso-opensource/$VIRTUOSO
152+
./autogen.sh
153+
154+
# --disable-all-vads: This parameter disables building all the VAD packages (tutorials, demos, etc.).
155+
# --with-readline: This parameter is used so that the system Readline library is used
156+
# --program-transform-name: Both Virtuoso and unixODBC install a program named isql. Use this parameter to rename virtuosos program to isql-v
157+
158+
./configure --program-transform-name="s/isql/isql-v/" --with-readline --disable-all-vads |& tee #configure.log
159+
160+
# Only output error and warnings
161+
make > /dev/null
162+
fi
163+
164+
# Build tree to start the automated test suite
165+
# make check
166+
167+
sudo make install
168+
169+
## For Virtuoso
170+
#export PATH=$PATH:/usr/local/virtuoso-opensource/bin
171+
172+
sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -f -c /usr/local/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini &
173+
#sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -f &
174+
175+
sleep 15
176+
177+
sudo /usr/local/virtuoso-opensource/bin/isql-v 1111 dba dba $BASE_PATH/scripts/travis/virtuoso-sparql-permission.sql
178+
179+
# configure datasource name for ODBC connection
180+
echo "[VOS]" | sudo tee -a /etc/odbc.ini > /dev/null
181+
echo "Driver=/usr/local/virtuoso-opensource/lib/virtodbc.so" | sudo tee -a /etc/odbc.ini > /dev/null
182+
echo "Description=Virtuoso OpenSource Edition" | sudo tee -a /etc/odbc.ini > /dev/null
183+
echo "Address=localhost:1111" | sudo tee -a /etc/odbc.ini > /dev/null
184+
fi
185+
186+
#@see http://wiki.blazegraph.com/wiki/index.php/NanoSparqlServer
187+
if [ "$BLAZEGRAPH" != "" ]
188+
then
189+
#sudo apt-get install tomcat6
190+
191+
#sudo chown $USER -R /var/lib/tomcat6/
192+
#sudo chmod g+rw -R /var/lib/tomcat6/
193+
194+
#sudo mkdir -p /usr/share/tomcat6/.aduna
195+
#sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6
196+
197+
# http://sourceforge.net/projects/bigdata/
198+
#wget http://downloads.sourceforge.net/project/bigdata/bigdata/$BLAZEGRAPH/bigdata.war
199+
200+
#cp bigdata.war /var/lib/tomcat6/webapps/
201+
#export JAVA_OPTS="-server -Xmx2g -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile="$BASE_PATH/scripts/travis/blazegraph-store.properties
202+
203+
#sudo service tomcat6 restart
204+
#sleep 3
205+
206+
#Using the jar
207+
# Unreliable sourceforge.net download
208+
# wget http://downloads.sourceforge.net/project/bigdata/bigdata/$BLAZEGRAPH/bigdata-bundled.jar
209+
wget https://github.com/mwjames/travis-support/raw/master/blazegraph/$BLAZEGRAPH/bigdata-bundled.jar
210+
211+
java -server -Xmx4g -Dbigdata.propertyFile=$BASE_PATH/scripts/travis/blazegraph-store.properties -jar bigdata-bundled.jar &>/dev/null &
212+
sleep 5
213+
214+
if curl --output /dev/null --silent --head --fail "http://localhost:9999/bigdata"
215+
then
216+
echo "blazegraph service url is reachable"
217+
else
218+
echo "blazegraph service url is not reachable"
219+
exit $E_UNREACHABLE
220+
fi
221+
222+
fi
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
GRANT EXECUTE ON DB.DBA.SPARQL_INSERT_DICT_CONTENT TO "SPARQL";
2+
GRANT EXECUTE ON DB.DBA.SPARQL_DELETE_DICT_CONTENT TO "SPARQL";
3+
GRANT EXECUTE ON SPARQL_DELETE_DICT_CONTENT to "SPARQL";
4+
GRANT EXECUTE ON SPARQL_DELETE_DICT_CONTENT to SPARQL_UPDATE;
5+
GRANT SPARQL_UPDATE to "SPARQL";
6+
GRANT SPARQL_SPONGE to "SPARQL";

0 commit comments

Comments
 (0)