feat: add RuntimeOrchestrator interface and request/response types
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package net.siegeln.cameleer.saas.runtime;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public record BuildImageRequest(
|
||||
String baseImage,
|
||||
Path jarPath,
|
||||
String imageTag
|
||||
) {}
|
||||
@@ -0,0 +1,8 @@
|
||||
package net.siegeln.cameleer.saas.runtime;
|
||||
|
||||
public record ContainerStatus(
|
||||
String state,
|
||||
boolean running,
|
||||
int exitCode,
|
||||
String error
|
||||
) {}
|
||||
@@ -0,0 +1,6 @@
|
||||
package net.siegeln.cameleer.saas.runtime;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface LogConsumer {
|
||||
void accept(String stream, String message, long timestampMillis);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package net.siegeln.cameleer.saas.runtime;
|
||||
|
||||
public interface RuntimeOrchestrator {
|
||||
String buildImage(BuildImageRequest request);
|
||||
String startContainer(StartContainerRequest request);
|
||||
void stopContainer(String containerId);
|
||||
void removeContainer(String containerId);
|
||||
ContainerStatus getContainerStatus(String containerId);
|
||||
void streamLogs(String containerId, LogConsumer consumer);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.siegeln.cameleer.saas.runtime;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public record StartContainerRequest(
|
||||
String imageRef,
|
||||
String containerName,
|
||||
String network,
|
||||
Map<String, String> envVars,
|
||||
long memoryLimitBytes,
|
||||
int cpuShares,
|
||||
int healthCheckPort
|
||||
) {}
|
||||
Reference in New Issue
Block a user