System property 'jibSerialize' causes build steps to be executed serially
DjibSerialize=true for the win
@@ -33,6 +33,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.annotation.Nullable;
@@ -44,8 +45,7 @@ import javax.annotation.Nullable;
*/
public class StepsRunner {
- private final ListeningExecutorService listeningExecutorService =
- MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
+ private final ListeningExecutorService listeningExecutorService;
private final BuildConfiguration buildConfiguration;
private final SourceFilesConfiguration sourceFilesConfiguration;
private final Cache baseLayersCache;
@@ -76,6 +76,12 @@ public class StepsRunner {
this.sourceFilesConfiguration = sourceFilesConfiguration;
this.baseLayersCache = baseLayersCache;
this.applicationLayersCache = applicationLayersCache;
+
+ ExecutorService executorService =
+ Boolean.getBoolean("jibSerialized")
+ ? MoreExecutors.newDirectExecutorService()
+ : Executors.newCachedThreadPool();
+ listeningExecutorService = MoreExecutors.listeningDecorator(executorService);
}
public StepsRunner runRetrieveTargetRegistryCredentialsStep() {
