Skip to content

Commit

Permalink
Merge branch 'develop' into feature/integrate-lang-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich authored Aug 20, 2024
2 parents 9105afd + 351b4b5 commit 7d63439
Show file tree
Hide file tree
Showing 24 changed files with 1,617 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ intelligence-service:
- changed-files:
- any-glob-to-any-file: "server/intelligence-service/**"

webhook-ingest:
- changed-files:
- any-glob-to-any-file: "server/webhook-ingest/**"

feature:
- head-branch: ['^feature', 'feature', '^feat', 'feat']

Expand Down
12 changes: 10 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
"cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"
],
"editor.codeActionsOnSave": {
"source.fixAll": true
}
"source.fixAll": "explicit"
},
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"python.testing.pytestArgs": ["."],
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
1 change: 1 addition & 0 deletions build_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nixpacks build -n hephaestus-application-server server/application-server
30 changes: 27 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
services:
application-server:
image: hephaestus-application-server
ports:
- '8080'
environment:
- SPRING_PROFILES_ACTIVE=prod
- DATABASE_URL=jdbc:postgresql://postgres:5432/hephaestus
- DATABASE_USERNAME=root
- DATABASE_PASSWORD=root
- SECURITY_USER_NAME=${SECURITY_USER_NAME:-admin}
- SECURITY_USER_PASSWORD=${SECURITY_USER_NAME:-admin_password}
depends_on:
- postgres
networks:
- app-network

postgres:
image: 'postgres:latest'
environment:
POSTGRES_DB: hephaestus
POSTGRES_PASSWORD: root
POSTGRES_USER: root
- POSTGRES_DB=hephaestus
- POSTGRES_PASSWORD=root
- POSTGRES_USER=root
ports:
- '5432'
networks:
app-network:
aliases:
- postgres

networks:
app-network:
driver: bridge`
30 changes: 30 additions & 0 deletions project.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"folders": [
{
"name": "Hephaestus",
"path": "./"
},
{
"name": "webapp",
"path": "./webapp"
},
{
"name": "server/application-server",
"path": "./server/application-server"
},
{
"name": "server/intelligence-service",
"path": "./server/intelligence-service"
},
{
"name": "server/webhook-ingest",
"path": "./server/webhook-ingest"
},
],
"settings": {
"java.compile.nullAnalysis.mode": "automatic",
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
}
}
5 changes: 5 additions & 0 deletions server/application-server/nixpacks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[variables]
NIXPACKS_JDK_VERSION = '21'

[phases.build]
cmds = ['chmod +x ./mvnw && ./mvnw -DskipTests clean package']
27 changes: 24 additions & 3 deletions server/application-server/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<relativePath /> <!-- lookup parent from repository -->
<relativePath />
<!-- lookup parent from repository -->
</parent>
<groupId>de.tum.in.www1</groupId>
<artifactId>hephaestus</artifactId>
Expand Down Expand Up @@ -111,8 +111,29 @@
<artifactId>therapi-runtime-javadoc</artifactId>
<version>0.15.0</version>
</dependency>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-starter-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.modulith</groupId>
<artifactId>spring-modulith-bom</artifactId>
<version>1.2.2</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.modulith.Modulithic;

@SpringBootApplication
@Modulithic(systemName = "Hephaestus")
public class Application {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class HephaestusApplicationTests {

@Test
void contextLoads() {
// ContextLoads
assert (true);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package de.tum.in.www1.hephaestus;

import org.junit.jupiter.api.Test;
import org.springframework.modulith.core.ApplicationModules;
import org.springframework.modulith.docs.Documenter;
import org.springframework.modulith.docs.Documenter.DiagramOptions;
import org.springframework.modulith.docs.Documenter.DiagramOptions.DiagramStyle;

public class HephaestusModulithTests {

ApplicationModules modules = ApplicationModules.of(Application.class);

@Test
void shouldBeCompliant() {
modules.forEach(System.out::println);
modules.verify();
}

@Test
void writeDocumentationSnippets() {
DiagramOptions options = DiagramOptions.defaults().withStyle(DiagramStyle.UML);
new Documenter(modules)
.writeModuleCanvases()
.writeModulesAsPlantUml(options)
.writeIndividualModulesAsPlantUml(options);
}

}
17 changes: 17 additions & 0 deletions server/webhook-ingest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3.12 as requirements-stage

WORKDIR /tmp

RUN pip install poetry
COPY ./pyproject.toml ./poetry.lock* /tmp/
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes

FROM python:3.12

WORKDIR /code

COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app

CMD ["fastapi", "run", "app/main.py", "--port", "4200"]
Loading

0 comments on commit 7d63439

Please sign in to comment.