@Bean @Conditional(OnLocalPlatform.class) public TaskPlatform localTaskPlatform(LocalPlatformProperties localPlatformProperties) { List<Launcher> launchers = new ArrayList<>(); Map<String, LocalDeployerProperties> localDeployerPropertiesMap = localPlatformProperties.getAccounts(); for (Map.Entry<String, LocalDeployerProperties> entry : localDeployerPropertiesMap .entrySet()) { LocalTaskLauncher localTaskLauncher = new LocalTaskLauncher(entry.getValue()); Launcher launcher = new Launcher(entry.getKey(), "local", localTaskLauncher); launcher.setDescription(prettyPrintLocalDeployerProperties(entry.getValue())); launchers.add(launcher); } return new TaskPlatform("Local", launchers); }
@EventListener @Transactional public void initialize(ApplicationReadyEvent event) { if (noTaskLauncherExists()) { LocalDeployerProperties localDeployerProperties = new LocalDeployerProperties(); LocalTaskLauncher localTaskLauncher = new LocalTaskLauncher(localDeployerProperties); Launcher launcher = new Launcher("default", "local", localTaskLauncher); launcher.setDescription(prettyPrintLocalDeployerProperties(localDeployerProperties)); List<Launcher> localLaunchers = new ArrayList<>(); localLaunchers.add(launcher); for (TaskPlatform taskPlatform : taskPlatforms) { if (taskPlatform.getName().equalsIgnoreCase("Local")) { logger.info("Creating Local Task Launcher named 'default' since no Task Launchers configured."); taskPlatform.setLaunchers(localLaunchers); } } } this.taskPlatforms.forEach(platform -> { platform.getLaunchers().forEach(launcher -> { this.launcherRepository.save(launcher); logger.info(String.format( "Added '%s' platform account '%s' into Task Launcher repository.", platform.getName(), launcher.getName())); }); }); }
protected Launcher createAndSaveKubernetesTaskLaunchers(String account, KubernetesDeployerProperties kubernetesProperties) { KubernetesClient kubernetesClient = KubernetesClientFactory.getKubernetesClient(kubernetesProperties); ContainerFactory containerFactory = new DefaultContainerFactory( kubernetesProperties); KubernetesTaskLauncher kubernetesTaskLauncher = new KubernetesTaskLauncher( kubernetesProperties, kubernetesClient, containerFactory); Launcher launcher = new Launcher(account, "kubernetes", kubernetesTaskLauncher); launcher.setDescription( String.format("master url = [%s], namespace = [%s], api version = [%s]", kubernetesClient.getMasterUrl(), kubernetesClient.getNamespace(), kubernetesClient.getApiVersion())); return launcher; }
launcher.setDescription(String.format("org = [%s], space = [%s], url = [%s]", connectionProperties.getOrg(), connectionProperties.getSpace(), connectionProperties.getUrl()));
launcher.setDescription(String.format("org = [%s], space = [%s], url = [%s]", connectionProperties.getOrg(), connectionProperties.getSpace(), connectionProperties.getUrl()));