fix: pull base image on deploy and fix registry prefix default
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m16s
CI / docker (push) Successful in 1m8s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 38s

The PULL_IMAGE deploy stage was a no-op — Docker only pulls on create
if the image is missing entirely, not when a newer version exists.
DeploymentExecutor now calls orchestrator.pullImage() to fetch the
latest base image from the registry before creating containers.

Also fixes the default base image from 'cameleer-runtime-base:latest'
(local-only name) to the fully qualified registry path
'gitea.siegeln.net/cameleer/cameleer-runtime-base:latest'.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-15 11:29:58 +02:00
parent fd806b9f2d
commit 1077293343
4 changed files with 19 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ public class DeploymentExecutor {
@Autowired(required = false) @Autowired(required = false)
private DockerNetworkManager networkManager; private DockerNetworkManager networkManager;
@Value("${cameleer.server.runtime.baseimage:cameleer-runtime-base:latest}") @Value("${cameleer.server.runtime.baseimage:gitea.siegeln.net/cameleer/cameleer-runtime-base:latest}")
private String baseImage; private String baseImage;
@Value("${cameleer.server.runtime.dockernetwork:cameleer}") @Value("${cameleer.server.runtime.dockernetwork:cameleer}")
@@ -133,7 +133,7 @@ public class DeploymentExecutor {
// === PULL IMAGE === // === PULL IMAGE ===
updateStage(deployment.id(), DeployStage.PULL_IMAGE); updateStage(deployment.id(), DeployStage.PULL_IMAGE);
// Docker pulls on create if not present locally orchestrator.pullImage(baseImage);
// === CREATE NETWORKS === // === CREATE NETWORKS ===
updateStage(deployment.id(), DeployStage.CREATE_NETWORK); updateStage(deployment.id(), DeployStage.CREATE_NETWORK);

View File

@@ -49,6 +49,20 @@ public class DockerRuntimeOrchestrator implements RuntimeOrchestrator {
return true; return true;
} }
@Override
public void pullImage(String image) {
try {
log.info("Pulling image {}", image);
dockerClient.pullImageCmd(image).start().awaitCompletion();
log.info("Image pulled: {}", image);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.warn("Image pull interrupted for {}", image);
} catch (Exception e) {
log.warn("Failed to pull image {} (will use local cache if available): {}", image, e.getMessage());
}
}
@Override @Override
public String startContainer(ContainerRequest request) { public String startContainer(ContainerRequest request) {
List<String> envList = request.envVars().entrySet().stream() List<String> envList = request.envVars().entrySet().stream()

View File

@@ -43,7 +43,7 @@ cameleer:
runtime: runtime:
enabled: ${CAMELEER_SERVER_RUNTIME_ENABLED:true} enabled: ${CAMELEER_SERVER_RUNTIME_ENABLED:true}
jarstoragepath: ${CAMELEER_SERVER_RUNTIME_JARSTORAGEPATH:/data/jars} jarstoragepath: ${CAMELEER_SERVER_RUNTIME_JARSTORAGEPATH:/data/jars}
baseimage: ${CAMELEER_SERVER_RUNTIME_BASEIMAGE:cameleer-runtime-base:latest} baseimage: ${CAMELEER_SERVER_RUNTIME_BASEIMAGE:gitea.siegeln.net/cameleer/cameleer-runtime-base:latest}
dockernetwork: ${CAMELEER_SERVER_RUNTIME_DOCKERNETWORK:cameleer} dockernetwork: ${CAMELEER_SERVER_RUNTIME_DOCKERNETWORK:cameleer}
agenthealthport: 9464 agenthealthport: 9464
healthchecktimeout: 60 healthchecktimeout: 60

View File

@@ -4,6 +4,8 @@ import java.util.stream.Stream;
public interface RuntimeOrchestrator { public interface RuntimeOrchestrator {
boolean isEnabled(); boolean isEnabled();
/** Pull the latest version of a container image from the registry. */
default void pullImage(String image) {}
String startContainer(ContainerRequest request); String startContainer(ContainerRequest request);
void stopContainer(String containerId); void stopContainer(String containerId);
void removeContainer(String containerId); void removeContainer(String containerId);