use of com.hartwig.platinum.iam.ServiceAccountPrivateKey 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"));
}
Aggregations