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

docker compiles

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