Skip to content

Commit

Permalink
control-service: make timeout configurable (#2951)
Browse files Browse the repository at this point in the history
# Why
I am deploying a job which takes a longtime to build. 
I want the system to poll for longer

# What
Make the length of time we poll for configurable. 


# How was this tested. 
Tests are checking that the current impl works. 
Tonight I will be using the new config to build my new job. 


Signed-off-by: murphp15 <[email protected]>
  • Loading branch information
murphp15 authored Nov 28, 2023
1 parent 50136ab commit 106715d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
public class JobImageBuilder {
private static final Logger log = LoggerFactory.getLogger(JobImageBuilder.class);

private static final int BUILDER_TIMEOUT_SECONDS = 1800;
private static final String REGISTRY_TYPE_ECR = "ecr";
private static final String REGISTRY_TYPE_GENERIC = "generic";

Expand Down Expand Up @@ -81,6 +80,9 @@ public class JobImageBuilder {
@Value("${datajobs.deployment.builder.serviceAccountName}")
private String builderServiceAccountName;

@Value("${datajobs.deployment.builder.builderTimeoutSeconds:1800}")
private int builderTimeoutSeconds;

private final ControlKubernetesService controlKubernetesService;
private final DockerRegistryService dockerRegistryService;
private final DeploymentNotificationHelper notificationHelper;
Expand Down Expand Up @@ -228,7 +230,7 @@ public boolean buildImage(

var condition =
controlKubernetesService.watchJob(
builderJobName, BUILDER_TIMEOUT_SECONDS, s -> log.debug("Wait status: {}", s));
builderJobName, builderTimeoutSeconds, s -> log.debug("Wait status: {}", s));

log.debug("Finished watching builder job {}. Condition is: {}", builderJobName, condition);
String logs = null;
Expand Down

0 comments on commit 106715d

Please sign in to comment.