use of bio.terra.workspace.generated.model.ApiGcpAiNotebookInstanceCreationParameters in project terra-workspace-manager by DataBiosphere.
the class CreateAiNotebookInstanceStepTest method setFieldsNoFields.
@Test
public void setFieldsNoFields() {
Instance instance = CreateAiNotebookInstanceStep.setFields(new ApiGcpAiNotebookInstanceCreationParameters(), "foo@bar.com", new Instance());
assertThat(instance.getMetadata(), Matchers.aMapWithSize(1));
assertThat(instance.getMetadata(), Matchers.hasEntry("proxy-mode", "service_" + "account"));
assertEquals("foo@bar.com", instance.getServiceAccount());
assertEquals(sa_scopes, instance.getServiceAccountScopes());
assertEquals(DEFAULT_POST_STARTUP_SCRIPT, instance.getPostStartupScript());
}
use of bio.terra.workspace.generated.model.ApiGcpAiNotebookInstanceCreationParameters in project terra-workspace-manager by DataBiosphere.
the class CreateAiNotebookInstanceStepTest method setFields.
@Test
public void setFields() {
var creationParameters = new ApiGcpAiNotebookInstanceCreationParameters().postStartupScript("script.sh").machineType("machine-type").installGpuDriver(true).customGpuDriverPath("custom-path").bootDiskType("boot-disk-type").bootDiskSizeGb(111L).dataDiskType("data-disk-type").dataDiskSizeGb(222L).metadata(Map.of("metadata-key", "metadata-value")).acceleratorConfig(new ApiGcpAiNotebookInstanceAcceleratorConfig().coreCount(4L).type("accelerator-type")).vmImage(new ApiGcpAiNotebookInstanceVmImage().projectId("project-id").imageFamily("image-family").imageName("image-name")).containerImage(new ApiGcpAiNotebookInstanceContainerImage().repository("repository").tag("tag"));
Instance instance = CreateAiNotebookInstanceStep.setFields(creationParameters, "foo@bar.com", new Instance());
assertEquals("script.sh", instance.getPostStartupScript());
assertEquals(true, instance.getInstallGpuDriver());
assertEquals("custom-path", instance.getCustomGpuDriverPath());
assertEquals("boot-disk-type", instance.getBootDiskType());
assertEquals(111L, instance.getBootDiskSizeGb());
assertEquals("data-disk-type", instance.getDataDiskType());
assertEquals(222L, instance.getDataDiskSizeGb());
assertThat(instance.getMetadata(), Matchers.aMapWithSize(2));
// git secrets gets a false positive if 'service_account' is double quoted.
assertThat(instance.getMetadata(), Matchers.hasEntry("proxy-mode", "service_" + "account"));
assertThat(instance.getMetadata(), Matchers.hasEntry("metadata-key", "metadata-value"));
assertEquals("foo@bar.com", instance.getServiceAccount());
assertEquals(sa_scopes, instance.getServiceAccountScopes());
assertEquals(4L, instance.getAcceleratorConfig().getCoreCount());
assertEquals("accelerator-type", instance.getAcceleratorConfig().getType());
assertEquals("project-id", instance.getVmImage().getProject());
assertEquals("image-family", instance.getVmImage().getImageFamily());
assertEquals("image-name", instance.getVmImage().getImageName());
assertEquals("repository", instance.getContainerImage().getRepository());
assertEquals("tag", instance.getContainerImage().getTag());
}
Aggregations