summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--application-preprocessor/.gitignore2
-rw-r--r--application-preprocessor/CMakeLists.txt4
-rw-r--r--application-preprocessor/OWNERS1
-rw-r--r--application-preprocessor/README1
-rw-r--r--application-preprocessor/pom.xml91
-rw-r--r--application-preprocessor/src/main/java/com/yahoo/application/preprocessor/ApplicationPreprocessor.java110
-rw-r--r--application-preprocessor/src/main/sh/vespa-preprocess-application85
-rw-r--r--application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java41
-rw-r--r--application-preprocessor/src/test/resources/simple/hosts.xml6
-rw-r--r--application-preprocessor/src/test/resources/simple/schemas/music.sd8
-rw-r--r--application-preprocessor/src/test/resources/simple/services.xml18
-rw-r--r--dist/vespa.spec1
-rw-r--r--pom.xml1
14 files changed, 0 insertions, 370 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3b9bc1c9f07..02e04b36f67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,6 @@ include_directories(BEFORE ${CMAKE_BINARY_DIR}/configdefinitions/src)
add_subdirectory(ann_benchmark)
add_subdirectory(application-model)
-add_subdirectory(application-preprocessor)
add_subdirectory(athenz-identity-provider-service)
add_subdirectory(client)
add_subdirectory(cloud-tenant-cd)
diff --git a/application-preprocessor/.gitignore b/application-preprocessor/.gitignore
deleted file mode 100644
index 12251442258..00000000000
--- a/application-preprocessor/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/target
-/pom.xml.build
diff --git a/application-preprocessor/CMakeLists.txt b/application-preprocessor/CMakeLists.txt
deleted file mode 100644
index d4b0b766fd8..00000000000
--- a/application-preprocessor/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-install_jar(application-preprocessor-jar-with-dependencies.jar)
-vespa_install_script(src/main/sh/vespa-preprocess-application bin)
-
diff --git a/application-preprocessor/OWNERS b/application-preprocessor/OWNERS
deleted file mode 100644
index 338ed581212..00000000000
--- a/application-preprocessor/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-hmusum
diff --git a/application-preprocessor/README b/application-preprocessor/README
deleted file mode 100644
index 2439078900e..00000000000
--- a/application-preprocessor/README
+++ /dev/null
@@ -1 +0,0 @@
-Contains the application preprocessor utility.
diff --git a/application-preprocessor/pom.xml b/application-preprocessor/pom.xml
deleted file mode 100644
index aae9f6bb13a..00000000000
--- a/application-preprocessor/pom.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0"?>
-<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>parent</artifactId>
- <version>8-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
- </parent>
- <artifactId>application-preprocessor</artifactId>
- <packaging>jar</packaging>
- <version>8-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>component</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>config-model-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>config-application-package</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>config-model</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>config-provisioning</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>vespajlib</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <configuration>
- <finalName>${project.artifactId}-jar-with-dependencies</finalName>
- <createDependencyReducedPom>false</createDependencyReducedPom>
- </configuration>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/application-preprocessor/src/main/java/com/yahoo/application/preprocessor/ApplicationPreprocessor.java b/application-preprocessor/src/main/java/com/yahoo/application/preprocessor/ApplicationPreprocessor.java
deleted file mode 100644
index 9696e9c9848..00000000000
--- a/application-preprocessor/src/main/java/com/yahoo/application/preprocessor/ApplicationPreprocessor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.application.preprocessor;
-
-import com.yahoo.config.application.api.ApplicationPackage;
-import com.yahoo.config.model.application.provider.BaseDeployLogger;
-import com.yahoo.config.model.application.provider.DeployData;
-import com.yahoo.config.model.application.provider.FilesApplicationPackage;
-import com.yahoo.config.provision.ApplicationId;
-import com.yahoo.config.provision.ApplicationName;
-import com.yahoo.config.provision.Environment;
-import com.yahoo.config.provision.InstanceName;
-import com.yahoo.config.provision.RegionName;
-import com.yahoo.config.provision.Tags;
-import com.yahoo.config.provision.TenantName;
-import com.yahoo.config.provision.Zone;
-import com.yahoo.yolean.Exceptions;
-import java.io.File;
-import java.io.IOException;
-import java.util.Optional;
-import java.util.Set;
-
-/**
- * Main entry for preprocessing an application package.
- *
- * @author Ulf Lilleengen
- */
-public class ApplicationPreprocessor {
-
- private final File applicationDir;
- private final Optional<File> outputDir;
- private final Optional<InstanceName> instance;
- private final Optional<Environment> environment;
- private final Optional<RegionName> region;
- private final Tags tags;
-
- public ApplicationPreprocessor(File applicationDir,
- Optional<File> outputDir,
- Optional<InstanceName> instance,
- Optional<Environment> environment,
- Optional<RegionName> region,
- Tags tags) {
- this.applicationDir = applicationDir;
- this.outputDir = outputDir;
- this.instance = instance;
- this.environment = environment;
- this.region = region;
- this.tags = tags;
- }
-
- public void run() throws IOException {
- FilesApplicationPackage.Builder applicationPackageBuilder = new FilesApplicationPackage.Builder(applicationDir);
- outputDir.ifPresent(applicationPackageBuilder::preprocessedDir);
- applicationPackageBuilder.deployData(new DeployData(applicationDir.getAbsolutePath(),
- ApplicationId.from(TenantName.defaultName(),
- ApplicationName.defaultName(),
- instance.orElse(InstanceName.defaultName())),
- tags,
- System.currentTimeMillis(),
- false,
- 0L,
- -1));
-
- ApplicationPackage preprocessed = applicationPackageBuilder.build().preprocess(new Zone(environment.orElse(Environment.defaultEnvironment()),
- region.orElse(RegionName.defaultName())),
- new BaseDeployLogger());
- preprocessed.validateXML();
- }
-
- public static void main(String[] args) {
- if (args.length < 1) {
- System.out.println("Usage: vespa-application-preprocessor <application package path> [instance] [environment] [region] [tag] [output path]");
- System.exit(1);
- }
- File applicationDir = new File(args[0]);
- Optional<InstanceName> instance;
- Optional<Environment> environment;
- Optional<RegionName> region;
- Tags tags;
- Optional<File> outputDir;
- if (args.length <= 4) { // Legacy: No instance and tags
- instance = Optional.empty();
- environment = args.length > 1 ? Optional.of(Environment.valueOf(args[1])) : Optional.empty();
- region = args.length > 2 ? Optional.of(RegionName.from(args[2])) : Optional.empty();
- tags = Tags.empty();
- outputDir = args.length > 3 ? Optional.of(new File(args[3])) : Optional.empty();
- }
- else {
- instance = Optional.of(InstanceName.from(args[1]));
- environment = Optional.of(Environment.valueOf(args[2]));
- region = Optional.of(RegionName.from(args[3]));
- tags = Tags.fromString(args[4]);
- outputDir = args.length > 5 ? Optional.of(new File(args[5])) : Optional.empty();
- }
- ApplicationPreprocessor preprocessor = new ApplicationPreprocessor(applicationDir,
- outputDir,
- instance,
- environment,
- region,
- tags);
- try {
- preprocessor.run();
- System.out.println("Application preprocessed successfully and written to " +
- outputDir.orElse(new File(applicationDir, FilesApplicationPackage.preprocessed)).getAbsolutePath());
- } catch (Exception e) {
- System.err.println("Error validating application package: " + Exceptions.toMessageString(e));
- System.exit(1);
- }
- }
-
-}
diff --git a/application-preprocessor/src/main/sh/vespa-preprocess-application b/application-preprocessor/src/main/sh/vespa-preprocess-application
deleted file mode 100644
index 172ee1653d2..00000000000
--- a/application-preprocessor/src/main/sh/vespa-preprocess-application
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-
-# BEGIN environment bootstrap section
-# Do not edit between here and END as this section should stay identical in all scripts
-
-findpath () {
- myname=${0}
- mypath=${myname%/*}
- myname=${myname##*/}
- empty_if_start_slash=${mypath%%/*}
- if [ "${empty_if_start_slash}" ]; then
- mypath=$(pwd)/${mypath}
- fi
- if [ "$mypath" ] && [ -d "$mypath" ]; then
- return
- fi
- mypath=$(pwd)
- if [ -f "${mypath}/${myname}" ]; then
- return
- fi
- echo "FATAL: Could not figure out the path where $myname lives from $0"
- exit 1
-}
-
-COMMON_ENV=libexec/vespa/common-env.sh
-
-source_common_env () {
- if [ "$VESPA_HOME" ] && [ -d "$VESPA_HOME" ]; then
- export VESPA_HOME
- common_env=$VESPA_HOME/$COMMON_ENV
- if [ -f "$common_env" ]; then
- . $common_env
- return
- fi
- fi
- return 1
-}
-
-findroot () {
- source_common_env && return
- if [ "$VESPA_HOME" ]; then
- echo "FATAL: bad VESPA_HOME value '$VESPA_HOME'"
- exit 1
- fi
- if [ "$ROOT" ] && [ -d "$ROOT" ]; then
- VESPA_HOME="$ROOT"
- source_common_env && return
- fi
- findpath
- while [ "$mypath" ]; do
- VESPA_HOME=${mypath}
- source_common_env && return
- mypath=${mypath%/*}
- done
- echo "FATAL: missing VESPA_HOME environment variable"
- echo "Could not locate $COMMON_ENV anywhere"
- exit 1
-}
-
-findhost () {
- if [ "${VESPA_HOSTNAME}" = "" ]; then
- VESPA_HOSTNAME=$(vespa-detect-hostname || hostname -f || hostname || echo "localhost") || exit 1
- fi
- validate="${VESPA_HOME}/bin/vespa-validate-hostname"
- if [ -f "$validate" ]; then
- "$validate" "${VESPA_HOSTNAME}" || exit 1
- fi
- export VESPA_HOSTNAME
-}
-
-findroot
-findhost
-
-ROOT=${VESPA_HOME%/}
-export ROOT
-
-# END environment bootstrap section
-
-cd ${VESPA_HOME} || { echo "Cannot cd to ${VESPA_HOME}" 1>&2; exit 1; }
-
-# get common PATH:
-. ${VESPA_HOME}/libexec/vespa/common-env.sh
-
-java -cp ${VESPA_HOME}/lib/jars/application-preprocessor-jar-with-dependencies.jar com.yahoo.application.preprocessor.ApplicationPreprocessor "$@"
diff --git a/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java b/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
deleted file mode 100644
index 4de4312c099..00000000000
--- a/application-preprocessor/src/test/java/com/yahoo/application/preprocessor/ApplicationPreprocessorTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.application.preprocessor;
-
-import com.yahoo.config.provision.Tags;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.io.TempDir;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import java.io.File;
-import java.io.IOException;
-import java.util.Optional;
-
-public class ApplicationPreprocessorTest {
-
- @TempDir
- public File outputDir;
-
- // Basic test just to check that instantiation and run() works. Unit testing is in config-application-package
- @Test
- void basic() throws IOException {
- ApplicationPreprocessor preprocessor = new ApplicationPreprocessor(new File("src/test/resources/simple"),
- Optional.of(newFolder(outputDir, "basic")),
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Tags.empty());
- preprocessor.run();
- }
-
- private static File newFolder(File root, String... subDirs) throws IOException {
- String subFolder = String.join("/", subDirs);
- File result = new File(root, subFolder);
- if (!result.mkdirs()) {
- throw new IOException("Couldn't create folders " + root);
- }
- return result;
- }
-
-}
diff --git a/application-preprocessor/src/test/resources/simple/hosts.xml b/application-preprocessor/src/test/resources/simple/hosts.xml
deleted file mode 100644
index 1b433ca4178..00000000000
--- a/application-preprocessor/src/test/resources/simple/hosts.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<hosts xmlns:deploy="vespa" xmlns:preprocess="properties">
- <host name="localhost">
- <alias>node1</alias>
- </host>
-</hosts>
diff --git a/application-preprocessor/src/test/resources/simple/schemas/music.sd b/application-preprocessor/src/test/resources/simple/schemas/music.sd
deleted file mode 100644
index 7da7c49c162..00000000000
--- a/application-preprocessor/src/test/resources/simple/schemas/music.sd
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-search music {
- document music {
- field f type string {
- indexing: index | summary
- }
- }
-}
diff --git a/application-preprocessor/src/test/resources/simple/services.xml b/application-preprocessor/src/test/resources/simple/services.xml
deleted file mode 100644
index 5cdf288bfb4..00000000000
--- a/application-preprocessor/src/test/resources/simple/services.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<!-- Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
-<services version='1.0' xmlns:deploy="vespa" xmlns:preprocess="properties">
- <preprocess:properties>
- <qrs.port>4099</qrs.port>
- <qrs.port>5000</qrs.port>
- </preprocess:properties>
-
- <preprocess:properties deploy:environment='prod'>
- <qrs.port deploy:region='us-west'>5001</qrs.port>
- <qrs.port deploy:region='us-east'>5002</qrs.port>
- </preprocess:properties>
- <admin version='2.0'>
- <adminserver hostalias='node0'/>
- </admin>
- <admin version='2.0' deploy:environment='prod'>
- <adminserver hostalias='node1'/>
- </admin>
-</services>
diff --git a/dist/vespa.spec b/dist/vespa.spec
index 4a1946824a6..1a8a104bb13 100644
--- a/dist/vespa.spec
+++ b/dist/vespa.spec
@@ -595,7 +595,6 @@ fi
%{_prefix}/include
%dir %{_prefix}/lib
%dir %{_prefix}/lib/jars
-%{_prefix}/lib/jars/application-preprocessor-jar-with-dependencies.jar
%{_prefix}/lib/jars/athenz-identity-provider-service-jar-with-dependencies.jar
%{_prefix}/lib/jars/cloud-tenant-cd-jar-with-dependencies.jar
%{_prefix}/lib/jars/clustercontroller-apps-jar-with-dependencies.jar
diff --git a/pom.xml b/pom.xml
index 79258d37c03..0b92f4361ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,6 @@
<modules>
<module>application</module>
<module>application-model</module>
- <module>application-preprocessor</module>
<module>athenz-identity-provider-service</module>
<module>bundle-plugin-test</module>
<module>client</module>