Skip to content
Snippets Groups Projects
Commit 562d251a authored by Martin Weise's avatar Martin Weise
Browse files

docker compiles

Former-commit-id: 9b29df68
parent 88a9997a
No related branches found
No related tags found
1 merge request!23Sprint results
Showing
with 75 additions and 72 deletions
...@@ -18,10 +18,11 @@ stages: ...@@ -18,10 +18,11 @@ stages:
test-backend: test-backend:
script: script:
- "mvn -f fda-container-service/pom.xml clean test" - "mvn -f fda-container-service/pom.xml clean test"
- "mvn -f fda-table-service/pom.xml clean test"
- "mvn -f fda-database-service/pom.xml clean test" - "mvn -f fda-database-service/pom.xml clean test"
- "mvn -f fda-discovery-server/pom.xml clean test" - "mvn -f fda-discovery-service/pom.xml clean test"
- "mvn -f fda-gateway-service/pom.xml clean test"
- "mvn -f fda-query-service/pom.xml clean test" - "mvn -f fda-query-service/pom.xml clean test"
- "mvn -f fda-table-service/pom.xml clean test"
stage: test stage: test
test-frontend: test-frontend:
script: script:
......
...@@ -36,12 +36,12 @@ services: ...@@ -36,12 +36,12 @@ services:
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
POSTGRES_DB: fda POSTGRES_DB: fda
fda-discovery-server: fda-discovery-service:
restart: always restart: always
container_name: fda-discovery-server container_name: fda-discovery-service
hostname: fda-discovery-server hostname: fda-discovery-service
build: ./fda-discovery-server build: ./fda-discovery-service
image: fda-discovery-server image: fda-discovery-service
networks: networks:
- fda-public - fda-public
environment: environment:
...@@ -62,13 +62,13 @@ services: ...@@ -62,13 +62,13 @@ services:
ports: ports:
- 9095:9095 - 9095:9095
links: links:
- fda-discovery-server - fda-discovery-service
- fda-database-service - fda-database-service
- fda-container-service - fda-container-service
- fda-query-service - fda-query-service
- fda-table-service - fda-table-service
depends_on: depends_on:
- fda-discovery-server - fda-discovery-service
logging: logging:
driver: json-file driver: json-file
...@@ -86,11 +86,11 @@ services: ...@@ -86,11 +86,11 @@ services:
ports: ports:
- 9092:9092 - 9092:9092
links: links:
- fda-discovery-server - fda-discovery-service
- fda-container-service - fda-container-service
- fda-metadata-db - fda-metadata-db
depends_on: depends_on:
- fda-discovery-server - fda-discovery-service
- fda-container-service - fda-container-service
- fda-metadata-db - fda-metadata-db
logging: logging:
...@@ -111,10 +111,10 @@ services: ...@@ -111,10 +111,10 @@ services:
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
links: links:
- fda-discovery-server - fda-discovery-service
- fda-metadata-db - fda-metadata-db
depends_on: depends_on:
- fda-discovery-server - fda-discovery-service
- fda-metadata-db - fda-metadata-db
logging: logging:
driver: json-file driver: json-file
...@@ -135,10 +135,10 @@ services: ...@@ -135,10 +135,10 @@ services:
volumes: volumes:
- /tmp:/tmp - /tmp:/tmp
links: links:
- fda-discovery-server - fda-discovery-service
- fda-container-service - fda-container-service
depends_on: depends_on:
- fda-discovery-server - fda-discovery-service
- fda-container-service - fda-container-service
logging: logging:
driver: json-file driver: json-file
...@@ -161,10 +161,10 @@ services: ...@@ -161,10 +161,10 @@ services:
- /tmp:/tmp - /tmp:/tmp
links: links:
- fda-metadata-db - fda-metadata-db
- fda-discovery-server - fda-discovery-service
depends_on: depends_on:
- fda-metadata-db - fda-metadata-db
- fda-discovery-server - fda-discovery-service
fda-analyse-service: fda-analyse-service:
restart: always restart: always
...@@ -177,8 +177,8 @@ services: ...@@ -177,8 +177,8 @@ services:
- fda-userdb - fda-userdb
command: sh -c "/wait && flask run" command: sh -c "/wait && flask run"
environment: environment:
EUREKA_SERVER: http://fda-discovery-server:9090/eureka EUREKA_SERVER: http://fda-discovery-service:9090/eureka
WAIT_HOSTS: fda-discovery-server:9090 WAIT_HOSTS: fda-discovery-service:9090
WAIT_HOSTS_TIMEOUT: 600 WAIT_HOSTS_TIMEOUT: 600
WAIT_SLEEP_INTERVAL: 30 WAIT_SLEEP_INTERVAL: 30
WAIT_HOST_CONNECT_TIMEOUT: 30 WAIT_HOST_CONNECT_TIMEOUT: 30
...@@ -187,9 +187,9 @@ services: ...@@ -187,9 +187,9 @@ services:
volumes: volumes:
- /tmp:/tmp - /tmp:/tmp
links: links:
- fda-discovery-server - fda-discovery-service
depends_on: depends_on:
- fda-discovery-server - fda-discovery-service
logging: logging:
driver: json-file driver: json-file
......
File moved
...@@ -8,11 +8,11 @@ RUN mvn -fn -B dependency:go-offline > /dev/null ...@@ -8,11 +8,11 @@ RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./src ./src COPY ./src ./src
RUN mvn -q clean package > /dev/null RUN mvn -q clean package -DskipTests
###### SECOND STAGE ###### ###### SECOND STAGE ######
FROM openjdk:11-jre-slim as runtime FROM openjdk:11-jre-slim as runtime
COPY --from=build ./target/fda-discovery-server-*.jar ./discovery.jar COPY --from=build ./target/fda-discovery-service-*.jar ./discovery.jar
ENTRYPOINT ["java", "-jar", "./discovery.jar"] ENTRYPOINT ["java", "-jar", "./discovery.jar"]
\ No newline at end of file
File moved
File moved
...@@ -7,21 +7,41 @@ ...@@ -7,21 +7,41 @@
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.10.RELEASE</version> <version>2.3.10.RELEASE</version>
</parent> </parent>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-discovery-server</artifactId> <artifactId>fda-discovery-service</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>fda-discovery-server</name> <name>fda-discovery-service</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<packaging>jar</packaging>
<modules />
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
<spring-cloud.version>3.0.1</spring-cloud.version> <spring-cloud.version>3.0.1</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>${spring-cloud.version}</artifactId> <artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
<version>${spring-cloud.version}</version>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
server.port=9090 server.port=9090
spring.application.name=fda-discovery-server spring.application.name=fda-discovery-service
spring.main.banner-mode=off spring.main.banner-mode=off
spring.cloud.loadbalancer.ribbon.enabled=false spring.cloud.loadbalancer.ribbon.enabled=false
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
logging.pattern.console=%d %highlight(%-5level): %msg%n logging.pattern.console=%d %highlight(%-5level): %msg%n
eureka.instance.hostname=fda-discovery-server eureka.instance.hostname=fda-discovery-service
eureka.client.register-with-eureka=false eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false eureka.client.fetch-registry=false
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/ eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file
server.port=9090 server.port=9090
spring.application.name=fda-discovery-server spring.application.name=fda-discovery-service
eureka.client.register-with-eureka=false eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false eureka.client.fetch-registry=false
eureka.instance.hostname=localhost eureka.instance.hostname=localhost
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId> <artifactId>spring-cloud-starter-gateway</artifactId>
<version>${spring-cloud.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId> <artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>${spring-cloud.version}</version> <version>${spring-cloud.version}</version>
</dependency> </dependency>
<!-- Data Source --> <!-- Data Source -->
<dependency> <dependency>
......
package at.tuwien.endpoint; package at.tuwien.endpoint;
import at.tuwien.dto.ExecuteQueryDTO; import at.tuwien.dto.ExecuteQueryDTO;
import at.tuwien.dto.ExecuteStatementDTO;
import at.tuwien.dto.QueryDto; import at.tuwien.dto.QueryDto;
import at.tuwien.entity.Query; import at.tuwien.entity.Query;
import at.tuwien.entity.QueryResult; import at.tuwien.entity.QueryResult;
...@@ -15,6 +14,7 @@ import io.swagger.annotations.ApiResponse; ...@@ -15,6 +14,7 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -22,11 +22,8 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -22,11 +22,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.sql.SQLSyntaxErrorException; import java.sql.SQLSyntaxErrorException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -65,9 +62,10 @@ public class QueryEndpoint { ...@@ -65,9 +62,10 @@ public class QueryEndpoint {
@ApiResponse(code = 404, message = "The database does not exist."), @ApiResponse(code = 404, message = "The database does not exist."),
@ApiResponse(code = 405, message = "The container is not running."), @ApiResponse(code = 405, message = "The container is not running."),
@ApiResponse(code = 409, message = "The container image is not supported."),}) @ApiResponse(code = 409, message = "The container image is not supported."),})
public ResponseEntity create(@PathVariable Long id) throws ImageNotSupportedException, DatabaseConnectionException, DatabaseNotFoundException { public ResponseEntity<?> create(@PathVariable Long id) throws ImageNotSupportedException, DatabaseConnectionException, DatabaseNotFoundException {
queryService.create(id); queryService.create(id);
return ResponseEntity.status(HttpStatus.CREATED).build(); return ResponseEntity.status(HttpStatus.CREATED)
.build();
} }
@PutMapping("/query") @PutMapping("/query")
...@@ -77,25 +75,23 @@ public class QueryEndpoint { ...@@ -77,25 +75,23 @@ public class QueryEndpoint {
@ApiResponse(code = 404, message = "The database does not exist."), @ApiResponse(code = 404, message = "The database does not exist."),
@ApiResponse(code = 405, message = "The container is not running."), @ApiResponse(code = 405, message = "The container is not running."),
@ApiResponse(code = 409, message = "The container image is not supported."),}) @ApiResponse(code = 409, message = "The container image is not supported."),})
public Response modify(@PathVariable Long id, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException { public ResponseEntity<?> modify(@PathVariable Long id, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException {
QueryResult qr = queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto)); QueryResult qr = queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto));
return Response return ResponseEntity.status(HttpStatus.OK)
.status(Response.Status.OK) .contentType(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON)
.build(); .build();
} }
@PutMapping("/query/version/{timestamp}") @PutMapping("/query/version/{timestamp}")
@ApiOperation(value = "executes a query with a given timestamp") @ApiOperation(value = "executes a query with a given timestamp")
@ApiResponses(value = {@ApiResponse(code = 201, message = "result of Query with Timestamp", response = Response.class)}) @ApiResponses(value = {@ApiResponse(code = 201, message = "result of Query with Timestamp")})
public Response modify(@PathVariable Long id, @PathVariable String timestamp, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException { public ResponseEntity<?> modify(@PathVariable Long id, @PathVariable String timestamp, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException {
queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto)); queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto));
return Response return ResponseEntity.status(HttpStatus.OK)
.status(Response.Status.OK) .contentType(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON)
.build(); .build();
} }
......
...@@ -2,27 +2,28 @@ ...@@ -2,27 +2,28 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<modules>
<module>rest-service</module>
<module>services</module>
<module>gateways</module>
</modules>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version> <version>2.3.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-table-service</artifactId> <artifactId>fda-table-service</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>fda-table-service</name> <name>fda-table-service</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<packaging>pom</packaging>
<modules>
<module>rest-service</module>
<module>services</module>
<module>gateways</module>
</modules>
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
<spring-cloud.version>Hoxton.SR8</spring-cloud.version> <spring-cloud.version>3.0.1</spring-cloud.version>
<mapstruct.version>1.4.2.Final</mapstruct.version> <mapstruct.version>1.4.2.Final</mapstruct.version>
<docker.version>3.2.7</docker.version> <docker.version>3.2.7</docker.version>
<testcontainers.version>1.15.2</testcontainers.version> <testcontainers.version>1.15.2</testcontainers.version>
...@@ -41,14 +42,8 @@ ...@@ -41,14 +42,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <artifactId>spring-cloud-starter</artifactId>
<version>3.0.1</version> <version>${spring-cloud.version}</version>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
...@@ -166,15 +161,4 @@ ...@@ -166,15 +161,4 @@
<version>1.0.1.RELEASE</version> <version>1.0.1.RELEASE</version>
</dependency> </dependency>
</dependencies> </dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project> </project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment