Search in sources :

Example 1 with SampleBucket

use of com.hartwig.platinum.config.SampleBucket in project platinum by hartwigmedical.

the class Platinum method run.

public void run() {
    LOGGER.info("Starting platinum run with name {} and input {}", Console.bold(runName), Console.bold(input));
    GcpConfiguration gcpConfiguration = configuration.gcp();
    PipelineServiceAccount serviceAccount = PipelineServiceAccount.from(iam, resourceManager, runName, gcpConfiguration.projectOrThrow(), configuration);
    String serviceAccountEmail = serviceAccount.findOrCreate();
    ServiceAccountPrivateKey privateKey = ServiceAccountPrivateKey.from(configuration, iam);
    JsonKey jsonKey = privateKey.create(gcpConfiguration.projectOrThrow(), serviceAccountEmail);
    List<TumorNormalPair> pairs = DecomposeSamples.apply(configuration.sampleBucket().map(b -> new SampleBucket(storage.get(b)).apply()).orElseGet(configuration::samples));
    int submitted = kubernetesEngine.findOrCreate(runName, pairs, jsonKey, OutputBucket.from(storage).findOrCreate(runName, gcpConfiguration.regionOrThrow(), serviceAccountEmail, configuration), serviceAccountEmail).submit(samples(configuration, pairs, runName));
    LOGGER.info("Platinum started {} pipelines on GCP", Console.bold(String.valueOf(submitted)));
    LOGGER.info("You can monitor their progress with: {}", Console.bold("./platinum status"));
}
Also used : PipelineServiceAccount(com.hartwig.platinum.iam.PipelineServiceAccount) GcpConfiguration(com.hartwig.platinum.config.GcpConfiguration) TumorNormalPair(com.hartwig.platinum.p5sample.TumorNormalPair) ServiceAccountPrivateKey(com.hartwig.platinum.iam.ServiceAccountPrivateKey) SampleBucket(com.hartwig.platinum.config.SampleBucket) JsonKey(com.hartwig.platinum.iam.JsonKey)

Aggregations

GcpConfiguration (com.hartwig.platinum.config.GcpConfiguration)1 SampleBucket (com.hartwig.platinum.config.SampleBucket)1 JsonKey (com.hartwig.platinum.iam.JsonKey)1 PipelineServiceAccount (com.hartwig.platinum.iam.PipelineServiceAccount)1 ServiceAccountPrivateKey (com.hartwig.platinum.iam.ServiceAccountPrivateKey)1 TumorNormalPair (com.hartwig.platinum.p5sample.TumorNormalPair)1