deployment script & tasklist & executor fixes #75

Merged
Maece97 merged 1 commits from dev into main 2021-11-17 18:55:36 +00:00
6 changed files with 18 additions and 11 deletions

View File

@ -32,6 +32,8 @@ services:
restart: unless-stopped
volumes:
- ./:/data/
environment:
roster.uri: http://roster:8082
labels:
- "traefik.enable=true"
- "traefik.http.routers.tapas-tasks.rule=Host(`tapas-tasks.${PUB_IP}.nip.io`)"
@ -96,8 +98,8 @@ services:
volumes:
- ./:/data/
environment:
executor_pool_uri: executor-pool.86-119-35-40.nip.io
roster_uri: roster.86-119-35-40.nip.io"
executor_pool_uri: http://executor-pool:8083
roster_uri: http://roster:8082
labels:
- "traefik.enable=true"
- "traefik.http.routers.executor-computation.rule=Host(`executor-computation.${PUB_IP}.nip.io`)"
@ -116,8 +118,8 @@ services:
volumes:
- ./:/data/
environment:
executor_pool_uri: executor-pool.86-119-35-40.nip.io
roster_uri: roster.86-119-35-40.nip.io
executor_pool_uri: http://executor-pool:8083
roster_uri: http://roster:8082
labels:
- "traefik.enable=true"
- "traefik.http.routers.executor-robot.rule=Host(`executor-robot.${PUB_IP}.nip.io`)"

View File

@ -34,8 +34,6 @@ public class NotifyExecutorPoolAdapter implements NotifyExecutorPoolPort {
@Override
public boolean notifyExecutorPool(ExecutorURI executorURI, ExecutorType executorType) {
System.out.println(server);
String body = new JSONObject()
.put("executorTaskType", executorType)
.put("executorUri", executorURI.getValue())

View File

@ -1,5 +1,6 @@
package ch.unisg.executorbase.executor.domain;
import java.util.logging.Level;
import java.util.logging.Logger;
import ch.unisg.common.valueobject.ExecutorURI;
@ -41,8 +42,10 @@ public abstract class ExecutorBase {
// TODO do this in main
// Notify executor-pool about existence. If executor-pools response is successfull start with getting an assignment, else shut down executor.
if(!notifyExecutorPoolService.notifyExecutorPool(this.executorURI, this.executorType)) {
logger.log(Level.WARNING, "Executor could not connect to executor pool! Shuting down!");
System.exit(0);
} else {
logger.info("Executor conntected to executor pool");
this.status = ExecutorStatus.IDLING;
getAssignment();
}

View File

@ -5,6 +5,8 @@ import ch.unisg.tapastasks.tasks.application.port.out.CanTaskBeDeletedPort;
import ch.unisg.tapastasks.tasks.domain.DeleteTaskEvent;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@ -19,9 +21,8 @@ import java.util.HashMap;
@Primary
public class CanTaskBeDeletedWebAdapter implements CanTaskBeDeletedPort {
// Base URI of the service interested in this event
//Todo: Add the right IP address
String server = null;
@Value("${roster.uri}")
String server;
@Override
public void canTaskBeDeletedEvent(DeleteTaskEvent event){

View File

@ -4,6 +4,8 @@ import ch.unisg.tapastasks.tasks.application.port.out.NewTaskAddedEventPort;
import ch.unisg.tapastasks.tasks.domain.NewTaskAddedEvent;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
@ -18,8 +20,8 @@ import java.util.HashMap;
@Primary
public class PublishNewTaskAddedEventWebAdapter implements NewTaskAddedEventPort {
//This is the base URI of the service interested in this event (in my setup, running locally as separate Spring Boot application)
String server = "http://127.0.0.1:8082";
@Value("${roster.uri}")
String server;
@Override
public void publishNewTaskAddedEvent(NewTaskAddedEvent event) {

View File

@ -1,2 +1,3 @@
server.port=8081
baseuri=https://tapas-tasks.86-119-34-23.nip.io/
roster.uri=http://127.0.0.1:8082