Compare commits
No commits in common. "201c448e8cb95d54596f223724a279090698ea45" and "56a68bc86757ec85ab9ff201c3335a6d96df84ab" have entirely different histories.
201c448e8c
...
56a68bc867
9 changed files with 27 additions and 61 deletions
|
@ -1,13 +0,0 @@
|
|||
depends_on:
|
||||
- oci-image-build
|
||||
|
||||
steps:
|
||||
delete-tag:
|
||||
image: rg.fr-par.scw.cloud/hamburghammer/scaleway-delete-image-plugin
|
||||
pull: true
|
||||
settings:
|
||||
token:
|
||||
from_secret: docker_token
|
||||
image-name: dchat/setup-image
|
||||
tag: "${CI_PIPELINE_NUMBER}"
|
||||
region: fr-par
|
|
@ -12,13 +12,16 @@ variables:
|
|||
steps:
|
||||
compile:
|
||||
image: *image
|
||||
group: compile
|
||||
commands:
|
||||
- mvn --batch-mode --no-transfer-progress -pl ${MODULE} -am compile
|
||||
test:
|
||||
image: *image
|
||||
group: test
|
||||
commands:
|
||||
- mvn --batch-mode --no-transfer-progress -pl ${MODULE} -am test
|
||||
build:
|
||||
image: *image
|
||||
group: build
|
||||
commands:
|
||||
- mvn --batch-mode --no-transfer-progress -Dmaven.test.skip -pl ${MODULE} -am install
|
||||
|
|
|
@ -13,11 +13,13 @@ labels:
|
|||
platform: linux/amd64
|
||||
|
||||
depends_on:
|
||||
- oci-image-cache-build
|
||||
- java
|
||||
- nodejs
|
||||
|
||||
steps:
|
||||
build-only:
|
||||
image: woodpeckerci/plugin-docker-buildx:2.3.0
|
||||
group: build
|
||||
settings:
|
||||
registry: rg.fr-par.scw.cloud/hamburghammer
|
||||
username: nologin
|
||||
|
@ -30,8 +32,6 @@ steps:
|
|||
pull_image: false
|
||||
platforms: ${PLATFORM}
|
||||
dry-run: true
|
||||
build_args:
|
||||
- SETUP_IMAGE=rg.fr-par.scw.cloud/hamburghammer/dchat/setup-image:${CI_PIPELINE_NUMBER}
|
||||
when:
|
||||
- event: [push, manual]
|
||||
branch:
|
||||
|
@ -39,6 +39,7 @@ steps:
|
|||
|
||||
build:
|
||||
image: woodpeckerci/plugin-docker-buildx:2.3.0
|
||||
group: build
|
||||
settings:
|
||||
registry: rg.fr-par.scw.cloud/hamburghammer
|
||||
username: nologin
|
||||
|
@ -51,7 +52,5 @@ steps:
|
|||
pull_image: false
|
||||
platforms: ${PLATFORM}
|
||||
auto_tag: true
|
||||
build_args:
|
||||
- SETUP_IMAGE=rg.fr-par.scw.cloud/hamburghammer/dchat/setup-image:${CI_PIPELINE_NUMBER}
|
||||
when:
|
||||
- branch: main
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
matrix:
|
||||
PLATFORM:
|
||||
# - linux/amd64
|
||||
- linux/arm64
|
||||
|
||||
labels:
|
||||
platform: linux/amd64
|
||||
|
||||
depends_on:
|
||||
- java
|
||||
- nodejs
|
||||
|
||||
steps:
|
||||
build:
|
||||
image: woodpeckerci/plugin-docker-buildx:2.3.0
|
||||
settings:
|
||||
registry: rg.fr-par.scw.cloud/hamburghammer
|
||||
username: nologin
|
||||
password:
|
||||
from_secret: docker_token
|
||||
dockerfile: Dockerfile
|
||||
target: setup-image
|
||||
repo: rg.fr-par.scw.cloud/hamburghammer/dchat/setup-image
|
||||
tag: "${CI_PIPELINE_NUMBER}"
|
||||
pull_image: false
|
||||
platforms: ${PLATFORM}
|
|
@ -1,17 +1,14 @@
|
|||
# syntax=docker/dockerfile:1.4.0
|
||||
|
||||
ARG MAVEN_CLI_OPTS="--batch-mode --no-transfer-progress -Dmaven.test.skip"
|
||||
ARG SETUP_IMAGE=setup-image
|
||||
|
||||
# Copy all project files
|
||||
FROM docker.io/maven:3.9-eclipse-temurin-21 AS setup-image
|
||||
FROM docker.io/maven:3.9-eclipse-temurin-21 AS setup
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN --mount=type=cache,target=/root/.m2/ \
|
||||
mvn ${MAVEN_CLI_OPTS} package
|
||||
|
||||
FROM ${SETUP_IMAGE} as setup
|
||||
|
||||
# Create final monolith
|
||||
FROM docker.io/eclipse-temurin:21-jdk-jammy AS monolith
|
||||
WORKDIR /app
|
||||
|
|
|
@ -6,17 +6,24 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
import java.util.List;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record ChatGPTResponse(Usage usage,
|
||||
List<Choice> choices) {
|
||||
public record ChatGPTResponse(String id,
|
||||
String object,
|
||||
long created,
|
||||
String model,
|
||||
Usage usage,
|
||||
List<Choice> choices,
|
||||
@JsonProperty("system_fingerprint") String systemFingerprint) {
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record Usage(@JsonProperty("prompt_tokens") int promptTokens,
|
||||
@JsonProperty("completion_tokens") int completionTokens,
|
||||
@JsonProperty("total_tokens") int totalTokens) {
|
||||
}
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record Choice(Message message) {
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record Choice(Message message, @JsonProperty("finish_reason") String finishReason, int index) {
|
||||
public record Message(String role, String content) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@ import java.util.List;
|
|||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public final class App {
|
||||
public class App {
|
||||
private static final Logger logger = LoggerFactory.getLogger(App.class);
|
||||
|
||||
public static void main(final String[] args) {
|
||||
public static void main(String[] args) {
|
||||
final String discordApiKey = System.getenv("DISCORD_API_KEY");
|
||||
if (discordApiKey == null) {
|
||||
logger.error("Missing environment variables: DISCORD_API_KEY");
|
||||
|
@ -63,12 +63,12 @@ public final class App {
|
|||
}
|
||||
}
|
||||
|
||||
private static void run(final Runnable... apps) throws InterruptedException {
|
||||
final List<Callable<Void>> callableApps = Arrays.stream(apps).sequential().map(runnable -> (Callable<Void>) () -> {
|
||||
private static void run(Runnable... apps) throws InterruptedException {
|
||||
List<Callable<Void>> callableApps = Arrays.stream(apps).sequential().map(runnable -> (Callable<Void>) () -> {
|
||||
runnable.run();
|
||||
return null;
|
||||
}).toList();
|
||||
try (final var executorService = Executors.newFixedThreadPool(apps.length)) {
|
||||
try (var executorService = Executors.newFixedThreadPool(apps.length)) {
|
||||
executorService.invokeAll(callableApps);
|
||||
}
|
||||
}
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -61,7 +61,7 @@
|
|||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.5.3</version>
|
||||
<version>1.4.14</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -73,7 +73,7 @@
|
|||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.7.2</version>
|
||||
<version>42.7.1</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -99,7 +99,7 @@
|
|||
<dependency>
|
||||
<groupId>io.javalin</groupId>
|
||||
<artifactId>javalin</artifactId>
|
||||
<version>6.1.3</version>
|
||||
<version>6.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.javacord</groupId>
|
||||
|
|
|
@ -36,7 +36,6 @@ public final class WebAPI implements Runnable {
|
|||
config.http.prefer405over404 = true; // return 405 instead of 404 if path is mapped to different HTTP method
|
||||
config.http.defaultContentType = "application/json";
|
||||
config.useVirtualThreads = true;
|
||||
config.showJavalinBanner = false;
|
||||
config.router.apiBuilder(() ->
|
||||
path("api", () -> {
|
||||
path("servers", () -> crud("configs/{id}", new ConfigCrudHandler(this.serverDBService)));
|
||||
|
|
Loading…
Reference in a new issue