/** * Construct a Mesos URI. */ public static Protos.CommandInfo.URI uri(MesosArtifactResolver resolver, ContainerSpecification.Artifact artifact) { checkNotNull(resolver); checkNotNull(artifact); Option<URL> url = resolver.resolve(artifact.dest); if (url.isEmpty()) { throw new IllegalArgumentException("Unresolvable artifact: " + artifact.dest); } return Protos.CommandInfo.URI.newBuilder() .setValue(url.get().toExternalForm()) .setOutputFile(artifact.dest.toString()) .setExtract(artifact.extract) .setCache(artifact.cachable) .setExecutable(artifact.executable) .build(); }
/** * Construct a Mesos URI. */ public static Protos.CommandInfo.URI uri(URL url, boolean cacheable) { checkNotNull(url); return Protos.CommandInfo.URI.newBuilder() .setValue(url.toExternalForm()) .setExtract(false) .setCache(cacheable) .build(); }
.setValue(clusterProps.ignitePackageUrl() != null ? clusterProps.ignitePackageUrl() : resourceProvider.igniteUrl()) .setExtract(true)) .addUris(Protos.CommandInfo.URI.newBuilder() .setValue(cfgUrl));
targetConfigurationId, podSpec.getType(), taskSpec.getName(), config.getName())) .setOutputFile(getConfigTemplateDownloadPath(config)) .setExtract(false);
joinPaths(jenkinsMaster, SLAVE_JAR_URI_SUFFIX)).setExecutable(false).setExtract(false)); return commandBuilder;
public static Collection<CommandInfo.URI> createURIs( final Set<String> uris, boolean cacheFetchedUris) { return uris.stream() .map(uri -> CommandInfo.URI.newBuilder() .setCache(cacheFetchedUris) .setExecutable(false) .setExtract(true) .setValue(uri).build()) .collect(Collectors.toList()); }
private Protos.CommandInfo.URI buildURI(final CloudAppConfiguration appConfig, final boolean isCommandExecutor) { Protos.CommandInfo.URI.Builder result = Protos.CommandInfo.URI.newBuilder().setValue(appConfig.getAppURL()).setCache(appConfig.isAppCacheEnable()); if (isCommandExecutor && !SupportedExtractionType.isExtraction(appConfig.getAppURL())) { result.setExecutable(true); } else { result.setExtract(true); } return result.build(); }
private void detectAndAddAdditionalURIs(Request request, CommandInfo.Builder commandBuilder) { if (request.request.slaveInfo.getAdditionalURIs() != null) { for (MesosSlaveInfo.URI uri : request.request.slaveInfo.getAdditionalURIs()) { commandBuilder.addUris( CommandInfo.URI.newBuilder().setValue( uri.getValue()).setExecutable(uri.isExecutable()).setExtract(uri.isExtract())); } } }