Skip to content
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

Developed version 2.0.17 #562

Merged
merged 58 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d5b3211
Added a simple tool to delete spam projects.
MichaelRoeder Aug 16, 2023
4b857f9
Increased the version of the core library and updated the code accord…
MichaelRoeder Sep 11, 2023
feced4c
Increased commons-io version.
MichaelRoeder Sep 11, 2023
74ff58b
Added a flag to disable the gitlab-based image manager.
MichaelRoeder Sep 28, 2023
536e7b4
Build gui-serverbackend in Docker
denkv Oct 10, 2023
2726095
Build gui-client in Docker
denkv Oct 11, 2023
149088e
Use a directory instead of a war file
denkv Oct 10, 2023
972385c
Always resolve or reject the Promise in getToken
denkv Oct 10, 2023
dc82184
Add `USE_UI_AUTH` option to disable access control and Keycloak requi…
denkv Oct 11, 2023
3ad6b20
Implemented the hardware constraint processing. Fixed several compile…
MichaelRoeder Oct 14, 2023
f082866
Implemented the hardware constraint processing. Fixed several compile…
MichaelRoeder Oct 14, 2023
e3d7034
Implemented the processing of hardware constraints. Fixed some smalle…
MichaelRoeder Oct 14, 2023
58e135c
Merge pull request #558 from hobbit-project/feature/delete-keycloak
MichaelRoeder Oct 26, 2023
62c9346
Merged changes from develop.
MichaelRoeder Nov 4, 2023
4dde753
Remove a temporary file
denkv Nov 6, 2023
d169b44
Fix gui-client build
denkv Nov 6, 2023
8c97198
Adapted file persmissions.
MichaelRoeder Nov 11, 2023
37cfda3
Fixed issues with the hardware constraints.
MichaelRoeder Nov 11, 2023
5402818
Merge branch 'develop' into feature-limit-resources
MichaelRoeder Nov 11, 2023
98c9d66
Moved the web.xml used in cases where no authentication is needed int…
MichaelRoeder Nov 13, 2023
c9da48f
Added the missing configure-auth script.
MichaelRoeder Nov 13, 2023
2823711
Fixed pom version problem.
MichaelRoeder Nov 17, 2023
d3cb4ba
Removed user information that is not needed for retrieving the licens…
MichaelRoeder Nov 17, 2023
18614df
Fixed pom version problem.
MichaelRoeder Nov 17, 2023
36365ae
Do not run tests on build
denkv Nov 20, 2023
56df812
Build platform-controller in Docker
denkv Nov 20, 2023
cf84458
Build storage-service in Docker
denkv Nov 20, 2023
d17d2b0
Build analysis-component in Docker
denkv Nov 20, 2023
2b79fef
Install parent-pom before building components
denkv Nov 20, 2023
7669710
Cleanup Makefile
denkv Nov 20, 2023
627b58c
Added the handling of error reports. Errors are added to the result m…
MichaelRoeder Dec 8, 2023
1eb5c71
Included the new blocking rabbitmq receiver in the storage service.
MichaelRoeder Dec 14, 2023
7cbb4e7
Included the new blocking rabbitmq receiver in the analysis component.
MichaelRoeder Dec 14, 2023
6803d50
Merge branch 'feature/build-in-docker' into feature-limit-resources
MichaelRoeder Dec 14, 2023
5d5eae9
Updated dev docker-compose.
MichaelRoeder Dec 15, 2023
861895f
Fixed problems with the queue-based consumer.
MichaelRoeder Dec 16, 2023
2e630e5
Finished implementation of error report handling.
MichaelRoeder Dec 16, 2023
1c5c314
Removed the errorDetails property since it is not used anymore.
MichaelRoeder Dec 17, 2023
25ab24d
Prepared release of 2.0.17.
MichaelRoeder Dec 17, 2023
86893cb
Merge pull request #559 from hobbit-project/feature/build-in-docker
MichaelRoeder Dec 17, 2023
f173e7f
Removed faulty file.
MichaelRoeder Dec 18, 2023
ff5d0c1
Applied changes according to review.
MichaelRoeder Dec 18, 2023
f087c48
Merge pull request #561 from hobbit-project/feature-limit-resources
MichaelRoeder Dec 18, 2023
f157cb8
cAdvisor image moved to another registry
denkv Jan 3, 2024
3428f5b
Run CI workflow with ubuntu-22.04
denkv Jan 4, 2024
1a0a839
Configure networks as in new docker compose documentation
denkv Jan 4, 2024
5162fc4
Fixed execution permissions for shell scripts.
MichaelRoeder Jan 5, 2024
8ee9416
Fixed badge in README.
MichaelRoeder Jan 5, 2024
7188ad3
Added a utilities class for connectivity assumptions. Based the Gitla…
MichaelRoeder Jan 5, 2024
79b563c
Added timeouts to Gitlab-based tests. Added an additional assumption …
MichaelRoeder Jan 5, 2024
ea0da3a
Fixed a comment.
MichaelRoeder Jan 5, 2024
223f671
Removed an assertion that made the closing of an experiment fail alth…
MichaelRoeder Jan 5, 2024
96ad3c8
Attempt to fix the problem that RabbitMQ is not started properly in G…
MichaelRoeder Jan 5, 2024
4199dd0
Added the usage of the HobbitConfiguraiton class instead of accessing…
MichaelRoeder Jan 5, 2024
daa699c
Fixed the ExperimentTimeoutTest class.
MichaelRoeder Jan 5, 2024
40cf220
Added timout for connectivity assumption class.
MichaelRoeder Jan 18, 2024
b8e433a
Added usage of error instance class of the core library instead of us…
MichaelRoeder Jan 18, 2024
3dbf671
Added an explicit pull of necessary images to the github action file.
MichaelRoeder Jan 19, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: make
on: push
jobs:
make:
runs-on: ubuntu-20.04
# https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
Expand Down
28 changes: 5 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# build platform components
default: build
build: build-dev-images

