Commit ef2f67fd authored by Petter Goksøyr Åsen's avatar Petter Goksøyr Åsen Committed by Magnus Westergaard
Browse files

WIP integrate sibyl

Deprecate koha-indexer
parent 6302a6b1
......@@ -108,14 +108,24 @@ services:
MYSQL_PASSWORD: "${KOHA_ADMINPASS:-secret}"
MYSQL_ROOT_PASSWORD: "${KOHA_ADMINPASS:-secret}"
MYSQL_USER: "${KOHA_ADMINUSER:-admin}"
SIBYL_USER: "${SIBYL_USER:-admin}"
SIBYL_PASSWORD: "${SIBYL_PASSWORD:-admin}"
volumes:
- "koha_mysql_data:/var/lib/mysql"
#- ./setup_sibyl.sql:/docker-entrypoint-initdb.d/setup_sibyl.sql
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "2"
sibyl:
depends_on:
- koha_mysql
image: alpine
command:
- "sh -c 'sleep 100"
catalinker:
container_name: catalinker
image: "digibib/redef-catalinker:${GITREF}"
......@@ -150,6 +160,7 @@ services:
KOHA_API_PASS: "${KOHA_API_PASS:-secret}"
GITREF: "${GITREF:-0}"
BUILD_TAG: "${BUILD_TAG:-0}"
ELASTICSEARCH_URL: "sibyl:1666"
logging:
driver: "json-file"
options:
......@@ -264,27 +275,27 @@ services:
max-size: "1m"
max-file: "2"
koha_indexer:
container_name: koha_indexer
image: "digibib/koha-indexer:8fe76d382ea8333a7392a7c6f22ae181da28fd99"
networks:
- backend
command:
- "/koha-indexer"
- "-db=/var/lib/state/koharecords.db"
- "-sparql=http://fuseki:3030/ds/update"
- "-freq=15m"
- "-update"
- "-initial-import"
- "-services=http://services:8005/search/publication/reindex"
environment:
KOHA_ADMINPASS: "${KOHA_ADMINPASS:-secret}"
KOHA_ADMINUSER: "${KOHA_ADMINUSER:-admin}"
KOHA_INSTANCE: "${KOHA_INSTANCE:-name}"
volumes:
- "koha_state:/var/lib/state"
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "2"
# koha_indexer:
# container_name: koha_indexer
# image: "digibib/koha-indexer:8fe76d382ea8333a7392a7c6f22ae181da28fd99"
# networks:
# - backend
# command:
# - "/koha-indexer"
# - "-db=/var/lib/state/koharecords.db"
# - "-sparql=http://fuseki:3030/ds/update"
# - "-freq=15m"
# - "-update"
# - "-initial-import"
# - "-services=http://services:8005/search/publication/reindex"
# environment:
# KOHA_ADMINPASS: "${KOHA_ADMINPASS:-secret}"
# KOHA_ADMINUSER: "${KOHA_ADMINUSER:-admin}"
# KOHA_INSTANCE: "${KOHA_INSTANCE:-name}"
# volumes:
# - "koha_state:/var/lib/state"
# logging:
# driver: "json-file"
# options:
# max-size: "1m"
# max-file: "2"
......@@ -29,6 +29,8 @@ services:
ports:
- "8005:8005"
- "5070:5070"
extra_hosts:
- "sibyl:10.172.3.100"
environment:
KOHA_MYSQL_USER: "${KOHA_ADMINUSER:-admin}"
KOHA_MYSQL_PASS: "${KOHA_ADMINPASS:-secret}"
......@@ -42,6 +44,8 @@ services:
volumes:
- "${MOUNTPATH:-..}/redef/patron-client/src:/usr/src/app/src"
- "${MOUNTPATH:-..}/redef/patron-client/test:/usr/src/app/test"
extra_hosts:
- "sibyl:10.172.3.100"
ports:
- "8000:8000"
- "35729:35729"
......@@ -132,6 +136,6 @@ services:
- "-c"
- "mkfifo pipe; while true ; do { read line<pipe;echo -e 'HTTP/1.1 200 OK\\r\\n' ; } | nc -l -p 9999 > pipe; done"
koha_indexer:
ports:
- "8009:8009"
# koha_indexer:
# ports:
# - "8009:8009"
CREATE DATABASE IF NOT EXISTS sibyl;
GRANT ALL ON sibyl.* TO '$SIBYL_USER'@'%' IDENTIFIED BY '$SIBYL_PASSWORD';
......@@ -35,7 +35,7 @@ module.exports = (app) => {
app.get('/q', (request, response) => {
const queryString = request.originalUrl.substr(request.originalUrl.indexOf('?') + 1)
fetch('http://elasticsearch:9200/search/work/_search', {
fetch('http://sibyl:1666/search/work/_search', {
method: 'POST',
body: JSON.stringify(searchBuilder.buildQuery(queryString), null, 2)
}).then(res => {
......
......@@ -36,7 +36,7 @@ public final class App {
private Server jettyServer;
private String kohaPort;
private boolean inMemoryRDFRepository;
private String elasticSearchUrl = System.getProperty("ELASTICSEARCH_URL", "http://elasticsearch:9200");
private String elasticSearchUrl = System.getProperty("ELASTICSEARCH_URL", "http://sibyl:1666");
private String z3950Endpoint;
public App(int port, String kohaPort, boolean inMemoryRDFRepository, String z3950Endpoint) {
......
......@@ -37,7 +37,7 @@ public abstract class ResourceBase {
}
private String elasticSearchBaseUrl() {
return Optional.ofNullable(getConfig() != null ? getConfig().getInitParameter(ELASTIC_SEARCH_URL) : null).orElse("http://elasticsearch:9200");
return Optional.ofNullable(getConfig() != null ? getConfig().getInitParameter(ELASTIC_SEARCH_URL) : null).orElse("http://sibyl:1666");
}
private static InMemoryRepository staticInMemoryRepository;
......
......@@ -27,7 +27,7 @@ import java.util.Map;
*/
public class ModelToIndexMapper {
private static final String AGENT = "Agent";
public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
public static final Gson GSON = new GsonBuilder().create();
private String query;
private Map<String, Object> context;
private String type;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment