Skip to content

Commit 9fe8759

Browse files
committed
First release
1 parent 3495786 commit 9fe8759

31 files changed

+13897
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache/
2+
distrib/
3+
.project
4+
.settings/

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
6+
7+
## [unreleased]
8+
9+
10+
## 1.0.0
11+
12+
First release, aligned with Blazegraph 2.1.5
13+
14+
15+
[Unreleased]: https://bitbucket.org/linkeddatacenter/sdaas/compare/master%0D1.0.0
16+
[1.0.0]: https://bitbucket.org/linkeddatacenter/sdaas/compare/1.0.0%0D0.0.0

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2019 LinkedData.Center - All Rights Reserved
2+
# Permission to copy and modify is granted under the MIT license
3+
FROM lyrasis/blazegraph:2.1.5
4+
5+
LABEL authors="enrico@linkeddata.center"
6+
7+
USER root
8+
9+
COPY helpers/* /
10+
11+
RUN apk --no-cache add \
12+
unzip \
13+
sudo
14+
15+
# unpack and rename the blazegraph webapp
16+
RUN unzip ${JETTY_WEBAPPS}/bigdata.war -d ${JETTY_WEBAPPS}/sdaas; \
17+
rm -f ${JETTY_WEBAPPS}/bigdata.war
18+
19+
COPY html /var/lib/jetty/webapps/sdaas/
20+
CMD /sdaas-start --foreground

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Derived from the [lyrasis/blazegraph project](https://github.com/lyrasis/docker-
99

1010
```bash
1111
docker build -t sdaas-rdfstore .
12-
docker run --name blazegraph -d -p 8889:8080 sdaas-rdfstore
12+
docker run --name blazegraph -d -p 8080:8080 sdaas-rdfstore
1313
docker logs -f blazegraph
1414
```

helpers/readonly-web.xml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd"
5+
version="3.1">
6+
<display-name>Bigdata</display-name>
7+
<description>Bigdata</description>
8+
<context-param>
9+
<description>The property file (for a standalone database instance) or the
10+
jini configuration file (for a federation). The file MUST end with either
11+
".properties" or ".config". This path is relative to the directory from
12+
which you start the servlet container so you may have to edit it for your
13+
installation, e.g., by specifying an absolution path. Also, it is a good
14+
idea to review the RWStore.properties file as well and specify the location
15+
of the database file on which it will persist your data.
16+
17+
Note: You MAY override this parameter using
18+
"-Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=FILE"
19+
when starting the servlet container.
20+
</description>
21+
<!-- Note: This path is relative to the directory in which you start -->
22+
<!-- the servlet container or within the classpath as a resource. -->
23+
<!-- For the IDE, this is generally the root -->
24+
<!-- of the bigdata project. For the WAR, it depends where you start -->
25+
<!-- the servlet container. The "ant war" target rewrites this to be -->
26+
<!-- relative to the root of the servlet container by default. -->
27+
<param-name>propertyFile</param-name>
28+
<param-value>/RWStore.properties</param-value>
29+
</context-param>
30+
<context-param>
31+
<description>The default bigdata namespace of for the triple or quad store
32+
instance to be exposed.</description>
33+
<param-name>namespace</param-name>
34+
<param-value>kb</param-value>
35+
</context-param>
36+
<context-param>
37+
<description>When true a new triple or quads store instance will be created
38+
if none is found at that namespace.</description>
39+
<param-name>create</param-name>
40+
<param-value>true</param-value>
41+
</context-param>
42+
<context-param>
43+
<description>The size of the thread pool used to service SPARQL queries -OR-
44+
ZERO (0) for an unbounded thread pool.</description>
45+
<param-name>queryThreadPoolSize</param-name>
46+
<param-value>16</param-value>
47+
</context-param>
48+
<context-param>
49+
<description>When true, the REST API will not permit mutation operations.</description>
50+
<param-name>readOnly</param-name>
51+
<param-value>true</param-value>
52+
</context-param>
53+
<context-param>
54+
<description>When non-zero, the timeout for queries (milliseconds).</description>
55+
<param-name>queryTimeout</param-name>
56+
<param-value>0</param-value>
57+
</context-param>
58+
<context-param>
59+
<description>When non-zero, the timeout for the warmup period (milliseconds). The warmup period pulls in the non-leaf index pages and reduces the impact of sudden heavy query workloads on the disk and on GC. The end points are not available during the warmup period.</description>
60+
<param-name>warmupTimeout</param-name>
61+
<param-value>0</param-value>
62+
</context-param>
63+
<context-param>
64+
<description>A list of the namespaces to be exercised during the warmup period (optional). When the list is empty, all namespaces will be warmed up.</description>
65+
<param-name>warmupNamespaceList</param-name>
66+
<param-value></param-value>
67+
</context-param>
68+
<context-param>
69+
<description>The number of parallel threads to use for the warmup period. At most one thread will be used per index.</description>
70+
<param-name>warmupThreadPoolSize</param-name>
71+
<param-value>20</param-value>
72+
</context-param>
73+
<!-- <context-param>
74+
<description>List of allowed services.</description>
75+
<param-name>serviceWhitelist</param-name>
76+
<param-value>http://www.bigdata.com/rdf/search#search,http://www.bigdata.com/rdf#describe</param-value>
77+
</context-param> -->
78+
<context-param>
79+
<description>The name of the class to use for the Blueprints Servlet instance</description>
80+
<param-name>blueprintsServletProvider</param-name>
81+
<param-value>com.bigdata.blueprints.webapp.BlueprintsServlet</param-value>
82+
</context-param>
83+
<listener>
84+
<listener-class>com.bigdata.rdf.sail.webapp.BigdataRDFServletContextListener</listener-class>
85+
</listener>
86+
<servlet>
87+
<servlet-name>REST API</servlet-name>
88+
<display-name>REST API</display-name>
89+
<description>The REST API, including a SPARQL end point, as described at
90+
https://wiki.blazegraph.com/wiki/index.php/NanoSparqlServer
91+
</description>
92+
<servlet-class>com.bigdata.rdf.sail.webapp.RESTServlet</servlet-class>
93+
<load-on-startup>0</load-on-startup>
94+
<async-supported>true</async-supported>
95+
</servlet>
96+
<servlet>
97+
<servlet-name>Multi-Tenancy API</servlet-name>
98+
<display-name>Multi-Tenancy API</display-name>
99+
<description>The REST API for managing multiple KBs in a single Journal
100+
or Federation.
101+
</description>
102+
<servlet-class>com.bigdata.rdf.sail.webapp.MultiTenancyServlet</servlet-class>
103+
<async-supported>true</async-supported>
104+
</servlet>
105+
<servlet>
106+
<servlet-name>DataLoader</servlet-name>
107+
<display-name>DataLoader Servlet</display-name>
108+
<description>Servlet providing DataLoader functionality for bulk loading into
109+
a namespace.</description>
110+
<servlet-class>com.bigdata.rdf.sail.webapp.DataLoaderServlet</servlet-class>
111+
<async-supported>true</async-supported>
112+
</servlet>
113+
<servlet>
114+
<servlet-name>Backup</servlet-name>
115+
<display-name>Backup Servlet</display-name>
116+
<description>Servlet providing a REST API for creating online backups.</description>
117+
<servlet-class>com.bigdata.rdf.sail.webapp.BackupServlet</servlet-class>
118+
<async-supported>true</async-supported>
119+
</servlet>
120+
<servlet>
121+
<servlet-name>Transaction Management API</servlet-name>
122+
<display-name>Transaction Management API</display-name>
123+
<description>The REST API for managing transactions for a Journal.
124+
</description>
125+
<servlet-class>com.bigdata.rdf.sail.webapp.TxServlet</servlet-class>
126+
<async-supported>true</async-supported>
127+
</servlet>
128+
<servlet>
129+
<servlet-name>Status</servlet-name>
130+
<display-name>Status</display-name>
131+
<description>A status page.</description>
132+
<servlet-class>com.bigdata.rdf.sail.webapp.StatusServlet</servlet-class>
133+
<async-supported>true</async-supported>
134+
</servlet>
135+
<servlet>
136+
<servlet-name>Counters</servlet-name>
137+
<display-name>Performance counters</display-name>
138+
<description>Performance counters.</description>
139+
<servlet-class>com.bigdata.rdf.sail.webapp.CountersServlet</servlet-class>
140+
<async-supported>true</async-supported>
141+
</servlet>
142+
<!-- Note: The HALoadBalancerServlet is deployed from override-web.xml -->
143+
<!-- Serve anything under /html/* as a simple file. -->
144+
<servlet-mapping>
145+
<servlet-name>default</servlet-name>
146+
<url-pattern>/html/*</url-pattern>
147+
</servlet-mapping>
148+
<!-- Mapping for the default KB namespace (as configured above). -->
149+
<servlet-mapping>
150+
<servlet-name>REST API</servlet-name>
151+
<url-pattern>/sparql</url-pattern>
152+
</servlet-mapping>
153+
<!-- Mapping for access to non-default KB namespaces.
154+
<servlet-mapping>
155+
<servlet-name>REST API</servlet-name>
156+
<url-pattern>/sparql/*</url-pattern>
157+
</servlet-mapping> -->
158+
<!-- Mappings for the multi-tenancy API. -->
159+
<servlet-mapping>
160+
<servlet-name>Multi-Tenancy API</servlet-name>
161+
<url-pattern>/namespace</url-pattern>
162+
</servlet-mapping>
163+
<servlet-mapping>
164+
<servlet-name>Multi-Tenancy API</servlet-name>
165+
<url-pattern>/namespace/*</url-pattern>
166+
</servlet-mapping>
167+
<!-- Mappings for the DataLoader Servlet API. -->
168+
<servlet-mapping>
169+
<servlet-name>DataLoader</servlet-name>
170+
<url-pattern>/dataloader</url-pattern>
171+
</servlet-mapping>
172+
<!-- Mappings for the Backup Servlet API. -->
173+
<servlet-mapping>
174+
<servlet-name>Backup</servlet-name>
175+
<url-pattern>/backup</url-pattern>
176+
</servlet-mapping>
177+
<!-- Mappings for the TX API. -->
178+
<servlet-mapping>
179+
<servlet-name>Transaction Management API</servlet-name>
180+
<url-pattern>/tx</url-pattern>
181+
</servlet-mapping>
182+
<servlet-mapping>
183+
<servlet-name>Transaction Management API</servlet-name>
184+
<url-pattern>/tx/*</url-pattern>
185+
</servlet-mapping>
186+
<!-- Mapping for the status page. -->
187+
<servlet-mapping>
188+
<servlet-name>Status</servlet-name>
189+
<url-pattern>/status</url-pattern>
190+
</servlet-mapping>
191+
<!-- Mapping for the performance counters page. -->
192+
<servlet-mapping>
193+
<servlet-name>Counters</servlet-name>
194+
<url-pattern>/counters</url-pattern>
195+
</servlet-mapping>
196+
<!-- Map the initial request into the UI. -->
197+
<welcome-file-list>
198+
<welcome-file>html/index.html</welcome-file>
199+
</welcome-file-list>
200+
</web-app>

helpers/sdaas-start

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env bash
2+
# Copyright (C) 2019 LinkedData.Center - All Rights Reserved
3+
# Permission to copy and modify is granted under the MIT license
4+
5+
6+
function USAGE {
7+
>&2 cat <<-EOT
8+
Smart Data as a Service (SDaaS) platform community edition
9+
Copyright (C) 2018 http://linkeddata.center/
10+
11+
startup options:
12+
13+
--foreground
14+
execute the platform in foreground
15+
16+
--readonly
17+
disallow mutations in graph database
18+
EOT
19+
exit 1
20+
}
21+
22+
23+
### Parse command line options
24+
__parsed=$(getopt -options="" --longoptions=foreground,readonly --name "$0" -- "$@") || USAGE
25+
eval set -- "$__parsed"
26+
unset __parsed
27+
28+
FOREGROUND=0
29+
READONLY=0
30+
while true; do
31+
case "$1" in
32+
--foreground)
33+
FOREGROUND=1
34+
shift
35+
;;
36+
--readonly)
37+
READONLY=1
38+
shift
39+
;;
40+
--)
41+
shift
42+
break
43+
;;
44+
*)
45+
USAGE
46+
;;
47+
esac
48+
done
49+
50+
if [ $READONLY -eq 1 ]; then
51+
cp /readonly-web.xml ${JETTY_WEBAPPS}/sdaas/WEB-INF/web.xml
52+
else
53+
cp /writable-web.xml ${JETTY_WEBAPPS}/sdaas/WEB-INF/web.xml
54+
fi
55+
56+
STARTUP_CMD="sudo -u jetty java -jar /usr/local/jetty/start.jar STOP.PORT=28282 STOP.KEY=secret"
57+
58+
echo -n "SDaaS engine starting..."
59+
60+
if [ $FOREGROUND -eq 1 ]; then
61+
echo "Press ctrl-c to stop."
62+
cd /var/lib/jetty && $STARTUP_CMD
63+
else
64+
echo "as daemon"
65+
cd /var/lib/jetty && $STARTUP_CMD &
66+
sleep 10
67+
fi

helpers/sdaas-stop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Copyright (C) 2019 LinkedData.Center - All Rights Reserved
3+
# Permission to copy and modify is granted under the MIT license
4+
5+
cd /var/lib/jetty && sudo -u jetty java -jar /usr/local/jetty/start.jar \
6+
STOP.PORT=28282 STOP.KEY=secret --stop
7+
8+
9+
echo "SDaaS engine stopped"

0 commit comments

Comments
 (0)