deploy: create-networks start

Expand All @@ -26,36 +25,19 @@ start-dev-platform:
start-dev-elk:
docker-compose -f docker-compose-elk.yml up -d

build: build-java build-dev-images

build-java: install-parent-pom build-controller build-storage build-analysis build-gui

build-gui:
cd hobbit-gui/gui-client && sh -c 'test "$$TRAVIS" = "true" && npm ci; true' && sh -c 'test "$$TRAVIS" = "true" || npm install; true' && npm run build-prod
cd hobbit-gui/gui-serverbackend && mvn clean package

build-controller:
cd platform-controller && make build

build-storage:
cd platform-storage/storage-service && mvn clean package -U

build-analysis:
cd analysis-component && mvn clean package -U

build-dev-images: build-dev-platform-controller-image build-dev-gui-image build-dev-analysis-image build-dev-storage-image

build-dev-platform-controller-image:
docker build -t hobbitproject/hobbit-platform-controller:dev ./platform-controller
docker build -t hobbitproject/hobbit-platform-controller:dev --file platform-controller/Dockerfile .

build-dev-gui-image:
docker build -t hobbitproject/hobbit-gui:dev ./hobbit-gui/gui-serverbackend
docker build -t hobbitproject/hobbit-gui:dev --file hobbit-gui/gui-serverbackend/Dockerfile .

build-dev-analysis-image:
docker build -t hobbitproject/hobbit-analysis-component:dev ./analysis-component
docker build -t hobbitproject/hobbit-analysis-component:dev --file ./analysis-component/Dockerfile .

build-dev-storage-image:
docker build -t hobbitproject/hobbit-storage-service:dev ./platform-storage/storage-service
docker build -t hobbitproject/hobbit-storage-service:dev --file ./platform-storage/storage-service/Dockerfile .

