Skip to content

Commit

Permalink
Merge pull request #10 from secure-software-engineering/develop
Browse files Browse the repository at this point in the history
fix docker cmp
  • Loading branch information
anddann authored Jan 19, 2023
2 parents c198e2b + 428b0a8 commit 53376fe
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
11 changes: 7 additions & 4 deletions docker-compose-upcy-dockerized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ services:
#creates the work messages
producer:
restart: always
image: ghcr.io/anddann/upcy:1.6-SNAPSHOT
image: ghcr.io/anddann/upcy:1.6.1-SNAPSHOT
depends_on:
- rabbitmq
- fileServer
deploy:
# we only need one producer
replicas: 1
Expand All @@ -30,6 +29,8 @@ services:
condition: on-failure
delay: 90s
window: 240s
volumes:
- ./upcyresults:/mnt/results
env_file:
- ./upcy.sample.env
environment:
Expand All @@ -39,7 +40,7 @@ services:

worker:
restart: always
image: ghcr.io/anddann/upcy:1.6-SNAPSHOT
image: ghcr.io/anddann/upcy:1.6.1-SNAPSHOT
deploy:
replicas: 2
mode: replicated
Expand All @@ -51,14 +52,16 @@ services:
- rabbitmq
- producer
volumes:
- ./upcy-results-folder:/mnt/results
- ./upcyresults:/mnt/results
env_file:
- ./upcy.sample.env
environment:
- WORKER_NODE=true
- TIMEOUT=21600
networks:
- pipeline-net
extra_hosts:
- "host.docker.internal:host-gateway"

networks:
pipeline-net:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/upb/upcy/update/dockerize/IClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static IClient createClient(String host, String user, String pass) {
// Todo make nice in the future
if (host.startsWith("http://") || host.startsWith("https://")) {
return new WebDavClient(host, user, pass);
} else if (host.startsWith("file://")) {
} else if (host.startsWith("file:/")) {
return new LocalClient(host);
}
return null;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/de/upb/upcy/update/dockerize/LocalClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.maven.surefire.shared.io.FileUtils;
Expand All @@ -17,6 +18,10 @@ public class LocalClient implements IClient {

LocalClient(String rootPath) {
this.rootDir = Paths.get(URI.create(rootPath));
if (!Files.exists(rootDir) && !Files.isDirectory(rootDir)) {
throw new IllegalArgumentException(String.format("No valid folder %s", rootPath));
}

LOGGER.info("Created LocalClient");
}

Expand Down
11 changes: 11 additions & 0 deletions src/test/java/de/upb/upcy/update/dockerize/IClientTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package de.upb.upcy.update.dockerize;

import junit.framework.TestCase;

public class IClientTest extends TestCase {

public void testCreateClient() {
final IClient client = IClient.createClient("file:/home", "", "");
assertTrue(client instanceof LocalClient);
}
}
4 changes: 2 additions & 2 deletions upcy.sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ NEO4J_USER=neo4j
NEO4J_PASS=DUMMYPASSWORD
RABBITMQ_USER=myuser
RABBITMQ_PASS=mypassword
# to use local folder start with file://.....
FILESERVER_HOST=file://mnt/results
# to use local folder start with file:/.....
FILESERVER_HOST=file:/mnt/results
FILESERVER_USER=myuser
FILESERVER_PASS=DUMMYPASSWORD
MONGO_HOST=host.docker.internal
Expand Down

0 comments on commit 53376fe

Please sign in to comment.