public static void startServices(ServiceHost host) { startServices(host, ContainerImageService.class, ContainerImageTagsService.class, PopularImagesService.class); }
@Test public void testGetDefaultPopularImages() throws Throwable { // without the 'container.user.resources.path' configuration attribute set // the default popular images will be returned HostInitImageServicesConfig.startServices(host); waitForServiceAvailability(PopularImagesService.SELF_LINK); Collection<?> images = getDocument(Collection.class, PopularImagesService.SELF_LINK); assertNotNull(images); assertEquals(15, images.size()); }
HostInitImageServicesConfig.startServices(host); HostInitRegistryAdapterServiceConfig.startServices(host);
@Test public void testGetExternalPopularImages() throws Throwable { // with the 'container.user.resources.path' configuration attribute set // the images of the popular-images.json file there will be returned HostInitCommonServiceConfig.startServices(host); waitForServiceAvailability(ConfigurationFactoryService.SELF_LINK); waitForServiceAvailability(UriUtils.buildUriPath(UriUtils.buildUriPath( ConfigurationFactoryService.SELF_LINK, FileUtil.USER_RESOURCES_PATH_VARIABLE))); ConfigurationState config = new ConfigurationState(); config.documentSelfLink = UriUtils.buildUriPath(ConfigurationFactoryService.SELF_LINK, FileUtil.USER_RESOURCES_PATH_VARIABLE); config.key = FileUtil.USER_RESOURCES_PATH_VARIABLE; config.value = Paths.get(PopularImagesServiceTest.class.getResource("/containers").toURI()) .toString(); ConfigurationState storedConfig = doPut(config); assertNotNull(storedConfig); HostInitImageServicesConfig.startServices(host); waitForServiceAvailability(PopularImagesService.SELF_LINK); Collection<?> images = getDocument(Collection.class, PopularImagesService.SELF_LINK); assertNotNull(images); assertEquals(5, images.size()); }
/** * Start all services required to support management of infrastructure and applications. */ protected void startManagementServices() throws Throwable { this.log(Level.INFO, "Management service starting ..."); registerForServiceAvailability(CaSigningCertService.startTask(this), true, CaSigningCertService.FACTORY_LINK); HostInitComputeServicesConfig.startServices(this, false); HostInitComputeBackgroundServicesConfig.startServices(this); HostInitRequestServicesConfig.startServices(this); HostInitImageServicesConfig.startServices(this); HostInitUiServicesConfig.startServices(this); HostInitHarborServices.startServices(this, startMockHostAdapterInstance); HostInitDockerAdapterServiceConfig.startServices(this, startMockHostAdapterInstance); HostInitKubernetesAdapterServiceConfig.startServices(this, startMockHostAdapterInstance); HostInitRegistryAdapterServiceConfig.startServices(this); this.log(Level.INFO, "Management services started."); }