Skip to content

Commit 52ac769

Browse files
ecowConfiguration Manager
andauthored
Dev 2.1.3 (#5)
* small refactory * ready to push to docker hub Co-authored-by: Configuration Manager <admin@linkeddata.center>
1 parent 3b432ec commit 52ac769

File tree

8 files changed

+146
-495
lines changed

8 files changed

+146
-495
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
66
## [unreleased]
77

88

9+
## [2.1.3]
10+
11+
### Changed
12+
13+
- using Jetty Override for readonly setup
14+
- cleanedup dockerfile
15+
16+
### Removed
17+
18+
- readonly-web.xml and writable-web.xml
19+
20+
### Added
21+
22+
- readonly.xml
23+
924
## [2.1.2]
1025

1126
### Fixed

Dockerfile

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,53 @@
22
# Permission to copy and modify is granted under the MIT license
33
FROM bash as build-stage
44

5-
ENV BLAZEGRAPH_VERSION_URL https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_2_1_6_RC/blazegraph.war
6-
75
RUN apk --no-cache add unzip
86

9-
RUN apk add --no-cache openssl && \
10-
apk add --no-cache su-exec && \
11-
wget -O /blazegraph.war $BLAZEGRAPH_VERSION_URL
12-
13-
# unpack and rename the blazegraph webapp
14-
RUN unzip /blazegraph.war -d /sdaas
7+
RUN wget -O /blazegraph.war https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_2_1_6_RC/blazegraph.war ;\
8+
unzip /blazegraph.war -d /sdaas
159

1610
### production stage ###
1711
FROM jetty:9.4-jdk13-slim
1812

1913
LABEL authors="enrico@linkeddata.center"
2014

21-
COPY helpers/sdaas-st* /
22-
COPY helpers/*.xml ${JETTY_BASE}/
23-
COPY --from=build-stage /sdaas ${JETTY_BASE}/webapps/sdaas
15+
USER root
16+
17+
ENV SDAAS_STORE_NAME=rdfStore
18+
ENV SDAAS_STORE_LOG=/var/log/${SDAAS_STORE_NAME}
19+
ENV SDAAS_STORE_WAR=/opt/${SDAAS_STORE_NAME}
20+
ENV SDAAS_STORE_DATA=/var/lib/${SDAAS_STORE_NAME}
21+
22+
####### Create dirs
23+
RUN mkdir -p "${SDAAS_STORE_WAR}" "${SDAAS_STORE_DATA}" "${SDAAS_STORE_LOG}" ; \
24+
chown -R jetty.jetty "${SDAAS_STORE_WAR}" "${SDAAS_STORE_DATA}" "${SDAAS_STORE_LOG}"
25+
26+
####### Install war
27+
COPY --from=build-stage /sdaas ${SDAAS_STORE_WAR}
28+
COPY helpers/sdaas-template.xml ${JETTY_BASE}/webapps/sdaas.xml
29+
RUN sed -i \
30+
-e "s|__SDAAS_STORE_WAR__|${SDAAS_STORE_WAR}|g" \
31+
"${JETTY_BASE}/webapps/sdaas.xml" ; \
32+
chown jetty.jetty "${JETTY_BASE}/webapps/sdaas.xml"
33+
34+
####### Configure the override template for war.xml
35+
COPY helpers/readonly-template.xml "${JETTY_BASE}/readonly-template.xml"
36+
RUN chown jetty.jetty "${JETTY_BASE}/readonly-template.xml"
2437

25-
USER root
38+
####### Configure RWStore.properties file
39+
RUN sed "s|^com\.bigdata.journal\.AbstractJournal\.file=.*|com.bigdata.journal.AbstractJournal.file=${SDAAS_STORE_DATA}/${SDAAS_STORE_NAME}.jnl|" \
40+
"${SDAAS_STORE_WAR}/WEB-INF/RWStore.properties" \
41+
> "${JETTY_BASE}/RWStore.properties" ; \
42+
chown jetty.jetty "${JETTY_BASE}/RWStore.properties"
43+
44+
45+
####### Configure startups scrips
46+
COPY helpers/sdaas-st* /
2647
RUN chown jetty.jetty /sdaas-st* ; \
27-
chmod +rx /sdaas-st* ; \
28-
chown jetty.jetty ${JETTY_BASE}/webapps/sdaas/WEB-INF/web.xml ;
29-
USER jetty
48+
chmod +rx /sdaas-st*
49+
3050

51+
52+
USER jetty
3153
ENTRYPOINT ["/sdaas-start"]
3254
CMD ["--size", "micro"]

README.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,50 @@
11
![logo](http://linkeddata.center/resources/v4/logo/Logo-colori-trasp_oriz-640x220.png)
22

33
# sdaas-rdfstore
4-
Run a dockerized blazegraph instance certified for sdaas
4+
A dockerized blazegraph instance certified for sdaas
55

6-
Derived from the [lyrasis/blazegraph project](https://github.com/lyrasis/docker-blazegraph)
6+
The sdaas-rdfstore requires [docker](https://www.docker.com/)
77

88

9-
## Quickstart
10-
11-
Build local image:
9+
## Build local image
1210

1311
docker build -t sdaas-rdfstore .
1412

15-
Launch as a daemon:
16-
13+
## Smoke tests
14+
15+
docker run --rm -ti --entrypoint bash sdaas-rdfstore
16+
/sdaas-start -d --size small --readonly || echo KO
17+
sleep 10 # some time to warmup
18+
test -f /var/log/rdfStore/rdfStore.log || echo KO
19+
test -f /var/lib/rdfStore/rdfStore.jnl || echo KO
20+
/sdaas-stop || echo KO
21+
exit
22+
1723
docker run --name gdaas -d -p 8080:8080 sdaas-rdfstore
1824
docker logs -f gdaas
25+
# point browser to http://localhost:8080/sdaas to see workbench interface
26+
#..press ctrl-c to exit logs
27+
docker rm -f gdaas
1928

29+
## sdaas-start options
2030

21-
Interactive section:
31+
To print sdaas-start usage: `docker run --rm -t sdaas-rdfstore --help`
2232

23-
docker run --rm -ti -p 8080:8080 --entrypoint bash sdaas-rdfstore
24-
/sdaas-start
25-
/sdaas-stop
26-
exit
27-
28-
sdaas-start options:
29-
30-
-d, --background
31-
execute the platform as a daemon
32-
33-
--readonly
34-
disallow mutations in graph database
35-
36-
--size micro|small|medium|large|xlarge|xxlarge|custom
33+
Smart Data as a Service (SDaaS) knowledge graph engine
34+
Copyright (C) 2018-2020 http://linkeddata.center/
35+
36+
startup options:
37+
38+
-d, --background
39+
execute the platform as a daemon
40+
41+
--readonly
42+
disallow mutations in graph database
43+
44+
--size micro|small|medium|large|xlarge|xxlarge|custom
3745

3846

39-
memory footprints and performances related to size
47+
memory footprints and performances related to size:
4048

4149
| size value | required RAM | edges (triples) |
4250
|------------------|--------------|-----------------|
@@ -55,6 +63,8 @@ The *custom* size let to you setting up proper configurations, see https://githu
5563

5664
To persist data and improve performances, you should mount as a fast volume the directory /var/lib/sdaas
5765

66+
67+
5868
## Push to docker hub
5969

6070
To push a new docker image to docker hub:

helpers/readonly-template.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
<context-param>
7+
<description>When true, the REST API will not permit mutation operations.</description>
8+
<param-name>readOnly</param-name>
9+
<param-value>__READONLY__</param-value>
10+
</context-param>
11+
</web-app>

0 commit comments

Comments
 (0)