Skip to content

Adding a Recommender System to Noracle (Backend) #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.gradle
/.idea
/kubernetes
/lib
/log
/node-storage
/service
.gitignore
agent-developer.xml
LICENSE
README.md
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/node-storage/
/.las2peer/
/tmp/
/log/
/lib/
/log/
/etc/ivy/ivy.jar
/service/
/out/
Expand All @@ -14,7 +14,6 @@
/.settings/
/junitvmwatcher*.properties
/junit*.properties
/etc/startup/
*.secret
archiva_credentials.xml
.classpath
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM openjdk:14-jdk-alpine
FROM openjdk:17-jdk-alpine

ENV HTTP_PORT=8080
ENV HTTPS_PORT=8443
ENV LAS2PEER_PORT=9011
ENV LAS2PEER_PORT=32061
ENV NODE_ID_SEED=382251

RUN apk add --update bash mysql-client apache-ant tzdata curl && rm -f /var/cache/apk/*
RUN addgroup -g 1000 -S las2peer && \
Expand All @@ -16,12 +17,10 @@ USER las2peer
RUN dos2unix gradlew
RUN dos2unix gradle.properties
RUN dos2unix /src/docker-entrypoint.sh
#RUN chmod -R a+rwx /src
#RUN chmod +x /src/docker-entrypoint.sh
RUN dos2unix /src/etc/i5.las2peer.connectors.webConnector.WebConnector.properties
RUN chmod -R a+rwx /src
RUN chmod +x /src/docker-entrypoint.sh
RUN chmod +x gradlew && ./gradlew build --exclude-task test
#RUN dos2unix /src/docker-entrypoint.sh
#RUN dos2unix /src/etc/i5.las2peer.connectors.webConnector.WebConnector.properties
#RUN dos2unix /src/etc/i5.las2peer.services.servicePackage.akgService.properties

EXPOSE $HTTP_PORT
EXPOSE $HTTPS_PORT
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Distributed Noracle Backend
[![Build Status](https://jenkins.dbis.rwth-aachen.de/buildStatus/icon?job=Distributed-Noracle-Backend)](https://jenkins.dbis.rwth-aachen.de/job/Distributed-Noracle-Backend/)

This suite of microservices forms the backend of the Distributed Noracle Project.
Please try out our app at: [dbis.rwth-aachen.de/noracle/](http://dbis.rwth-aachen.de/noracle/)
Please try out our app at: https://noracle.tech4comp.dbis.rwth-aachen.de/

---------------

## Java
The application uses **Java 17** and **Gradle 7.3**.

las2peer uses **Java 14**.

## Setup
1. Build the project using `ant all`
1. Copy *launcher-configuration.ini* to *etc/*
1. Start using `./start-local.sh` for starting in the same shell (useful for testing), or `./start-node.sh` for starting Noracle in a screen (useful for production)

## Run
```
docker build -t noracle-service .
docker run -p 8080:8080 -p 9011:9011 noracle-service
```
The service(s) are then available under http://localhost:8080/distributed-noracle.
17 changes: 12 additions & 5 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ export SERVICE3=${SERVICE_NAME}.'NoracleSpaceService'@${SERVICE_VERSION}
export SERVICE4=${SERVICE_NAME}.'NoracleQuestionService'@${SERVICE_VERSION}
export SERVICE5=${SERVICE_NAME}.'NoracleQuestionRelationService'@${SERVICE_VERSION}
export SERVICE6=${SERVICE_NAME}.'NoracleAgentService'@${SERVICE_VERSION}
export SERVICE7=${SERVICE_NAME}.'NoracleRecommenderService'@${SERVICE_VERSION}

# Currently, these services cannot be used, because object serialization in the network does not work
export SERVICE8=${SERVICE_NAME}.'NoracleNormalizationService'@${SERVICE_VERSION}
export SERVICE9=${SERVICE_NAME}.'NoracleQuestionUtilityService'@${SERVICE_VERSION}

echo deploy $SERVICE1
echo deploy $SERVICE2
echo deploy $SERVICE3
echo deploy $SERVICE4
echo deploy $SERVICE5
echo deploy $SERVICE6
echo deploy $SERVICE7

function set_in_service_config {
sed -i "s?${1}[[:blank:]]*=.*?${1}=${2}?g" ${SERVICE_PROPERTY_FILE}
Expand Down Expand Up @@ -54,7 +61,7 @@ fi
# prevent glob expansion in lib/*
echo prevent glob expansion in lib
set -f
LAUNCH_COMMAND='java -cp lib/* i5.las2peer.tools.L2pNodeLauncher -s service -p '"${LAS2PEER_PORT} ${SERVICE_EXTRA_ARGS}"
LAUNCH_COMMAND='java -cp lib/* --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED i5.las2peer.tools.L2pNodeLauncher -s service -p '"${LAS2PEER_PORT} ${SERVICE_EXTRA_ARGS}"
if [[ ! -z "${BOOTSTRAP}" ]]; then
LAUNCH_COMMAND="${LAUNCH_COMMAND} -b ${BOOTSTRAP}"
fi
Expand Down Expand Up @@ -84,12 +91,12 @@ echo start the service within a las2peer node
if [[ -z "${@}" ]]
then
if [ -n "$LAS2PEER_ETH_HOST" ]; then
echo ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED --ethereum-mnemonic "$(selectMnemonic)" uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector "node=getNodeAsEthereumNode()" "registry=node.getRegistryClient()" "n=getNodeAsEthereumNode()" "r=n.getRegistryClient()"
exec ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED --ethereum-mnemonic "$(selectMnemonic)" uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector "node=getNodeAsEthereumNode()" "registry=node.getRegistryClient()" "n=getNodeAsEthereumNode()" "r=n.getRegistryClient()"
echo ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED --ethereum-mnemonic "$(selectMnemonic)" uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE7}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector "node=getNodeAsEthereumNode()" "registry=node.getRegistryClient()" "n=getNodeAsEthereumNode()" "r=n.getRegistryClient()"
exec ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED --ethereum-mnemonic "$(selectMnemonic)" uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE7}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector "node=getNodeAsEthereumNode()" "registry=node.getRegistryClient()" "n=getNodeAsEthereumNode()" "r=n.getRegistryClient()"
#exec ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED --observer --ethereum-mnemonic "$(selectMnemonic)" uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector "node=getNodeAsEthereumNode()" "registry=node.getRegistryClient()" "n=getNodeAsEthereumNode()" "r=n.getRegistryClient()"
else
echo ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector
exec ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector
echo ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE7}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector
exec ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE2}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE3}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE4}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE5}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE6}""'", "'""${SERVICE_PASSPHRASE}""'"\) startService\("'""${SERVICE7}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector
#exec ${LAUNCH_COMMAND} --node-id-seed $NODE_ID_SEED --observer uploadStartupDirectory startService\("'""${SERVICE1}""'", "'""${SERVICE_PASSPHRASE}""'"\) startWebConnector
fi
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
httpPort = 8080
httpsPort = 8090
httpsPort = 8443
startHttp = TRUE
startHttps = FALSE
sslKeystore = etc/example.jks
sslKeyPassword = secretpassword
crossOriginResourceDomain = *
crossOriginResourceMaxAge = 60
enableCrossOriginResourceSharing = TRUE
onlyLocalServices = FALSE
defaultLoginUser = anonymous
defaultLoginPassword = anonymous
oidcProviders = https://api.learning-layers.eu/auth
oidcProviders = https://api.learning-layers.eu/o/oauth2
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
templateProperty="Insert your properties here"

This file was deleted.

6 changes: 3 additions & 3 deletions etc/nodeInfo.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<las2peerNode>
<adminName>Simon Breuer</adminName>
<adminEmail>simon.breuer@rwth-aachen.de</adminEmail>
<adminName>Admin</adminName>
<adminEmail>admin@mail.com</adminEmail>
<organization>Advanced Community Information Systems (ACIS) Group, RWTH Aachen University</organization>
<description>This node hosts the noracle backend service.</description>
<description>This node hosts a sample service.</description>
</las2peerNode>
9 changes: 0 additions & 9 deletions example/agent-noracle-example-alice.xml

This file was deleted.

9 changes: 0 additions & 9 deletions example/agent-noracle-example-bob.xml

This file was deleted.

Loading