create-networks:
@docker network inspect hobbit >/dev/null || (docker network create -d overlay --attachable --subnet 172.16.100.0/24 hobbit && echo "Created network: hobbit")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/hobbit-project/platform.svg?branch=master)](https://travis-ci.org/hobbit-project/platform)
[![make](https://github.com/hobbit-project/platform/actions/workflows/make.yml/badge.svg?branch=master)](https://github.com/hobbit-project/platform/actions/workflows/make.yml)

# HOBBIT platform

Expand Down
16 changes: 12 additions & 4 deletions analysis-component/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
FROM eclipse-temurin:11-focal
FROM maven:3-eclipse-temurin-11 AS build
WORKDIR /usr/src/hobbit-platform
COPY parent-pom/pom.xml parent-pom/
RUN mvn --file parent-pom -Dmaven.test.skip=true install
ARG project=analysis-component
COPY ${project}/pom.xml ${project}/
RUN mvn --file ${project} dependency:go-offline
COPY ${project}/src ${project}/src
RUN mvn --file ${project} -Dmaven.test.skip=true package

COPY target/analysis-component.jar .

CMD java -cp analysis-component.jar org.hobbit.core.run.ComponentStarter org.hobbit.analysis.AnalysisComponent
FROM eclipse-temurin:11
COPY --from=build /usr/src/hobbit-platform/analysis-component/target/analysis-component.jar .
CMD ["java", "-cp", "analysis-component.jar", "org.hobbit.core.run.ComponentStarter", "org.hobbit.analysis.AnalysisComponent"]
2 changes: 1 addition & 1 deletion analysis-component/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>org.hobbit</groupId>
<artifactId>parent</artifactId>
<version>${hobbitplatform.version}</version>
<version>2.0.17</version>
<relativePath>../parent-pom</relativePath>
</parent>
<artifactId>analysis-component</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,42 @@
*/
package org.hobbit.analysis;

import java.util.stream.Stream;
import java.util.stream.Collectors;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.aksw.palmetto.evaluate.correlation.PearsonsSampleCorrelationCoefficient;
import org.apache.commons.io.IOUtils;
import org.apache.jena.datatypes.RDFDatatype;
import org.apache.jena.datatypes.xsd.XSDDatatype;
import org.apache.jena.rdf.model.*;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.ResIterator;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.rdf.model.Statement;
import org.apache.jena.rdf.model.StmtIterator;
import org.apache.jena.vocabulary.DCTerms;
import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.XSD;
import org.apache.commons.io.IOUtils;
import org.hobbit.core.Constants;
import org.hobbit.core.components.AbstractComponent;
import org.hobbit.core.data.RabbitQueue;
import org.hobbit.core.rabbit.QueueingConsumer;
import org.hobbit.core.rabbit.RabbitMQUtils;
import org.hobbit.storage.client.StorageServiceClient;
import org.hobbit.storage.queries.SparqlQueries;
Expand All @@ -42,20 +62,31 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.rabbitmq.client.QueueingConsumer;
import com.rabbitmq.client.Delivery;

import weka.attributeSelection.*;
import weka.attributeSelection.AttributeSelection;
import weka.attributeSelection.CfsSubsetEval;
import weka.attributeSelection.GreedyStepwise;
import weka.classifiers.functions.LinearRegression;
import weka.clusterers.SimpleKMeans;
import weka.core.*;
import weka.core.Attribute;
import weka.core.DenseInstance;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.SparseInstance;


/**
* This class implements the functionality for the Analysis Component
* TODO:: !!REFACTOR INTO A MORE GENERIC DESIGN!!
*/
public class AnalysisComponent extends AbstractComponent {
/**
* The time the main receiver thread will sleep if it didn't receive any message
* (in seconds).
*/
private static final int WAITING_TIME_BEFORE_CHECKING_STATUS = 60;

private static final Logger LOGGER = LoggerFactory.getLogger(AnalysisComponent.class);
private static final String GRAPH_URI = Constants.PUBLIC_RESULT_GRAPH_URI;
protected RabbitQueue controller2AnalysisQueue;
Expand All @@ -82,16 +113,24 @@ public void init() throws Exception {
@Override
public void run() throws Exception {
LOGGER.info("Awaiting requests");
QueueingConsumer.Delivery delivery;
Delivery delivery;
while (true) {
delivery = consumer.nextDelivery();
delivery = null;
// Let's wait for a delivery for 60 seconds
try {
delivery = consumer.getDeliveryQueue().poll(WAITING_TIME_BEFORE_CHECKING_STATUS, TimeUnit.SECONDS);
} catch (InterruptedException e) {
// interrupted; just continue
}
if (delivery != null) {
LOGGER.info("Received a request. Processing...");
String expUri = RabbitMQUtils.readString(delivery.getBody());
handleRequest(expUri);
} else {
// This would be the place at which we could react to signals, e.g., terminate
// the service if needed.
}
}

}

protected void handleRequest(String expUri) {
Expand Down Expand Up @@ -235,18 +274,17 @@ public void close() throws IOException {
* The model of the experiment
* @return Returns the analyzed model
*/

/**
/*
private AnalysisModel analyseExperiment(Model experimentModel, String expUri){
AnalysisModel analysisModel = new AnalysisModel(experimentModel, expUri);
analysisModel.analyse();
return analysisModel;
}*/

private void notifyQueue(){
/*private void notifyQueue(){
//TODO:: return the status of component

}
}*/

/**
* This class implements the functionality of the Analysis Model which
Expand Down
44 changes: 26 additions & 18 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ services:
HOBBIT_RABBIT_IMAGE: "rabbitmq:management"
HOBBIT_RABBIT_HOST: "rabbit"
HOBBIT_REDIS_HOST: "redis"
DEPLOY_ENV: "testing"
DEPLOY_ENV: "develop"
GITLAB_USER: "${GITLAB_USER}"
GITLAB_EMAIL: "${GITLAB_EMAIL}"
GITLAB_TOKEN: "${GITLAB_TOKEN}"
LOGGING_GELF_ADDRESS: "udp://localhost:12201"
#LOGGING_GELF_ADDRESS: "udp://localhost:12201"
SWARM_NODE_NUMBER: "1"
PROMETHEUS_HOST: prometheus
PROMETHEUS_PORT: 9090
USE_GITLAB: "false"
LOCAL_METADATA_DIRECTORY: "/metadata"
DOCKER_AUTOPULL: "0"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./metadata:/metadata

# HOBBIT GUI
gui:
Expand All @@ -36,20 +40,21 @@ services:
- KEYCLOAK_DIRECT_URL=http://keycloak:8080/auth
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_HTTP_PORT=9200
- USE_UI_AUTH=false
#volumes:
#- /data/docker/messages/global.html:/var/lib/jetty/webapps/messages/global.html
#- /data/docker/messages/benchmark.html:/var/lib/jetty/webapps/messages/benchmark.html
#- /data/docker/messages/status.html:/var/lib/jetty/webapps/messages/status.html

# Keycloak user management (used by the GUI)
keycloak:
image: hobbitproject/hobbit-keycloak:latest
ports:
- "8181:8080"
networks:
- hobbit
volumes:
- ./config/keycloak:/opt/jboss/keycloak/standalone/data/db
# keycloak:
# image: hobbitproject/hobbit-keycloak:latest
# ports:
# - "8181:8080"
# networks:
# - hobbit
# volumes:
# - ./config/keycloak:/opt/jboss/keycloak/standalone/data/db

# HOBBIT Analysis component
analysis:
Expand Down Expand Up @@ -90,7 +95,8 @@ services:
stop_signal: SIGINT
stop_grace_period: 2m
volumes:
- ./config/db:/opt/virtuoso-opensource/database
- ./config/db:/opt/virtuoso-opensource/var/lib/virtuoso/db
#- ./config/db:/opt/virtuoso-opensource/database
networks:
- hobbit-core
ports:
Expand All @@ -104,16 +110,16 @@ services:
environment:
- SPARQL_ENDPOINT_URL=http://vos:8890/sparql
- HOBBIT_RABBIT_HOST=rabbit
- SPARQL_ENDPOINT_USERNAME=HobbitPlatform
- SPARQL_ENDPOINT_PASSWORD=Password
- SPARQL_ENDPOINT_USERNAME=dba
- SPARQL_ENDPOINT_PASSWORD=dba

node-exporter:
image: prom/node-exporter
networks:
- hobbit-core

cadvisor:
image: google/cadvisor
image: gcr.io/cadvisor/cadvisor
networks:
- hobbit-core
volumes:
Expand All @@ -138,8 +144,10 @@ services:

networks:
hobbit:
external:
name: hobbit
name: hobbit
external: true
driver: overlay
hobbit-core:
external:
name: hobbit-core
name: hobbit-core
external: true
driver: overlay
Binary file removed hobbit-gui/gui-client/.package.json.swp
Binary file not shown.
14 changes: 14 additions & 0 deletions hobbit-gui/gui-client/src/app/auth/keycloak.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ export class KeycloakService {
req.onload = (e) => {
const keycloakConfig = JSON.parse(req.responseText);

if (keycloakConfig.clientId === 'DISABLED') {
console.log('UI auth is disabled');
KeycloakService.auth.loggedIn = true;
KeycloakService.auth.authz = true;
resolve(null);
return;
}

const keycloakAuth: any = Keycloak(keycloakConfig);
keycloakAuth.init({ onLoad: 'login-required' })
.success(() => {
Expand Down Expand Up @@ -66,6 +74,12 @@ export class KeycloakService {
.error(() => {
reject('Failed to refresh token');
});
} else {
if (KeycloakService.auth.authz === true) {
resolve(null);
return;
}
reject('No token');
}
});
}
Expand Down
7 changes: 5 additions & 2 deletions hobbit-gui/gui-client/src/app/custom-http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@ export class CustomHttp {

const obs = Observable.fromPromise(this.keycloakService.getToken()).map(token => {
const requestUrl = environment.backendUrl + url.substr(environment.backendPrefix.length);
const headers = { 'Authorization': 'bearer ' + token };
const headers = {};
if (token !== null) {
Object.assign(headers, {Authorization: 'bearer ' + token});
}
let requestOptions = options;
if (!options)
requestOptions = { 'headers': new HttpHeaders(headers) };
else if (!options.headers)
requestOptions.headers = new HttpHeaders(headers);
else
requestOptions.headers = requestOptions.headers.set('Authorization', headers['Authorization']);
Object.assign(requestOptions.headers, headers);
return { url: requestUrl, options: requestOptions };
});
return obs;
Expand Down
Loading
Loading