Skip to content

Commit 53376fe

Browse files
authored
Merge pull request #10 from secure-software-engineering/develop
fix docker cmp
2 parents c198e2b + 428b0a8 commit 53376fe

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

docker-compose-upcy-dockerized.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ services:
1818
#creates the work messages
1919
producer:
2020
restart: always
21-
image: ghcr.io/anddann/upcy:1.6-SNAPSHOT
21+
image: ghcr.io/anddann/upcy:1.6.1-SNAPSHOT
2222
depends_on:
2323
- rabbitmq
24-
- fileServer
2524
deploy:
2625
# we only need one producer
2726
replicas: 1
@@ -30,6 +29,8 @@ services:
3029
condition: on-failure
3130
delay: 90s
3231
window: 240s
32+
volumes:
33+
- ./upcyresults:/mnt/results
3334
env_file:
3435
- ./upcy.sample.env
3536
environment:
@@ -39,7 +40,7 @@ services:
3940

4041
worker:
4142
restart: always
42-
image: ghcr.io/anddann/upcy:1.6-SNAPSHOT
43+
image: ghcr.io/anddann/upcy:1.6.1-SNAPSHOT
4344
deploy:
4445
replicas: 2
4546
mode: replicated
@@ -51,14 +52,16 @@ services:
5152
- rabbitmq
5253
- producer
5354
volumes:
54-
- ./upcy-results-folder:/mnt/results
55+
- ./upcyresults:/mnt/results
5556
env_file:
5657
- ./upcy.sample.env
5758
environment:
5859
- WORKER_NODE=true
5960
- TIMEOUT=21600
6061
networks:
6162
- pipeline-net
63+
extra_hosts:
64+
- "host.docker.internal:host-gateway"
6265

6366
networks:
6467
pipeline-net:

src/main/java/de/upb/upcy/update/dockerize/IClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static IClient createClient(String host, String user, String pass) {
1616
// Todo make nice in the future
1717
if (host.startsWith("http://") || host.startsWith("https://")) {
1818
return new WebDavClient(host, user, pass);
19-
} else if (host.startsWith("file://")) {
19+
} else if (host.startsWith("file:/")) {
2020
return new LocalClient(host);
2121
}
2222
return null;

src/main/java/de/upb/upcy/update/dockerize/LocalClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.File;
44
import java.io.IOException;
55
import java.net.URI;
6+
import java.nio.file.Files;
67
import java.nio.file.Path;
78
import java.nio.file.Paths;
89
import org.apache.maven.surefire.shared.io.FileUtils;
@@ -17,6 +18,10 @@ public class LocalClient implements IClient {
1718

1819
LocalClient(String rootPath) {
1920
this.rootDir = Paths.get(URI.create(rootPath));
21+
if (!Files.exists(rootDir) && !Files.isDirectory(rootDir)) {
22+
throw new IllegalArgumentException(String.format("No valid folder %s", rootPath));
23+
}
24+
2025
LOGGER.info("Created LocalClient");
2126
}
2227

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package de.upb.upcy.update.dockerize;
2+
3+
import junit.framework.TestCase;
4+
5+
public class IClientTest extends TestCase {
6+
7+
public void testCreateClient() {
8+
final IClient client = IClient.createClient("file:/home", "", "");
9+
assertTrue(client instanceof LocalClient);
10+
}
11+
}

upcy.sample.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ NEO4J_USER=neo4j
44
NEO4J_PASS=DUMMYPASSWORD
55
RABBITMQ_USER=myuser
66
RABBITMQ_PASS=mypassword
7-
# to use local folder start with file://.....
8-
FILESERVER_HOST=file://mnt/results
7+
# to use local folder start with file:/.....
8+
FILESERVER_HOST=file:/mnt/results
99
FILESERVER_USER=myuser
1010
FILESERVER_PASS=DUMMYPASSWORD
1111
MONGO_HOST=host.docker.internal

0 commit comments

Comments
 (0)