Skip to content

Commit

Permalink
Merge pull request #215 from rwth-acis/releases/1.7.0
Browse files Browse the repository at this point in the history
Releases/2.1.0 merge
  • Loading branch information
lakhoune authored Oct 14, 2023
2 parents 246a66f + 52e7cc8 commit 0b28d47
Show file tree
Hide file tree
Showing 107 changed files with 1,811 additions and 11,209 deletions.
7 changes: 4 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main"/>
<classpathentry kind="src" path="src/test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<classpathentry kind="src" path="social-bot-manager/src/main/java"/>
<classpathentry kind="src" path="src/test/"/>

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
Expand Down
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
./social-bot-manager/build
./social-bot-manager/export
./social-bot-manager/export
lib
service
34 changes: 32 additions & 2 deletions .github/workflows/docker-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,44 @@ name: Docker Build and Push
on:
push:

branches: [ master, develop]
branches: [ master, develop, ma-lakhoune]


jobs:
test:
runs-on: ubuntu-latest
env:
DB_DATABASE: LAS2PEERMON
DB_USER: root
DB_PASSWORD: root
WEBCONNECTOR_URL: http://localhost:8080
steps:
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- run: mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < ./SBF.sql
# copy etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample to etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: cp etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|databasePassword =|databasePassword = ${{ env.DB_PASSWORD }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|databaseUser =|databaseUser = ${{ env.DB_USER }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|databaseName =|databaseName = ${{ env.DB_DATABASE }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|webconnectorUrl =|webconnectorUrl = ${{ env.WEBCONNECTOR_URL }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- name: Grant Gradle permissions
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew clean test --stacktrace --info
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run tests on pull requests

on:
pull_request:
branches: [ master, develop]

