Search in sources :

Example 1 with ArtifactCacheFactory

use of com.facebook.buck.artifact_cache.ArtifactCacheFactory in project buck by facebook.

the class DistBuildFactory method createDistBuildExecutor.

public static DistBuildSlaveExecutor createDistBuildExecutor(BuildJobState jobState, CommandRunnerParams params, WeightedListeningExecutorService executorService, DistBuildService service, DistBuildMode mode, int coordinatorPort, Optional<StampedeId> stampedeId, Optional<Path> globalCacheDir) throws IOException {
    DistBuildState state = DistBuildState.load(Optional.of(params.getBuckConfig()), jobState, params.getCell(), params.getKnownBuildRuleTypesFactory());
    Preconditions.checkArgument(state.getCells().size() > 0);
    // Create a cache factory which uses a combination of the distributed build config,
    // overridden with the local buck config (i.e. the build slave).
    Cell rootCell = Preconditions.checkNotNull(state.getCells().get(0));
    ArtifactCacheFactory distBuildArtifactCacheFactory = params.getArtifactCacheFactory().cloneWith(rootCell.getBuckConfig());
    DistBuildSlaveExecutor executor = new DistBuildSlaveExecutor(DistBuildExecutorArgs.builder().setBuckEventBus(params.getBuckEventBus()).setPlatform(params.getPlatform()).setClock(params.getClock()).setArtifactCache(distBuildArtifactCacheFactory.newInstance(true)).setState(state).setObjectMapper(params.getObjectMapper()).setRootCell(params.getCell()).setParser(params.getParser()).setExecutorService(executorService).setActionGraphCache(params.getActionGraphCache()).setCacheKeySeed(params.getBuckConfig().getKeySeed()).setConsole(params.getConsole()).setProvider(new MultiSourceContentsProvider(service, globalCacheDir)).setExecutors(params.getExecutors()).setDistBuildMode(mode).setCoordinatorPort(coordinatorPort).setStampedeId(stampedeId.orElse(new StampedeId().setId("LOCAL_FILE"))).setVersionedTargetGraphCache(params.getVersionedTargetGraphCache()).build());
    return executor;
}
Also used : MultiSourceContentsProvider(com.facebook.buck.distributed.MultiSourceContentsProvider) StampedeId(com.facebook.buck.distributed.thrift.StampedeId) DistBuildState(com.facebook.buck.distributed.DistBuildState) Cell(com.facebook.buck.rules.Cell) ArtifactCacheFactory(com.facebook.buck.artifact_cache.ArtifactCacheFactory) DistBuildSlaveExecutor(com.facebook.buck.distributed.DistBuildSlaveExecutor)

Aggregations

ArtifactCacheFactory (com.facebook.buck.artifact_cache.ArtifactCacheFactory)1 DistBuildSlaveExecutor (com.facebook.buck.distributed.DistBuildSlaveExecutor)1 DistBuildState (com.facebook.buck.distributed.DistBuildState)1 MultiSourceContentsProvider (com.facebook.buck.distributed.MultiSourceContentsProvider)1 StampedeId (com.facebook.buck.distributed.thrift.StampedeId)1 Cell (com.facebook.buck.rules.Cell)1