refactoring

This commit is contained in:
Michele Artini 2023-09-13 09:40:49 +02:00
parent ed27a399a5
commit f155e1ca8a
90 changed files with 220 additions and 56 deletions

14
apps/collector/dockerfile Normal file
View File

@ -0,0 +1,14 @@
# Fetching latest version of Java
FROM openjdk:18
# Setting up work directory
WORKDIR /app
# Copy the jar file into our app
COPY ./target/*.jar /app/app.jar
# Exposing port 8080
EXPOSE 8080
# Starting the application
CMD ["java", "-jar", "app.jar"]

View File

@ -0,0 +1,5 @@
server.title = D-NET Collector API
server.description = Simple service to collect metadata
server.public_url =
maven.pom.path = /META-INF/maven/eu.dnetlib.docker/dnet-collector/effective-pom.xml

14
apps/email/dockerfile Normal file
View File

@ -0,0 +1,14 @@
# Fetching latest version of Java
FROM openjdk:18
# Setting up work directory
WORKDIR /app
# Copy the jar file into our app
COPY ./target/*.jar /app/app.jar
# Exposing port 8080
EXPOSE 8080
# Starting the application
CMD ["java", "-jar", "app.jar"]

View File

@ -1,7 +1,9 @@
package eu.dnetlib.utils.mail;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "mail")
public class EmailConfiguration {

View File

@ -42,9 +42,16 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>dnet-common</artifactId>
<artifactId>dnet-app-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>dnet-model</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>

View File

@ -130,8 +130,8 @@ INSERT INTO resource_types(id, name, content_type) VALUES
('transformation_rule_xslt', 'Transformation Rules (xslt)', 'application/xml'),
('transformation_rule_legacy', 'Transformation Rules (legacy)', 'text/plain'),
('cleaning_rule', 'Cleaning Rules', 'application/xml'),
('hadoop_job_configuration', 'Hadoop Job Configurations', 'application/xml')
('dedup_configuration', 'Dedup Configurations', 'application/json')
('hadoop_job_configuration', 'Hadoop Job Configurations', 'application/xml'),
('dedup_configuration', 'Dedup Configurations', 'application/json'),
('wf_template', 'Workflow Templates', 'application/json');
CREATE TABLE resources (

63
docker-compose.yml Normal file
View File

@ -0,0 +1,63 @@
version: "3"
services:
collect:
build: ./apps/collector
ports:
- "8080:8080"
networks:
- backend
depends_on:
- postgresdb
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgresdb:5432/dnet_is
- SPRING_DATASOURCE_USERNAME=dnet
- SPRING_DATASOURCE_PASSWORD=ax45vs#1A
email:
build: ./apps/email
ports:
- "8081:8081"
networks:
- backend
depends_on:
- postgresdb
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgresdb:5432/dnet_is
- SPRING_DATASOURCE_USERNAME=dnet
- SPRING_DATASOURCE_PASSWORD=ax45vs#1A
postgresdb:
image: postgres:15.4
restart: always
ports:
- "5432:5432"
networks:
- backend
environment:
POSTGRES_USER: dnet
POSTGRES_PASSWORD: ax45vs#1A
POSTGRES_DB: dnet_is
volumes:
- ./data/sql/schema.sql:/docker-entrypoint-initdb.d/init.sql
- pgdata:/var/lib/postgresql/data
solr:
image: solr:9.3.0
ports:
- "8983:8983"
networks:
- backend
volumes:
- solrdata:/var/solr
command:
- solr-precreate
- gettingstarted
networks:
backend:
frontend:
volumes:
solrdata:
pgdata:

View File

@ -9,46 +9,15 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>dnet-common</artifactId>
<artifactId>dnet-app-common</artifactId>
<packaging>jar</packaging>
<name>dnet-common</name>
<description>D-Net common library</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-62</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
</dependency>
<!-- JAXB API, java.xml.bind module -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<!-- JAXB Runtime, com.sun.xml.bind module -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<!-- for /metrics and /health controllers -->
<dependency>
@ -75,7 +44,6 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>${prometheus.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
@ -86,17 +54,14 @@
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_servlet</artifactId>
<version>${prometheus.version}</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_web</artifactId>
<version>0.3.0</version>
</dependency>
<!-- Tests -->

69
libs/dnet-model/pom.xml Normal file
View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>eu.dnetlib.docker</groupId>
<artifactId>libs</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dnet-model</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-62</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
<scope>provided</scope>
</dependency>
<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,23 @@
{
"id": "",
"name": "fffff",
"section": "GC",
"enabled": true,
"priority": 75,
"workflow": "09991db4-79e6-4e7c-a388-5063955bf9d8",
"schedulingEnabled": true,
"cronExpression": "0 30 12 1/1 * ?",
"cronMinInterval": 9600,
"details": {
},
"configured": true,
"systemParams": {
},
"userParams": {
"Name": "xxx",
"Age": "xxx",
"Birthday": "xxxx"
}
}

View File

@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>eu.dnetlib.docker</groupId>
<artifactId>dnet-parent</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<parent>
<groupId>eu.dnetlib.docker</groupId>
<artifactId>dnet-parent</artifactId>
<version>7.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>libs</artifactId>
<packaging>pom</packaging>
<modules>
<module>dnet-common</module>
</modules>
<modelVersion>4.0.0</modelVersion>
<artifactId>libs</artifactId>
<packaging>pom</packaging>
<modules>
<module>dnet-app-common</module>
<module>dnet-model</module>
</modules>
</project>

View File

@ -181,15 +181,16 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.1</version>
</dependency>
<!-- JAXB Runtime, com.sun.xml.bind module -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<version>4.0.3</version>
</dependency>
<!-- Mail -->
<dependency>