jobs:
test:
runs-on: ubuntu-latest
env:
DB_DATABASE: LAS2PEERMON
DB_USER: root
DB_PASSWORD: root
WEBCONNECTOR_URL: http://localhost:8080
steps:
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- run: mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < ./SBF.sql
- run: cp etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|databasePassword =|databasePassword = ${{ env.DB_PASSWORD }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|databaseUser =|databaseUser = ${{ env.DB_USER }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|databaseName =|databaseName = ${{ env.DB_DATABASE }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- run: sed -i "s|webconnectorUrl =|webconnectorUrl = ${{ env.WEBCONNECTOR_URL }}|g" etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
- name: Grant Gradle permissions
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew clean test --stacktrace --info
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ bin/start_network.bat
bin/start_network.sh
.project
mysql
etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
.env
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN dos2unix /app/gradle.properties
RUN dos2unix /app/docker-entrypoint.sh

RUN dos2unix /app/etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample
RUN dos2unix /app/etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties
RUN mv /app/etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties.sample /app/etc/i5.las2peer.services.socialBotManagerService.SocialBotManagerService.properties

EXPOSE $LAS2PEER_PORT
ENTRYPOINT ["/app/docker-entrypoint.sh"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="https://raw.githubusercontent.com/rwth-acis/Social-Bot-Framework/master/Logos/sbf-logo.svg" width=400px/>
<img src="https://raw.githubusercontent.com/rwth-acis/Social-Bot-Framework/master/assets/sbf-logo.svg" width=400px/>
</p>

<p align="center">
Expand Down Expand Up @@ -101,7 +101,7 @@ See [database](#Database) for a description of the settings.
| DATABASE_PASSWORD | *mandatory* ||
| DATABASE_HOST | mysql | |
| DATABASE_PORT | 3306 | |
| ADDRESS | / |Webconnector address. Needed for auto-restart functionality |
| WEBCONNECTOR_URL | / |Webconnector address. Needed for auto-restart functionality |
| RESTARTERBOTNAME | / | Name of restarterBot agent. Needed for auto-restart functionality |
| RESTARTERBOTPW | / | Password for restarterBot agent. Needed for auto-restart functionality |

Expand Down
2 changes: 1 addition & 1 deletion SBF.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SET FOREIGN_KEY_CHECKS = 0;
-- Table structure for attributes
-- ----------------------------
CREATE TABLE IF NOT EXISTS `attributes` (
`id` varchar(255) NOT NULL AUTO_INCREMENT,
`id` INT NOT NULL AUTO_INCREMENT,
`bot` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`channel` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`user` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
Expand Down
37 changes: 36 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
version: '3'

services:
mobsos-data-processing:
image: ${MOBSOS_DATA_PROCESSING_IMAGE:-registry.tech4comp.dbis.rwth-aachen.de/rwthacis/mobsos-data-processing:master}
environment:
MYSQL_HOST: db
MYSQL_PORT: ${DATABASE_PORT:-3306}
MYSQL_USER: ${DATABASE_USER:-root}
MYSQL_PASSWORD: ${DATABASE_PASSWORD:-root}
LAS2PEER_PORT: 9013
BOOTSTRAP: social-bot-manager:9011
ports:
- "9013:9013"
depends_on:
- social-bot-manager
social-bot-manager:
build: .
environment:
Expand All @@ -9,6 +22,14 @@ services:
DATABASE_PORT: ${DATABASE_PORT:-3306}
DATABASE_USER: ${DATABASE_USER:-root}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-root}
WEBCONNECTOR_URL: ${WEBCONNECTOR_URL:-http://127.0.0.1:8080}
MONGO_HOST: ${MONGO_HOST:-mongo:8080}
MONGO_DB: ${MONGO_DB:-sbf}
MONGO_USER: ${MONGO_USER:-admin}
MONGO_PASSWORD: ${MONGO_PASSWORD:-password}
MONGO_AUTH: ${MONGO_AUTH:-auth}
LRS_URL: ${LRL_URL:-127.0.0.1:8080}
LRS_AUTH_TOKEN: ${LRL_AUTH_TOKEN:-token}
ports:
- "8090:8080"
- "9011:9011"
Expand All @@ -25,4 +46,18 @@ services:
MYSQL_INITDB_SQL: /docker-entrypoint-initdb.d/init.sql
volumes:
- ./SBF.sql:/docker-entrypoint-initdb.d/init.sql

ports:
- "8085:3306"
rasa:
image: ${RASA_IMAGE:-rasa/rasa:3.4.2-full}
command: run --enable-api -m models --cors "*" --debug
ports:
- "5005:5005"
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-password}
ports:
- 8086:27017
5 changes: 3 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set_in_service_config databaseHost ${DATABASE_HOST}
set_in_service_config databasePort ${DATABASE_PORT}
set_in_service_config databaseUser ${DATABASE_USER}
set_in_service_config databasePassword ${DATABASE_PASSWORD}
set_in_service_config address ${ADDRESS}
set_in_service_config webconnectorUrl ${WEBCONNECTOR_URL}
set_in_service_config restarterBotName ${RESTARTERBOTNAME}
set_in_service_config restarterBotPW ${RESTARTERBOTPW}
set_in_service_config mongoHost ${MONGO_HOST}
Expand All @@ -39,9 +39,10 @@ set_in_service_config mongoUser ${MONGO_USER}
set_in_service_config mongoPassword ${MONGO_PASSWORD}
set_in_service_config mongoAuth ${MONGO_AUTH}
set_in_service_config lrsURL ${LRS_URL}
set_in_service_config lrsURLStatic ${LRS_URL}
set_in_service_config lrsAuthToken ${LRS_AUTH_TOKEN}

check_if_exists "$ADDRESS" "ADDRESS"
check_if_exists "$WEBCONNECTOR_URL" "WEBCONNECTOR_URL"

if [ "$ENV_VARIABLE_NOT_SET" = true ] ; then
echo "Missing environment variables, exiting..."
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
databaseUser = root
databasePassword = root
databaseName = LAS2PEERMON
databaseHost = host.docker.internal
databaseName = SBF
databaseHost = localhost:3306
databasePort = 3306
mongoUser = admin
mongoPassword = password
mongoDB = sbf
mongoHost = 127.0.0.1:27017
mongoAuth = admin
address = http://127.0.0.1:8080
webconnectorUrl = http://127.0.0.1:8080
restarterBotName =
restarterBotPW =
34 changes: 0 additions & 34 deletions etc/ivy/ivy.xml

This file was deleted.

12 changes: 0 additions & 12 deletions etc/ivy/ivysettings.xml

This file was deleted.

2 changes: 1 addition & 1 deletion etc/nodeInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<adminName>Admin</adminName>
<adminEmail>[email protected]</adminEmail>
<organization>Advanced Community Information Systems (ACIS) Group, RWTH Aachen University</organization>
<description>This node hosts a sample service.</description>
<description>This node hosts the social bot manager service</description>
</las2peerNode>
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
core.version=1.2.4
core.version=1.3.1
service.name=i5.las2peer.services.socialBotManagerService
service.class=SocialBotManagerService
service.version=1.6.0
service.version=2.1.0
java.version=17

las2peer_user1.name=alice
Expand Down
2 changes: 1 addition & 1 deletion social-bot-manager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ task startscripts {
# this script is autogenerated by 'gradle startscripts'
# it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project
# pls execute it from the root folder of your deployment, e. g. ./bin/start_network.sh
java -cp "lib/*" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service uploadStartupDirectory startService\\(\\'${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}\\'\\) startWebConnector interactive
java -cp "lib/*" --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED i5.las2peer.tools.L2pNodeLauncher --port 9011 --service-directory service -o uploadStartupDirectory startService\\(\\'${project.property('service.name')}.${project.property('service.class')}@${project.property('service.version')}\\'\\) startWebConnector interactive
"""
new File("$rootDir/bin", "start_network.bat").text = """:: this script is autogenerated by 'gradle startscripts'
:: it starts a las2peer node providing the service '${project.property('service.name')}.${project.property('service.class')}' of this project
Expand Down
Loading

0 comments on commit 0b28d47

Please sign in to comment.